44import com .nexoscript .nexonet .api .crypto .KeySize ;
55import com .nexoscript .nexonet .api .packet .IPacketManager ;
66import com .nexoscript .nexonet .api .packet .Packet ;
7+ import com .nexoscript .nexonet .logger .LoggingType ;
78import com .nexoscript .nexonet .logger .NexonetLogger ;
89import com .nexoscript .nexonet .packet .crypto .CryptoManager ;
910import org .json .JSONObject ;
@@ -49,9 +50,9 @@ public String toJson(Packet packet) {
4950 e .printStackTrace ();
5051 }
5152 if (useEncryption ) {
52- System . out . println ( "[Crypto Decrypted] : " + json );
53+ this . logger . log ( LoggingType . INFO , "[Crypto Decrypted] : " + json );
5354 String s = this .cryptoManager .encryptString (json .toString ());
54- System . out . println ( "[Crypto Encrypted] : " + s );
55+ this . logger . log ( LoggingType . INFO , "[Crypto Encrypted] : " + s );
5556 return s ;
5657 }
5758 return json .toString ();
@@ -60,10 +61,10 @@ public String toJson(Packet packet) {
6061 public Packet fromJson (String jsonString ) {
6162 try {
6263 String encrytedString = jsonString ;
63- System . out . println ( "[Crypto Encrypted] : " + encrytedString );
64+ this . logger . log ( LoggingType . INFO , "[Crypto Encrypted] : " + encrytedString );
6465 if (useEncryption )
6566 encrytedString = this .cryptoManager .decryptString (jsonString );
66- System . out . println ( "[Crypto Decrypted] : " + encrytedString );
67+ this . logger . log ( LoggingType . INFO , "[Crypto Decrypted] : " + encrytedString );
6768 JSONObject json = new JSONObject (encrytedString );
6869 String type = json .getString ("type" );
6970 Class <? extends Packet > clazz = this .packetRegistry .get (type );
0 commit comments