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

feat: improve packet handling #63

Merged
merged 5 commits into from
Apr 1, 2024

Conversation

TestingPlant
Copy link
Collaborator

This includes several changes:

  • Packets now have metadata. This metadata can be used to prevent a specific player from receiving a packet and to mark the packet as being allowed to be dropped.
  • Packets can be dropped. This is useful to stop clients from going more and more into the past. For example, if a client has a 1 MiB/s download speed and the server is sending the client 2 MiB/s of entity movement packets, the client will be more behind as time progresses. To solve this, some movement packets will be dropped.
  • Includes functions to get players' download speed, ping, and send window size which will be useful to determine how much data needs to be dropped.
  • Removes the server_port == 25565 check so it's easier to use a proxy to connect to the server.

This includes several changes:
- Packets now have metadata. This metadata can be used to prevent a
  specific player from receiving a packet and to mark the packet as
  being allowed to be dropped.
- Packets can be dropped. This is useful to stop clients from going more
  and more into the past. For example, if a client has a 1 MiB/s
  download speed and the server is sending the client 2 MiB/s of entity
  movement packets, the client will be more behind as time progresses.
  To solve this, some movement packets will be dropped.
- Includes functions to get players' download speed, ping, and send
  window size which will be useful to determine how much data needs to
  be dropped.
- Removes the `server_port == 25565` check so it's easier to use a proxy
  to connect to the server.
@TestingPlant
Copy link
Collaborator Author

Ideally the randomness is replaced with the broadcast code from #17

@andrewgazelka
Copy link
Collaborator

Thanks for your work. I will review it tomorrow when I wake up. :)

Copy link
Collaborator

@andrewgazelka andrewgazelka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few changes :)

server/src/io.rs Show resolved Hide resolved
server/src/singleton/encoder.rs Outdated Show resolved Hide resolved
server/src/system/broadcast_packets.rs Outdated Show resolved Hide resolved
server/src/system/broadcast_packets.rs Show resolved Hide resolved
server/src/system/broadcast_packets.rs Show resolved Hide resolved
server/src/io.rs Show resolved Hide resolved
server/src/io.rs Outdated Show resolved Hide resolved
server/src/io.rs Outdated Show resolved Hide resolved
@andrewgazelka andrewgazelka changed the title feat: improve packet handling (#58) feat: improve packet handling Apr 1, 2024
@andrewgazelka andrewgazelka enabled auto-merge (squash) April 1, 2024 14:51
@andrewgazelka andrewgazelka merged commit 692999d into hyperion-mc:main Apr 1, 2024
5 checks passed
@TestingPlant TestingPlant mentioned this pull request Apr 1, 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.

2 participants