TG Sync 12/15/17

s

s
This commit is contained in:
kevinz000
2017-12-15 06:27:57 -08:00
parent b6b0ab69e3
commit 253c819bc1
762 changed files with 13429 additions and 14872 deletions
+21 -24
View File
@@ -8,11 +8,11 @@ SUBSYSTEM_DEF(blackbox)
var/list/feedback = list() //list of datum/feedback_variable
var/triggertime = 0
var/sealed = FALSE //time to stop tracking stats?
var/list/research_levels = list() //list of highest tech levels attained that isn't lost lost by destruction of RD computers
var/list/versions = list("time_dilation_current" = 2,
var/list/versions = list("antagonists" = 3,
"admin_secrets_fun_used" = 2,
"time_dilation_current" = 3,
"science_techweb_unlock" = 2) //associative list of any feedback variables that have had their format changed since creation and their current version, remember to update this
/datum/controller/subsystem/blackbox/Initialize()
triggertime = world.time
. = ..()
@@ -62,8 +62,6 @@ SUBSYSTEM_DEF(blackbox)
record_feedback("tally", "radio_usage", MS.pda_msgs.len, "PDA")
if (MS.rc_msgs.len)
record_feedback("tally", "radio_usage", MS.rc_msgs.len, "request console")
if(research_levels.len)
SSblackbox.record_feedback("associative", "high_research_level", 1, research_levels)
if (!SSdbcore.Connect())
return
@@ -90,39 +88,35 @@ SUBSYSTEM_DEF(blackbox)
sealed = TRUE
return TRUE
/datum/controller/subsystem/blackbox/proc/log_research(tech, level)
if(!(tech in research_levels) || research_levels[tech] < level)
research_levels[tech] = level
/datum/controller/subsystem/blackbox/proc/LogBroadcast(freq)
if(sealed)
return
switch(freq)
if(1459)
if(FREQ_COMMON)
record_feedback("tally", "radio_usage", 1, "common")
if(GLOB.SCI_FREQ)
if(FREQ_SCIENCE)
record_feedback("tally", "radio_usage", 1, "science")
if(GLOB.COMM_FREQ)
if(FREQ_COMMAND)
record_feedback("tally", "radio_usage", 1, "command")
if(GLOB.MED_FREQ)
if(FREQ_MEDICAL)
record_feedback("tally", "radio_usage", 1, "medical")
if(GLOB.ENG_FREQ)
if(FREQ_ENGINEERING)
record_feedback("tally", "radio_usage", 1, "engineering")
if(GLOB.SEC_FREQ)
if(FREQ_SECURITY)
record_feedback("tally", "radio_usage", 1, "security")
if(GLOB.SYND_FREQ)
if(FREQ_SYNDICATE)
record_feedback("tally", "radio_usage", 1, "syndicate")
if(GLOB.SERV_FREQ)
if(FREQ_SERVICE)
record_feedback("tally", "radio_usage", 1, "service")
if(GLOB.SUPP_FREQ)
if(FREQ_SUPPLY)
record_feedback("tally", "radio_usage", 1, "supply")
if(GLOB.CENTCOM_FREQ)
if(FREQ_CENTCOM)
record_feedback("tally", "radio_usage", 1, "centcom")
if(GLOB.AIPRIV_FREQ)
if(FREQ_AI_PRIVATE)
record_feedback("tally", "radio_usage", 1, "ai private")
if(GLOB.REDTEAM_FREQ)
if(FREQ_CTF_RED)
record_feedback("tally", "radio_usage", 1, "CTF red team")
if(GLOB.BLUETEAM_FREQ)
if(FREQ_CTF_BLUE)
record_feedback("tally", "radio_usage", 1, "CTF blue team")
else
record_feedback("tally", "radio_usage", 1, "other")
@@ -192,7 +186,7 @@ Versioning
"gun_fired" = 2)
*/
/datum/controller/subsystem/blackbox/proc/record_feedback(key_type, key, increment, data, overwrite)
if(sealed || !key_type || !istext(key) || !isnum(increment || !data))
if(sealed || !key_type || !istext(key) || !isnum(increment) || !data)
return
var/datum/feedback_variable/FV = find_feedback_datum(key, key_type)
switch(key_type)
@@ -225,7 +219,10 @@ Versioning
var/pos = length(FV.json["data"]) + 1
FV.json["data"]["[pos]"] = list() //in 512 "pos" can be replaced with "[FV.json["data"].len+1]"
for(var/i in data)
FV.json["data"]["[pos]"]["[i]"] = "[data[i]]" //and here with "[FV.json["data"].len]"
if(islist(data[i]))
FV.json["data"]["[pos]"]["[i]"] = data[i] //and here with "[FV.json["data"].len]"
else
FV.json["data"]["[pos]"]["[i]"] = "[data[i]]"
else
CRASH("Invalid feedback key_type: [key_type]")