-
Notifications
You must be signed in to change notification settings - Fork 42
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
Server refactor #403
Server refactor #403
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refreshing server status during initial world gen causes a crash
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Crash when loading a world from disk
EDIT: nvm... seems fine after a clean
👀 |
Average obsidian update experience |
I was not aware of priorityqueue being a thing, cool! |
This is a refactoring of Server, WorldManager and packet broadcasting. Abstracting them out further and removing a lot of circular dependencies.
Notable Changes:
WorldManager is now a hosted service. It will load or generate specified worlds right after the server itself is started and also manage every loaded world chunk on its own loop. Note that this doesn't tick worlds, as that still handled within the main server loop
Packet broadcasting is no longer handled by the server class and is now handled by the PacketBroadcaster class & registered as a hosted service as well for priority queuing & sending packets. There are methods to skip the queue and directly send packets to clients if needed. This is the first iteration and needs more discussion.
Entities no longer depend directly on the server to broadcast packets & will inherit the packet broadcaster service from their respective worlds. With this change, we'll have to implement more methods to do specific things (like rotating an entity's head) and not do any packet broadcasting outside of the entity class and serverbound packets.
I planned to also include the plugin manager refactor here but since its as big as these first couple changes so I left it out (#377) ~
I believe these changes are pushing the server further to be more clean and concise while tackling (#185). The end goal is to depend more on Microsoft's hosting extensions and not be overwhelmed overall.