f825b2e6cd
There are a number of mods in the pack that store metadata about players "inside out", in mod_storage instead of player:get_meta, because player meta is not accessible when the player is not online and that's necessary for some mods. Player meta is also tied to the "player character" and not to the auth account, so inside out storage is necessary when we want data to survive resetting the player character while keeping the account. Unfortunately, this prevents MT from automatically cleaning up the metadata when a player is destroyed, which can happen for various reasons outside the control of the mod. This can cause keys to accumulate in the mod storage database, which may hurt performance over time. To keep things tidy, periodically scan the mod storage keys for each such mod (add a scan cycle, or integrate with an existing one) and automatically clean up old mod storage keys. szutil_xplevel was already doing this on startup and command; convert it to do periodic scans like the other mods.
This mod automatically prunes old players who have not joined the world in a long enough time.
Old players may clutter up and bog down a world, especially if mods are in use that deal with offline players.
Players are protected from deletion if any of the following are true:
- They have last logged in within the required timeframe
- They are currently connected to the server
- They have the "noprune" priv
- They are singleplayer or the configured admin
The following settings control operation:
szutil_pruneplayers_interval
(default 3600) - Seconds between automatic prune scansszutil_pruneplayers_maxdays
(default 90) - Minimum number of days since last login for a player to be eligible to be prunedszutil_pruneplayers_keepauth
(default false) - If true, only delete the player data, but do not wipe the account registration/auth/privileges; if false, completely purge the account.
Pruning scans are done lackadaisically in the background to minimize disruption to normal server operations.