Im working atm on a plugin, that stores items in the json data file.
now i want to add like a timestamp in that class, so that the item gets automatic removed after a set time
i guess to make a simple timer for every item that get entered would probably slow the server down.?
maybe someone has a solution![]()
Timestamp - like Cooldown
Discussion in 'Rust Development' started by Crushed, Nov 12, 2016.
-
One timer and a dictionary/list
Or no timer and make the user force the check themselves, you need to be more specific for us to give you the best answer possible -
Not the timer will slow down your server, but handling the JSON file.
If the item list is big and you remove one item from it, the entire file has to be rewritten.
Data files aren't meant for frequent updates with big data sets, look into using an SQLite database instead. -
use sqlite!
check on server restarts what items have to be removed
and check when someone wants to get the items if it was outdated or not.
