Fixed: Parse packet 3 messages
Fixed: Decode unicode escapes Fixed: Use JSON, not AST
This commit is contained in:
1 parent
bc4115e2b6
commit
bf748ab93e
1 file changed
+4
-4
@@ -14,6 +14,7 @@ from Crypto.Util import asn1
|
|||||||
from Crypto.PublicKey import RSA
|
from Crypto.PublicKey import RSA
|
||||||
from Crypto.Cipher import AES
|
from Crypto.Cipher import AES
|
||||||
from Crypto.Cipher import PKCS1_v1_5
|
from Crypto.Cipher import PKCS1_v1_5
|
||||||
|
from json import loads
|
||||||
|
|
||||||
EntityID = 0
|
EntityID = 0
|
||||||
|
|
||||||
@@ -197,11 +198,10 @@ class PacketListener(threading.Thread):
|
|||||||
print "Logged in \o/ Received an entity id of " + str(packet['EntityID'])
|
print "Logged in \o/ Received an entity id of " + str(packet['EntityID'])
|
||||||
elif (response == "\x03"):
|
elif (response == "\x03"):
|
||||||
packet = PacketListenerManager.handle03(self.FileObject)
|
packet = PacketListenerManager.handle03(self.FileObject)
|
||||||
|
filtered_string = loads(packet['Message'])["text"]
|
||||||
if not self.connection.options.disableAnsiColours:
|
if not self.connection.options.disableAnsiColours:
|
||||||
filtered_string = Utils.translate_escapes(packet['Message'])
|
filtered_string = Utils.translate_escapes(filtered_string)
|
||||||
else:
|
print filtered_string.decode("unicode-escape")
|
||||||
filtered_string = packet['Message']
|
|
||||||
print filtered_string
|
|
||||||
|
|
||||||
elif (response == "\x04"):
|
elif (response == "\x04"):
|
||||||
packet = PacketListenerManager.handle04(self.FileObject)
|
packet = PacketListenerManager.handle04(self.FileObject)
|
||||||
|
|||||||
Reference in new issue
Block a user