Posts: 140
Threads: 46
Joined: Jun 2010
Reputation:
0
Hi guys !
I am looking for a way to record the accounts of players in a server crash for example.
I thought of a "Timer" which make a backup every X seconds or use OnPlayerUpDate.
What is the best solution?
Cordially.
Posts: 5,314
Threads: 12
Joined: Aug 2010
Reputation:
0
Timer
OnPlayerUpdate is called around 30 times per second, per player.
Imagine this with 50 players online, and saving ...
Posts: 140
Threads: 46
Joined: Jun 2010
Reputation:
0
Thanks.
How many seconds?
Posts: 5,314
Threads: 12
Joined: Aug 2010
Reputation:
0
I used 30 minutes in my server, with the average of 200 players online.
At least in my case, server crash was very rare ...
Posts: 1,905
Threads: 63
Joined: Oct 2011
Reputation:
0
Usually a one to two second timer is just fine.
Posts: 318
Threads: 31
Joined: Mar 2012
Reputation:
0
I've experienced crashes on my server and there are only two ways wherein I save a player's data, I placed them under OnPlayerDisconnect and OnGameModeExit, it actually works fine so there's no need for me to save them on timers which requires usage of RAM causing lag on your server from what I know of, especially if they're called every second or two.
Note: I'm not sure of this, but it works just right in my case.
Posts: 140
Threads: 46
Joined: Jun 2010
Reputation:
0
Thanks all ! I use 2 seconds!
Posts: 90
Threads: 5
Joined: Feb 2012
Reputation:
0
If I were you i'd just make it save under OnPlayerDisconnect, and OnGameModeExit too.