love this Craft game to demonstrate stateful multiplayer game. I upgraded the python version from v2 to v3.
The fix is twofold. 1/ python3 library semantics e.g., Queue vs queue or SocketServer vs socketserver, thread.setDaemon(True) vs thread.daemon= True.
2/ in Python 3; strings are now always Unicode so needed to decode bytes from client to string class Handler and encode back before self.request.sendall(str.encode(data))
love this Craft game to demonstrate stateful multiplayer game. I upgraded the python version from v2 to v3. The fix is twofold. 1/ python3 library semantics e.g.,
Queue
vsqueue
orSocketServer
vssocketserver
,thread.setDaemon(True)
vsthread.daemon= True
. 2/ in Python 3; strings are now always Unicode so needed to decode bytes from client to stringclass Handler
and encode back beforeself.request.sendall(str.encode(data))