szutilpack-cd2025/szutil_motdagree
Aaron Suen 068dd46ec1 Fix race between player purge and reregister
If a player quits before agreeing to the terms, and gets added to
the purge queue, but then reauths immediately, they can get
re-purged before they finish emerging, causing an assert fail on
trying to record their last login time.

If a player re-registers, immediately remove them from the purge
retry queue, so their login time can safely be recorded.

Also, if the server shuts down with incomplete players in the
"lobby", then add them all to the purge queue too.
2024-08-27 07:16:09 -04:00
..
2023-06-20 07:30:35 -04:00

This mod requires new players to accept terms of use in the MOTD via a chat command before they can play.

  • Remove interact (and possibly other privs) from default_privs.
  • Add any additional privs to szutil_motdagree_grant.

Players will be required to enter the specified chat comamnd (default is /agree to terms) to gain the sequestered privileges and start actual play. This self-grant via agreeing to the terms only works once, so admins can still revoke these privs manually later.

Customizing the chat command and required parameters allows this mod to test for reading comprehension (by burying the chat command instructions inside the MOTD), and ensure that players are not just ignoring the rules and agreeing just to dismiss the message, and thus players have no excuse for ignoring warnings.

Optionally, by setting szutil_motdagree_purge to true, users who log off without agreeing to the terms will be purged from the system and need to re-register each time until they agree to the terms.

The "lobby" is limited to only a few players at a time, and new players beyond this will be rejected, while players that have already agreed to the terms bypass this limit. There is both a soft and hard limit between which the probability of being rejected slides from 0% to 100%.

Moderators (who have the ban priv) can enable/disable new registrations using the /szutil_motdagree command. When registration is closed, players can enter the "lobby" but cannot agree to the terms until registration is opened again.