From bf748ab93e47fc6112171716e356be6a3c32d99e Mon Sep 17 00:00:00 2001 From: Kyle Clemens Date: Tue, 19 Nov 2013 08:43:29 -0500 Subject: [PATCH] Fixed: Parse packet 3 messages Fixed: Decode unicode escapes Fixed: Use JSON, not AST --- networking/NetworkManager.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/networking/NetworkManager.py b/networking/NetworkManager.py index 8e3741e..74e307b 100644 --- a/networking/NetworkManager.py +++ b/networking/NetworkManager.py @@ -14,6 +14,7 @@ from Crypto.Util import asn1 from Crypto.PublicKey import RSA from Crypto.Cipher import AES from Crypto.Cipher import PKCS1_v1_5 +from json import loads EntityID = 0 @@ -197,11 +198,10 @@ class PacketListener(threading.Thread): print "Logged in \o/ Received an entity id of " + str(packet['EntityID']) elif (response == "\x03"): packet = PacketListenerManager.handle03(self.FileObject) + filtered_string = loads(packet['Message'])["text"] if not self.connection.options.disableAnsiColours: - filtered_string = Utils.translate_escapes(packet['Message']) - else: - filtered_string = packet['Message'] - print filtered_string + filtered_string = Utils.translate_escapes(filtered_string) + print filtered_string.decode("unicode-escape") elif (response == "\x04"): packet = PacketListenerManager.handle04(self.FileObject)