[MIRROR] Block connections to the server from new ckeys if the panic bunker is up and not in interview mode [MDB IGNORE] (#20326)

* Block connections to the server from new ckeys if the panic bunker is up and not in interview mode (#74496)

The living hours check in client/New is still valid, this only cares
about never before seen players without regard for that config.

* Block connections to the server from new ckeys if the panic bunker is up and not in interview mode

---------

Co-authored-by: Kyle Spier-Swenson <kyleshome@gmail.com>
This commit is contained in:
SkyratBot
2023-04-04 16:23:32 -07:00
committed by GitHub
co-authored by Kyle Spier-Swenson
parent ebb46fe2c9
commit 2d533a159f
+17
View File
@@ -32,6 +32,23 @@
if(GLOB.admin_datums[ckey] || GLOB.deadmins[ckey])
admin = TRUE
if(!real_bans_only && !admin && CONFIG_GET(flag/panic_bunker) && !CONFIG_GET(flag/panic_bunker_interview))
var/datum/db_query/query_client_in_db = SSdbcore.NewQuery(
"SELECT 1 FROM [format_table_name("player")] WHERE ckey = :ckey",
list("ckey" = ckey)
)
if(!query_client_in_db.Execute())
qdel(query_client_in_db)
return
var/client_is_in_db = query_client_in_db.NextRow()
if(!client_is_in_db)
var/reject_message = "Failed Login: [key] [address]-[computer_id] - New Account attempting to connect during panic bunker, but was rejected due to no prior connections to game servers (no database entry)"
log_access(reject_message)
if (message)
message_admins(span_adminnotice("[reject_message]"))
return list("reason"="panicbunker", "desc" = "Sorry but the server is currently not accepting connections from never before seen players")
//Whitelist
if(!real_bans_only && !C && CONFIG_GET(flag/usewhitelist))