18 Commits

Author SHA1 Message Date
Aaron Suen
e050b0b536 Bump player last access upon successful auth
Even if the player fails to finish emerging, as long as they
managed to log in, keep their account alive.
2024-08-24 21:28:28 -04:00
Aaron Suen
f825b2e6cd Garbage collect removed players from mod_storage
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.
2024-08-24 12:18:52 -04:00
Aaron Suen
ef9fc2e0a1 Lagometer improvements
- Rearchitect so that we generate a list of lines as a separate
  process from displaying them, so that we can add new things
  beyond just the bucket graphs.
- Display cached lagometer to players as soon as they join instead
  of having to wait for the 2 second "cold start" before seeing
  anything.
- Add a status line to the bottom of the lagometer with live
  display of things that would be in /status.
- Add the status line things to the JSON dump too.
2024-08-24 11:19:47 -04:00
Aaron Suen
5c8040a2cc Add stub settingtypes.txt files
These are all based on automated detection (intercept the minetest
settings metatable methods) and lack any useful documentation, and
may be incomplete (e.g. missing keys that are only discovered at
runtime based on specific actions).

Eventually these will be filled out and used to document settings,
and make it easier to manage settings in the MT Settings UI.
2024-03-28 09:23:12 -04:00
Aaron Suen
9d1411b031 Lower log severity of player removal 2024-01-10 21:32:43 -05:00
Aaron Suen
0816db8df8 Fix incorrect auth removal
Just saw a player get deleted for inactivity twice, so it seems
like the deletion of the auth data is maybe not working right.
2023-12-15 20:15:52 -05:00
Aaron Suen
387d7c01c8 Simplify player purge logging
Just generate a single warning message on purging, don't do one
for player and auth separately, to cut down on the amount of
warning log noise that server warning monitoring scripts handle.
2023-12-15 07:35:16 -05:00
Aaron Suen
7c813dc4d2 Basic conversion of readmes to markdown format 2023-11-21 22:00:21 -05:00
Aaron Suen
d32a2c856c Build mod summary list automatically
Instead of maintaining the short description of each sub-mod
manually in a giant README file, distribute the short descriptions
into each relevant mod, and then build the README listings
automatically at deploy time.

This should:
- Make it harder to forget to add/remove mods in the list
- Prevent them from being out of alphabetical order
- Ensure each mod has a description for in-menu use
2023-06-20 07:30:35 -04:00
Aaron Suen
2be093014f Fix line wrapping 2023-06-20 06:27:36 -04:00
Aaron Suen
1a88d282b7 Support all games 2023-06-20 06:21:15 -04:00
Aaron Suen
7175f51921 Maintain our own last-seen timestamp for players
We actually want to prune accounts based on the
last time they were used or seen online at all, not
just the last time they successfully joined the
world.  Keeping track of our own timestamp should
catch scenarios like players sucessfully authing
but failing to complete joining the world, or players
who log in and then play for a long time after
login.  This also makes it safer to use with much
shorter timeout periods and longer-running
servers.
2022-11-05 13:52:15 -04:00
Aaron Suen
1a2d41b0b3 Handle authed but not joined players
Further tighten the race condition gap between
players authing and finishing joining.  The
meaning of last_login is apparently officially the
last join time, but if the last successful auth time
was later, use that as the known account age.
2022-11-05 13:36:27 -04:00
Aaron Suen
8d607b360c Don't defer account pruning deletion
It's possible for a player to log in right as the
check scan is happening, causing the decision to
delete the account happening, then the player
successfully authing, then the account being
actually deleted from the queue, and then the
player completing emerge and running joinplayer
callbacks.  One of the joinplayer callbacks tries to
update the last_login, which fails if the account
was deleted while the player was emerging.
Rather than redo the checks, just perform all the
deletion stuff inline.
2022-11-05 13:31:10 -04:00
Aaron Suen
802c0bfda1 Add more checks player deletion races 2022-11-05 13:22:42 -04:00
Aaron Suen
e47ae06561 Don't crash on missing player in pruneplayers
pruneplayers can race with other mods (e.g.
motdagree) to delete a player.  If the player was
already deleted when the check runs, don't crash,
just skip the player this pass.
2022-11-05 13:19:48 -04:00
Aaron Suen
660a1880c6 Fix missing mod.conf 2022-10-30 13:42:11 -04:00
Aaron Suen
7c776fcff9 New mod to automatically prune old players 2022-10-30 13:36:08 -04:00