fogleman / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
10.38k stars 1.39k forks source link

python 3 upgrade;few code semantics;new py3 bytes vs all string in py2 #304

Closed yahavb closed 1 year ago

yahavb commented 1 year ago

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))

yahavb commented 1 year ago

I just noticed https://github.com/fogleman/Craft/pull/302 did it already so closing this one