added ability to chat and fixed bug with windows terminal
This commit is contained in:
1 parent
12bc7c3ab9
commit
96b0937e3e
3 files changed
+4
-5
No files matched your search
+1
-1
@@ -87,7 +87,7 @@ class PacketListener(threading.Thread):
|
||||
if(response[0] == "\x01"):
|
||||
PacketListenerManager.handle01(self.FileObject)
|
||||
if(response[0] == "\x03"):
|
||||
print PacketListenerManager.handle03(self.FileObject)
|
||||
print PacketListenerManager.handle03(self.FileObject).replace(u'\xa7', '&')
|
||||
if(response[0] == "\x04"):
|
||||
PacketListenerManager.handle04(self.FileObject)
|
||||
if(response[0] == "\x05"):
|
||||
|
||||
@@ -709,9 +709,7 @@ def handleFA(FileObject):
|
||||
}
|
||||
|
||||
def handleFF(FileObject):
|
||||
print "Parsing disconnect packet"
|
||||
length = struct.unpack('!h', FileObject.read(2))[0] * 2
|
||||
print "Length of string will be " + str(length)
|
||||
Reason = FileObject.read(length)
|
||||
Reason = Reason.decode("utf-16be", 'strict')
|
||||
print Reason
|
||||
|
||||
@@ -99,8 +99,9 @@ if __name__ == "__main__":
|
||||
port = 25565
|
||||
connection = NetworkManager.ServerConnection(None, derp['Username'], passwd, sessionid, host, port)
|
||||
connection.start()
|
||||
raw_input()
|
||||
PacketSenderManager.send03(connection.grabSocket(), "/report Test report from pyCraft, hope this works :3")
|
||||
while True:
|
||||
chat = raw_input()
|
||||
PacketSenderManager.send03(connection.grabSocket(), chat)
|
||||
else:
|
||||
app = wx.PySimpleApp()
|
||||
Login = GUI.MainFrame(None, -1, "")
|
||||
|
||||
Reference in new issue
Block a user