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

Be able to hot reload server/host. #8

Open
ValorZard opened this issue Jul 2, 2021 · 1 comment
Open

Be able to hot reload server/host. #8

ValorZard opened this issue Jul 2, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@ValorZard
Copy link

ValorZard commented Jul 2, 2021

During a match/game/connection, it should be possible to switch the host for someone else. For example, if Player A in an authoritative host model is the host, they should be able to leave and Player B should become the new host. A basic pseudocode for how this would work is as follows.

(1) Spawn up the new server and set a flag to disable sending out snapshots at first, and sync the time and state to the old server. (will be a bit fiddly)
(2) Have the clients add this new server as a new connection (I think CrystalOrb can already support this step), so that any new player commands would get sent to both the old and the new server
(3) Tell the old server to stop sending out its snapshots at time T into the future, and tell the new server to start sending its snapshot also at time T.
(4) Remove the old server from the client's connections

Note:
In the case of picking a new host, there might be a need to have a default algorithm for picking the new host (second person to join the match/lobby), but the user should be able to set their own (the closest to everyone/someone who had the highest score/etc)

@ValorZard
Copy link
Author

Here's another idea that this could lend itself to. If the host has a particularly shoddy connection, we could hypothetically force it away from it and give it to the peer with the best connection.

@ErnWong ErnWong added the enhancement New feature or request label Oct 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants