How do you store save game from a client on the server

Hi. lately iv been trying to create a multiplayer game but came across 1 problem. saving game data in a way so a player cant cheat.

I could do it so the player saves their game locally on their own pc but that would mean that they could cheat in singleplayer, then connect to multiplayer (with the same savegame ofc) and they would have al the data they had from the singeplayer game on multiplayer. this would mean people could cheat etc.

I need to find a way so the client connects to a server and every clients data (like level,items,currency. is saved on the pc that is running the server. that will mean if I get 100currency on server 1 and I log in server 2 I don’t have that same currency there because the savegame of the player is on the server 1’s pc.

this would mean that I want the server to save all the data of the clients on the servers pc. so everytime someone connects to the server their data is not saved on their pc but on the server pc this would prevent cheating etc. plz help I really need to get past this to continue with my online game. (I want the server to save the data and I don’t want to use a database like MySQL or something I just want the server pc to contain the data.

Hi, your best bet is to use an SQL server
To do this you could use a plugin like VaRest to send JSON to a web page (written in any language that can interact with SQL and JSON, such as PHP)

The JSON would contain everything you want to save, this is posted to the SQL server and saved till then next login
When they login you get all the data associated with that player and save it to their character

You’ll probably have to have a registration with username and password to associate with the player when saving and downloading the data.

For my game a player registers online, then creates a character, this character is added to the SQL database.
In-game the player logs in, the SQL server looks up the username and tries to find a character with that name and downloads the data to your Player Controller

Hope this helps