@KingOfProgramz
The way I do it roughly is:
-
Before quitting the game, or loading a new level or whatever, in each players state, I gather all data I want to be saved about that player and put it in a single struct (including name, steam id, stats, progress, location, class etc etc) (lets call it PlayerStruct)
-
The server loops through each player state, gets the newly updated player struct and saves it in an array of PlayerStructs. I then save that Array of PlayerStructs to a file.
-
When a new level opens or a game is continued or whatever, every connected player checks their game instance (since clients only see their instance) and sends their own name and/or steamid to the server.
-
On the server, compare every connected players name and/or steamid with every saved index in the array of PlayerStructs from step 2. I basically get each saved player struct, one at a time, break the required info output and compare it to the current player.
-
If a match is found, send the data to the matching players playerstate.
-
Repeat from step 1 when required.
Sorry for my late reply
I just saw a notification here now.