From 00df6c634a11328e08f63d5c24bd700c01077327 Mon Sep 17 00:00:00 2001 From: Erki Date: Sun, 5 Jan 2020 01:46:39 +0200 Subject: [PATCH] Ports a fix from TG (#7918) --- code/modules/admin/IsBanned.dm | 8 +++++++- code/world.dm | 5 ----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm index 9128d081e21..4f72eb21609 100644 --- a/code/modules/admin/IsBanned.dm +++ b/code/modules/admin/IsBanned.dm @@ -4,11 +4,18 @@ //Blocks an attempt to connect before even creating our client datum thing. world/IsBanned(key, address, computer_id, type, real_bans_only = FALSE) + if (type == "world") + return ..() + if(ckey(key) in admin_datums) return ..() var/ckey = ckey(key) var/admin = (ckey in admin_datums) + var/client/C = directory[ckey] + + if (C && ckey == C.ckey && computer_id == C.computer_id && address == C.address) + return // Player is already connected, do not recheck. //IsBanned can get re-called on a user in certain situations, this prevents that leading to repeated messages to admins. var/static/list/checkedckeys = list() @@ -94,7 +101,6 @@ world/IsBanned(key, address, computer_id, type, real_bans_only = FALSE) if (ban) // stickyban management stuff. . = ban - var/client/C = directory[ckey] if (real_bans_only) return diff --git a/code/world.dm b/code/world.dm index 3d1dc6af651..e7394ddc94b 100644 --- a/code/world.dm +++ b/code/world.dm @@ -133,11 +133,6 @@ var/list/world_api_rate_limit = list() var/query = queryparams["query"] var/auth = queryparams["auth"] - /*if (!SSticker) //If the game is not started most API Requests would not work because of the throtteling - response["statuscode"] = 500 - response["response"] = "Game not started yet!" - return json_encode(response)*/ - if (isnull(query)) log_debug("API - Bad Request - No query specified") response["statuscode"] = 400