Skip to content

Better bans

toaster requested to merge better-bans into next

The core of this, the first 5 commits, are Sal's work on the Ring Racers repository cherry-picked and merge-conflict-resolved for hopeful 1.4 inclusion.

  • MAXBANS is dead, making permanent, non-cycling bans a viable mechanism to control server access. 🦀
  • Associated usernames are now stored, for logging purposes.
    • If not known, reported as "Direct IP ban".
  • Admin-initiated kicks are now tempbans.
    • Controlled by the kicktime cvar.
    • Default length of 10 minutes, open to input from server hosts for a different default.
    • The remaining duration is reported to a joiner whose kick is still too recent.
    • Stored in ban.txt as a simple UNIX timestamp, so looooooooong-term tempbans are possible.
  • Attempting to join a server you're banned from will now tell you the admin-given reason, rather than a generic one.
  • Allow setting a CIDR ban mask with the banip command.
  • ban.txt sanity improvements.
    • A better format, with (simple) versioning support, CIDR compliance, and quote deliniation.
    • One-way autoconversion of 1.3-and-earlier banlists.
    • Keep track of if we tried to load it. If it wasn't, then don't save over it with a blank file.
    • Solve some issues you could cause by manually editing the file.
      • You can no longer smuggle impossibly long ban reasons into the game.
      • You can no longer accidentially ban the entire internet by setting a CIDR ban mask of 0.

Also:

  • Disallow quotes in player names - it makes player name detection in console more annoying, and saving username in files scary.
  • Fix an issue where if the last line of an M_StartMessage was the longest, the box width wouldn't account for it. (Ban reasons end up on the last line, so it was VERY obvious what was going wrong here.)

Breaks net APIs implemented by targets other than i_tcp.c; not a priority for us, SRB2Kart on DOS would struggle anyways if it wasn't already busted. If someone else really wants to fix it they can.

Merge request reports