IMO:
Saving linear data, or data that does not change often, every 10 seconds in overkill.
I generally only call a save when a client disconnects, and once every 10 minutes as a contingency plan.
But that's just the way I do things.
Disregarding most of your code;
I've noticed that you are creating a timer when the player is authed which will call the save function every 10 seconds. A major flaw in this is that the timer's name is static; If another client was to join it would overwrite the previous timer.
This could easily be fixed by appending the clients name to the end of the timer, but instead why not use a single timer, started when the server starts, that iterates through all clients and calls a save.
[lua]
function autosave ()
for k , v in pairs(player.GetAll()) do
v:SaveFunction()
end
end
timer.Create("autosaver", 600 , 0 , autosave)
[/lua]
Sorry, you need to Log In to post a reply to this thread.