This repository has been archived on 2020-03-29. You can view files and clone it, but cannot push or open issues or pull requests.
sampy_archive/handlers/mainHandler.py
2018-09-24 11:37:21 +02:00

19 lines
537 B
Python

from . import handshakeHandler
def handle(client, data):
print("?[{}] -> {} / {}".format(client.addr, data, data.hex()))
if client.state == 0: # Perform handshake if possible
client.state = 1
return b"\x1a\x1e\xd1\xd1"
if client.state == 1:
client.state = 2
return b"\x19\x00"
if client.state == 2:
client.state = 3
return b"\xe3\x00\x00"
if client.state == 3:
client.state = 4
return b"\xe3\x00\x00", b"\x00\x00\x42\x98\x0c\x11\x33\x45\x30\x42\x33\x33\x35\x32\x37\x34\x46\x39\x31\x43\x39\x39\x00"
return b"WUT?"