# Yes, this source code is terrible. # It's just something I've put together to test the server # before I write a *real* client. import sys, socket, ssl, threading, struct from PyQt5 import QtCore, QtGui, QtWidgets protocolVer = 1 sock = None authed = False sessionKey = b'\0'*16 nextID = 1 lastReceivedPacketID = 0 packetCache = [] packetLock = threading.Lock() u32 = struct.Struct(' bufsize: break type, reserved, size = struct.unpack_from(' bufsize: break pos += 8 with packetLock: if ((type & 0x8000) == 0): pid, lastReceivedByServer = struct.unpack_from('