Files
Bubberstation/code/controllers/subsystem/stickyban.dm
Cyberboss 31ee152489 Repaths subsystem to controller/subsystem (#24624)
* Repaths subsystem to controller/subsystem

* Fix the shit
2017-03-08 22:05:45 +01:00

38 lines
1.1 KiB
Plaintext

var/datum/controller/subsystem/stickyban/SSstickyban
/datum/controller/subsystem/stickyban
name = "Sticky Ban"
init_order = -10
flags = SS_NO_FIRE
var/list/cache = list()
/datum/controller/subsystem/stickyban/New()
NEW_SS_GLOBAL(SSstickyban)
/datum/controller/subsystem/stickyban/Initialize(timeofday)
var/list/bannedkeys = world.GetConfig("ban")
//sanitize the sticky ban list
for (var/bannedkey in bannedkeys)
var/ckey = ckey(bannedkey)
var/list/ban = stickyban2list(world.GetConfig("ban", bannedkey))
//byond stores sticky bans by key, that can end up confusing things
//i also remove it here so that if any stickybans cause a runtime, they just stop existing
world.SetConfig("ban", bannedkey, null)
if (!ban["ckey"])
ban["ckey"] = ckey
//storing these can break things and isn't needed for sticky ban tracking
ban -= "IP"
ban -= "computer_id"
ban["matches_this_round"] = list()
ban["existing_user_matches_this_round"] = list()
ban["admin_matches_this_round"] = list()
cache[ckey] = ban
for (var/bannedckey in cache)
world.SetConfig("ban", bannedckey, list2stickyban(cache[bannedckey]))