Save player account | OnPlayerUpDate or Timer ?
#1

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.
Reply
#2

Timer

OnPlayerUpdate is called around 30 times per second, per player.

Imagine this with 50 players online, and saving ...
Reply
#3

Thanks.

How many seconds?
Reply
#4

I used 30 minutes in my server, with the average of 200 players online.

At least in my case, server crash was very rare ...
Reply
#5

Usually a one to two second timer is just fine.
Reply
#6

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.
Reply
#7

Thanks all ! I use 2 seconds!
Reply
#8

If I were you i'd just make it save under OnPlayerDisconnect, and OnGameModeExit too.
Reply
#9

If the server is gmx'd in the console while player's are one, their data will be lost. You have to call
pawn Код:
SendRconCommand("gmx");
via the script for OnGameModeExit option to work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)