mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 17:52:36 +00:00
[MIRROR] Fixes role banned players not being banned from roles that they are banned from (Option Two) [MDB IGNORE] (#16100)
Fixes role banned players not being banned from roles that they are banned from (Option Two) (#69703) I feex Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
@@ -19,17 +19,28 @@ SUBSYSTEM_DEF(ban_cache)
|
||||
return
|
||||
var/current_time = REALTIMEOFDAY
|
||||
var/list/look_for = list()
|
||||
|
||||
var/list/query_args = list()
|
||||
var/list/query_arg_keys = list()
|
||||
|
||||
var/num_keys = 0
|
||||
for(var/ckey in GLOB.directory)
|
||||
var/client/lad = GLOB.directory[ckey]
|
||||
// If they've already got a ban cached, or a request goin, don't do it
|
||||
if(lad.ban_cache || lad.ban_cache_start)
|
||||
continue
|
||||
|
||||
look_for += ckey
|
||||
lad.ban_cache_start = current_time
|
||||
|
||||
query_args += list("key[num_keys]" = ckey)
|
||||
query_arg_keys += ":key[num_keys]"
|
||||
num_keys++
|
||||
|
||||
// We're gonna try and make a query for clients
|
||||
var/datum/db_query/query_batch_ban_cache = SSdbcore.NewQuery(
|
||||
"SELECT ckey, role, applies_to_admins FROM [format_table_name("ban")] WHERE ckey IN (:ckeys) AND unbanned_datetime IS NULL AND (expiration_time IS NULL OR expiration_time > NOW())",
|
||||
list("ckeys" = look_for.Join(","))
|
||||
"SELECT ckey, role, applies_to_admins FROM [format_table_name("ban")] WHERE ckey IN ([query_arg_keys.Join(",")]) AND unbanned_datetime IS NULL AND (expiration_time IS NULL OR expiration_time > NOW())",
|
||||
query_args
|
||||
)
|
||||
|
||||
var/succeeded = query_batch_ban_cache.Execute()
|
||||
|
||||
Reference in New Issue
Block a user