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

#45 sub 11 | Added sync chat command #165

Merged
merged 7 commits into from
Jan 24, 2020
Merged

#45 sub 11 | Added sync chat command #165

merged 7 commits into from
Jan 24, 2020

Conversation

ghpdohmen
Copy link
Contributor

Quick disclaimer: My first contribution to this project

This should add a sync chat command. I haven't tested this yet

@ghpdohmen ghpdohmen requested a review from kaenganxt January 16, 2020 12:24
Copy link
Member

@kaenganxt kaenganxt left a 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
Copy link
Member

@kaenganxt kaenganxt left a 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!

@kaenganxt kaenganxt merged commit 7c16120 into CitiesSkylinesMultiplayer:master Jan 24, 2020
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.

2 participants