Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow udp communication for movement #39

Merged
merged 43 commits into from
Sep 2, 2023
Merged

Conversation

speyejack
Copy link
Collaborator

@speyejack speyejack commented Oct 30, 2022

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 Packet acceptance #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)

@speyejack speyejack mentioned this pull request Oct 30, 2022
@speyejack speyejack merged commit 1da9626 into CraftyBoss:dev Sep 2, 2023
3 checks passed
@Istador Istador mentioned this pull request Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant