Ajneb97 / ServerVariables

MIT License
5 stars 5 forks source link

Data Saving sometimes innacurate #21

Closed KhrysAK47 closed 4 months ago

KhrysAK47 commented 4 months ago

Some time ago I started having players report some issues to me related to ServerVariables values. I use it for specific display of collections and other things, and it seems that if the server stops with a lot of players, or it lags, and they rejoin in the same instance, the values does not get added correctly. I currently have my data saving time set to 10. But the only logical situation I see happening, is that if the server restarts too quickly and it has no time to save the data.

I'm attaching the config file here without the variables:

https://pastebin.com/3aH1NGBF

Ajneb97 commented 4 months ago

Yes, that's exactly the problem. If you set that option to 10, it means the data will be saved every 10 minutes. If the server crashes in minute 9, then the data from the last 9 minutes will be lost. You could try to reduce this number to 1 minute. This task is done async so it shouldn't lag the server, and not long ago I made a fix to prevent lag when saving players.

KhrysAK47 commented 4 months ago

Alright, I understand. Do I need to restart the server for the changes to apply, or I can just /servervariables reload?

Ajneb97 commented 4 months ago

The reload command should be enough