Command line interaction made much better, try start.py --help for details
Bumped up protocol version Added packet dumping Handle disconnects more cleanly
This commit is contained in:
1 parent
2a09899634
commit
7c1d5bdc39
4 files changed
+128
-86
No files matched your search
@@ -6,7 +6,7 @@ def sendHandshake(socket, username, host, port):
|
||||
socket.send("\x02")
|
||||
|
||||
#byte - protocol version
|
||||
socket.send(struct.pack('!b', 39))
|
||||
socket.send(struct.pack('!b', 47))
|
||||
|
||||
#string - username
|
||||
socket.send(struct.pack('!h', username.__len__()))
|
||||
@@ -44,4 +44,8 @@ def sendFC(socket, secret, token):
|
||||
|
||||
#token
|
||||
socket.send(struct.pack('!h', token.__len__())) #length
|
||||
socket.send(token)
|
||||
socket.send(token)
|
||||
|
||||
def sendFF(socket, reason):
|
||||
socket.send(struct.pack('!h', reason.__len__())) #length
|
||||
socket.send(reason.encode("utf-16be")) #message
|
||||
Reference in new issue
Block a user