From 2a23a1d6051a6a7be572e70b5c4f32bd29268c28 Mon Sep 17 00:00:00 2001 From: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Date: Sun, 6 Mar 2022 11:49:13 -0800 Subject: [PATCH] BRING BACK STICKY BANS WRONG REPO WRONG REPO WRONG REPO WRONG REPO --- code/modules/admin/IsBanned.dm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index c045789ef1a..bcc396cea84 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -94,7 +94,24 @@ [expires]"} log_suspicious_login("Failed Login: [key] [computer_id] [address] - Banned (#[i["id"]])") return list("reason"="Banned","desc"="[desc]") + if (admin) + if (GLOB.directory[ckey]) + return + //oh boy, so basically, because of a bug in byond, sometimes stickyban matches don't trigger here, so we can't exempt admins. + // Whitelisting the ckey with the byond whitelist field doesn't work. + // So we instead have to remove every stickyban than later re-add them. + if (!length(GLOB.stickybanadminexemptions)) + for (var/banned_ckey in world.GetConfig("ban")) + GLOB.stickybanadmintexts[banned_ckey] = world.GetConfig("ban", banned_ckey) + world.SetConfig("ban", banned_ckey, null) + if (!SSstickyban.initialized) + return + GLOB.stickybanadminexemptions[ckey] = world.time + stoplag() // sleep a byond tick + GLOB.stickbanadminexemptiontimerid = addtimer(CALLBACK(GLOBAL_PROC, /proc/restore_stickybans), 5 SECONDS, TIMER_STOPPABLE|TIMER_UNIQUE|TIMER_OVERRIDE) + return + var/list/ban = ..() //default pager ban stuff if (ban)