-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
#45 sub 11 | Added sync chat command #165
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.
Firstly, thanks for your interest in our project and your contribution!
I looked at your code and it seems to be a nice and clean way to implement this feature.
There are just some things that need to be fixed/improved:
After my test it doesn't appear to be working. The world is transferred to the client, but the client doesn't start to load the level. I think you need to make sure that the client state is set to Downloading before requesting the world like it happens when joining the server: https://github.com/DominicMaas/Tango/blob/master/src/Commands/Handler/Internal/ConnectionResultHandler.cs#L30
You also need to make sure that the game is paused and blocked on all other clients while the level is being loaded, so that there are no new conflicts (See https://github.com/DominicMaas/Tango/blob/master/src/Commands/Handler/Internal/ConnectionRequestHandler.cs#L142-L148, needs to be performed on the server)
You are also currently not saving the game before sending it to the client. You need to perform similar actions like on joining: See https://github.com/DominicMaas/Tango/blob/master/src/Commands/Handler/Internal/ConnectionRequestHandler.cs#L157-L173
Hopefully made all the required fixes for the sync command: -set client state to downloading -pause game for all clients -save game before sending to client
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.
Looks good to me. I'll merge this and open another pull request with some changes to this mechanism (mostly refactoring).
Thank you for your contribution!
Quick disclaimer: My first contribution to this project
This should add a sync chat command. I haven't tested this yet