I did a lot in this PR, so please let know if there are things that should be changed. By itself, it should still work with all servers as expected as the client should always fall back to using strictly TCP. However, only the UDP rust server will allow use of the UDP feature currently. Also with the send queue bottleneck, the UDP improvements don't feel very noticeable. Here is a small summary of what I did.
If you have any questions, ping me on discord.
Network stuff:
Adds several packet types to perform a UDP handshake.
If UDP connection active, send all player and cap packets through UDP, everything else remains on TCP
Add debug menu item to show UDP status
Change recv to be polling
Split recv to be a TCP and UDP variant
Allows unknown packets to properly be consumed from socket (same as #37)
Changed TCP recv to use if guards to prevent indention pyramid
Bug fixes:
Fix a race condition involving every thread trying to close socket and failing
Drain send/recv queues on reconnect
Hopefully fix a race condition with both send/recv threads initializing each other
Tooling:
Change Makefile to use python3 instead of python3.8
Change tcp script to use USER and PASS like Makefile expected
Unimportant stuff:
Fix success and receive spelling errors :P
Maybe added some tabs on accident (please tell me if you find any)
I did a lot in this PR, so please let know if there are things that should be changed. By itself, it should still work with all servers as expected as the client should always fall back to using strictly TCP. However, only the UDP rust server will allow use of the UDP feature currently. Also with the send queue bottleneck, the UDP improvements don't feel very noticeable. Here is a small summary of what I did.
If you have any questions, ping me on discord.
Network stuff:
Bug fixes:
Tooling:
Unimportant stuff: