Caches the status topic to prevent low-effort DDoSes
This commit is contained in:
@@ -138,6 +138,9 @@
|
||||
keyword = "status"
|
||||
|
||||
/datum/world_topic/status/Run(list/input)
|
||||
if(GLOB.topic_status_lastcache <= world.time + 5)
|
||||
return GLOB.topic_status_cache
|
||||
GLOB.topic_status_lastcache = world.time
|
||||
. = list()
|
||||
.["version"] = GLOB.game_version
|
||||
.["mode"] = "hidden" //CIT CHANGE - hides the gamemode in topic() calls to prevent meta'ing the gamemode
|
||||
@@ -180,4 +183,5 @@
|
||||
// Shuttle status, see /__DEFINES/stat.dm
|
||||
.["shuttle_timer"] = SSshuttle.emergency.timeLeft()
|
||||
// Shuttle timer, in seconds
|
||||
|
||||
|
||||
GLOB.topic_status_cache = .
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
|
||||
GLOBAL_VAR(restart_counter)
|
||||
|
||||
GLOBAL_VAR(topic_status_lastcache)
|
||||
GLOBAL_LIST(topic_status_cache)
|
||||
|
||||
//This happens after the Master subsystem new(s) (it's a global datum)
|
||||
//So subsystems globals exist, but are not initialised
|
||||
/world/New()
|
||||
|
||||
Reference in New Issue
Block a user