CitiesSkylinesMultiplayer / CSM

Source code for the Cities: Skylines Multiplayer mod (CSM)
https://citiesskylinesmultiplayer.com/
MIT License
724 stars 99 forks source link

Send game save file on connect. #45

Open DominicMaas opened 5 years ago

DominicMaas commented 5 years ago

Introduction

When a player connects to the server, both server and client should be paused. Once paused, the server needs to grab a copy of the save game (this can be done with raw IO requests if there is no exposed method), and send it to the client (via TCP to ensure nothing is lost). Once the client receives the world, it needs to then load it (somehow) and unpause the game. To prevent the user from unpausing the game during this process, a giant loading screen will be displayed above all content.

Key Points

JABirchall commented 5 years ago

Would it be possible to just send the game state to the client instead of the whole save. I beleive the server should be responsable to keeping the save file and keeping the clients in sync with that save.

DominicMaas commented 5 years ago

It's more of a starting off point, the save is only synced on first connect (too much information to sync manually), after the save is sent over, the client and server will keep each other in sync.

DominicMaas commented 5 years ago

Lets use the branch game-load-save as a starting off point. There's some good notes by root#0042 located here: https://github.com/DominicMaas/Tango/wiki/Development-Notes

So it's easier to understand what's happening, if you have performed some work on this feature, feel free to assign yourself to this issue.

DominicMaas commented 4 years ago

Code changes are being tracked in https://github.com/DominicMaas/Tango/pull/140

slash-under commented 1 year ago

Hello there. While playing on a shared network, I saw some issues that appear to be related to network corruption of the save game, in that it happens intermittently when loading. Is there any existing check-summing or hashing of the save game during the initial transfer process?