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

Scene switching support #8

Closed
arthuro555 opened this issue Aug 3, 2022 · 0 comments
Closed

Scene switching support #8

arthuro555 opened this issue Aug 3, 2022 · 0 comments
Assignees
Labels
✨ Feature New feature or request
Milestone

Comments

@arthuro555
Copy link
Owner

THNK should not stop working when swithcing scenes, here is how it should behave:

On the client

Full scene switch

Stop the THNK client and start the next scene in normal singleplayer mode

Pausing the scene

Don't disconnect from the server yet, and launch the scene in singleplayer mode. The server will not send any state updates while paused. If resumed, the server will send back a full scene snapshot again. If the scene is topped while paused, the server will finally see the client as disconnected.

Returning to paused scene

Stop the THNK client and go back to to the previous scene in singleplayer mode.

On the server

Full scene switch

Tell all the clients to switch to that scene as well, run the connection event for all connected clients on the new scene, and send a snapshot of the scene after running a first tick to all clients.

Pausing the scene

Tell all the clients to pause the current scene and go to that scene as well, run the connection event for all connected clients on the new scene, and send a snapshot of the scene after running a first tick to all clients.

Returning to paused scene

If the server returns to the scene before it was a server, close the THNK server.
Else, send a message to all players telling them to go back to the previous scene, and send to the players that have joined after the pausing the scene state at the moment of pausing.

@arthuro555 arthuro555 added this to the THNK Beta milestone Aug 3, 2022
@arthuro555 arthuro555 self-assigned this Aug 6, 2022
@arthuro555 arthuro555 added the ✨ Feature New feature or request label Aug 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
✨ Feature New feature or request
Projects
Status: Done
Development

No branches or pull requests

1 participant