Spawn with same character on dedicated server.
Im the dev of "Corma" (game is free on steam). I have a big issue that i cant solve by my self.
I have a dedicated server that players can join and play on. Which they are. But i have a problem. When a player leaves the game and then tries to join the server again the player gets a new character with an empty inventory. So now he/she cant use thier old stuff they crafted or placed because thier are not the owner.
However if i restart the server, everyone will spawn in as that character they made the first time on the server.
Ive tried to read on google and on forums and it seems that on default the game state or player state is deleted on disconnect, but my save system saves them. Thats why its working after restart?
The thing i want to do is to remove that delete on playerstate so if the same steam ID64 joins the server he will posses that same pawn and get the same char. Hopefully someone will understand and have an idea on what to do :D
Thanks in advance Nemo
asked Feb 12 '19 at 05:30 PM in C++ Programming
GameState isn't deleted on player disconnect as it lives on server. Restarting a level recreates a GameState.
PlayerState gets destroyed after the player logs out so save it OnLogout and restore it when the player with the same SteamID reconnects.
You can save your PlayerState map on GameInstance so it persists even on load level.
Follow this question
Once you sign in you will be able to subscribe for any updates here