- Home /
How to save player states to the SQL on the Network Server?
Hello everyone.
I'm new in Unity and just getting around opportunities it provides.
My question is how to save data to Sql on the Unity network server? Consider the following:
I know how to connect to SQL and do the stuff whatever I want
I have server side scripts which runs only on the network server
Players logs in using login scene and SQL
I do not want:
Client to be accessing SQL
Use MMO middleware like Photon and etc.
Therefore, I need to understand:
Where is the best place to put the logic that will save player's position. So, when it he pr she disconnected and recconected I can restore the position. What method of the NetworkBehaviour script should I use? Where is the best place to save player's states (hp, xp and etc.)?
If I place code in OnPlayerDisconnect, then is the a way to associate the player with SQL ids? As far as I know there is NetworkPlayer parameter that does not store any info about who this player is (SQL user Id). Moreover, if the server is down (electricity goes off), players' states will not be saved.
How many words... The main point, does Unity 5 has an instrument (method) that allows implement player synchronization with SQL?
Thank you for your help.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Allowing users to create customizable characters 1 Answer
Saving enviroment over network? 0 Answers
Can i save changes to environment in multiplayer game? 1 Answer
AllocatedID error 1 Answer