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

Rewrite some internal code to allow better disconnect handling #881

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

AlexProgrammerDE
Copy link
Contributor

This code changes a few things around the codebase:

  • DisconnectionDetails were introduced and allow more extension in the future. Those can be used in the future to attach even more info to disconnects. (Like Minecraft does)
  • PacketFlow was introduced to handle server disconnect packets inside NetworkSession
  • NetworkSession and children now only accept MinecraftProtocol which removes unnecessary casts across the codebase and makes it easier to do Minecraft-related changes specifically. The library slowly moves away from accepting non-minecraft serlization for network sessions.
  • Disconnect method behaviour was changed to match Minecraft, may affect events, but tests still pass and disconnects still get handled properly with events.
  • Errors in packet sending are now fired on the event loop to ensure processing.
  • Server packet disconnect handling was moved to NetworkSession, just like Minecrafts Connection class
  • Add/remove checks to match Minecrafts behaviour
  • isConnected now no longer considers being disconnected to match Minecrafts behaviour (tests still pass)
  • Some small syntax cleanups where code was unnecessary.

This code changes a few things around the codebase:
- DisconnectionDetails were introduced and allow more extension in the future. Those can be used in the future to attach even more info to disconnects. (Like Minecraft does)
- PacketFlow was introduced to handle server disconnect packets inside NetworkSession
- NetworkSession and children now only accept MinecraftProtocol which removes unnecessary casts across the codebase and makes it easier to do Minecraft-related changes specifically. The library slowly moves away from accepting non-minecraft serlization for network sessions.
- Disconnect method behaviour was changed to match Minecraft, may affect events, but tests still pass and disconnects still get handled properly with events.
- Errors in packet sending are now fired on the event loop to ensure processing.
- Server packet disconnect handling was moved to NetworkSession, just like Minecrafts Connection class
- Add/remove checks to match Minecrafts behaviour
- isConnected now no longer considers being disconnected to match Minecrafts behaviour (tests still pass)
- Some small syntax cleanups where code was unnecessary.
…t to know all state switches as the NetworkSession)
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