[HELP] nVault problem
I decided to go to MySQL because nVault is very problematic on my server..
Sometimes when the server crashes everyone on the server loses his variables stored in the vault, but another plugin which also uses nVault does not loses it's variables? PHP Code:
|
Re: [HELP] nVault problem
This is because when a server does not close gracefully, client_disconnect() is not called on all clients and this is most likely where SaveData() is called from on each player.
To avoid this issue, you will need to save data as it changes for each player. It is not as efficient, but you wouldn't lose any data. My recommendation is to track down your crash issue and resolve it and not use a band-aid on all of your plugins. |
Re: [HELP] nVault problem
Here is the another part of save code i forgot :
PHP Code:
Here are the Load/Save: PHP Code:
PHP Code:
---------------------- Quote:
How I can make nVault save when the data changes? |
Re: [HELP] nVault problem
It doesn't mean that the crashes are caused by that plugin or the code above has errors in it. Save the data more often by adding SaveData(id) whenever the player's data is updated. This will save the data right away and it won't really matter whether client_disconnect(id) is called, i.e. the server shuts down properly.
|
Re: [HELP] nVault problem
So may I set a task with SaveData(id) ?
Will it work good? |
Re: [HELP] nVault problem
Yes, you can. A better idea in some aspects is setting a repeating task that will save the data for all players every 5 minutes (for example).
|
Re: [HELP] nVault problem
Quote:
|
Re: [HELP] nVault problem
Not really. Yes, it's totally unfefficient, because the best way is to save them on client_disconnect(id). But, still, unefficient doesn't mean that it wouldn't work.
|
Re: [HELP] nVault problem
ok, client_disconnect is not called. But maybe other forwards are called , for example plugin_end?
To use get_players then save_data() on plugin_end? |
Re: [HELP] nVault problem
You can save data when player get +exp(on deathmsg event or idk) for example and no data will be lost
|
| All times are GMT -4. The time now is 18:42. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.