07.10.2014, 23:17
Currently, I use MySQL account system (r39-2) in the traditional way. You load user data into variables when he connects, and send an UPDATE query when he disconnects.
Sometimes, the server might crash, be DDoSed or whatsoever. I don't want to lose users' data and have a rollback.
What would be the optimal way to solve this?
Saving users' stats every X amount of time?
Updating the MySQL entry whenever the variable changes?
P.S. I have an additional question. Is it okay to use mysql_pquery when OnGameModeExit is called? I'm afraid that the server will shutdown before all threaded queries are executed.
Sometimes, the server might crash, be DDoSed or whatsoever. I don't want to lose users' data and have a rollback.
What would be the optimal way to solve this?
Saving users' stats every X amount of time?
Updating the MySQL entry whenever the variable changes?
P.S. I have an additional question. Is it okay to use mysql_pquery when OnGameModeExit is called? I'm afraid that the server will shutdown before all threaded queries are executed.