8 Commits

Author SHA1 Message Date
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