Blackbox no longer records data after round ends (#28390)

This commit is contained in:
Jordan Brown
2017-06-15 09:48:01 -04:00
committed by Leo
parent d8efde7585
commit be17cf33ef
3 changed files with 33 additions and 1 deletions

View File

@@ -41,7 +41,8 @@
// Subsystems shutdown in the reverse of the order they initialize in // Subsystems shutdown in the reverse of the order they initialize in
// The numbers just define the ordering, they are meaningless otherwise. // The numbers just define the ordering, they are meaningless otherwise.
#define INIT_ORDER_DBCORE 17 #define INIT_ORDER_DBCORE 18
#define INIT_ORDER_BLACKBOX 17
#define INIT_ORDER_SERVER_MAINT 16 #define INIT_ORDER_SERVER_MAINT 16
#define INIT_ORDER_JOBS 15 #define INIT_ORDER_JOBS 15
#define INIT_ORDER_EVENTS 14 #define INIT_ORDER_EVENTS 14

View File

@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(blackbox)
wait = 6000 wait = 6000
flags = SS_NO_TICK_CHECK | SS_NO_INIT flags = SS_NO_TICK_CHECK | SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
init_order = INIT_ORDER_BLACKBOX
var/list/msg_common = list() var/list/msg_common = list()
var/list/msg_science = list() var/list/msg_science = list()
@@ -18,6 +19,8 @@ SUBSYSTEM_DEF(blackbox)
var/list/feedback = list() //list of datum/feedback_variable var/list/feedback = list() //list of datum/feedback_variable
var/sealed = FALSE //time to stop tracking stats?
//poll population //poll population
/datum/controller/subsystem/blackbox/fire() /datum/controller/subsystem/blackbox/fire()
if(!SSdbcore.Connect()) if(!SSdbcore.Connect())
@@ -45,6 +48,8 @@ SUBSYSTEM_DEF(blackbox)
feedback = SSblackbox.feedback feedback = SSblackbox.feedback
sealed = SSblackbox.sealed
//no touchie //no touchie
/datum/controller/subsystem/blackbox/can_vv_get(var_name) /datum/controller/subsystem/blackbox/can_vv_get(var_name)
if(var_name == "feedback") if(var_name == "feedback")
@@ -55,6 +60,7 @@ SUBSYSTEM_DEF(blackbox)
return FALSE return FALSE
/datum/controller/subsystem/blackbox/Shutdown() /datum/controller/subsystem/blackbox/Shutdown()
sealed = FALSE
set_val("ahelp_unresolved", GLOB.ahelp_tickets.active_tickets.len) set_val("ahelp_unresolved", GLOB.ahelp_tickets.active_tickets.len)
var/pda_msg_amt = 0 var/pda_msg_amt = 0
@@ -97,6 +103,8 @@ SUBSYSTEM_DEF(blackbox)
/datum/controller/subsystem/blackbox/proc/LogBroadcast(blackbox_msg, freq) /datum/controller/subsystem/blackbox/proc/LogBroadcast(blackbox_msg, freq)
if(sealed)
return
switch(freq) switch(freq)
if(1459) if(1459)
msg_common += blackbox_msg msg_common += blackbox_msg
@@ -131,26 +139,38 @@ SUBSYSTEM_DEF(blackbox)
return FV return FV
/datum/controller/subsystem/blackbox/proc/set_val(variable, value) /datum/controller/subsystem/blackbox/proc/set_val(variable, value)
if(sealed)
return
var/datum/feedback_variable/FV = find_feedback_datum(variable) var/datum/feedback_variable/FV = find_feedback_datum(variable)
FV.set_value(value) FV.set_value(value)
/datum/controller/subsystem/blackbox/proc/inc(variable, value) /datum/controller/subsystem/blackbox/proc/inc(variable, value)
if(sealed)
return
var/datum/feedback_variable/FV = find_feedback_datum(variable) var/datum/feedback_variable/FV = find_feedback_datum(variable)
FV.inc(value) FV.inc(value)
/datum/controller/subsystem/blackbox/proc/dec(variable,value) /datum/controller/subsystem/blackbox/proc/dec(variable,value)
if(sealed)
return
var/datum/feedback_variable/FV = find_feedback_datum(variable) var/datum/feedback_variable/FV = find_feedback_datum(variable)
FV.dec(value) FV.dec(value)
/datum/controller/subsystem/blackbox/proc/set_details(variable,details) /datum/controller/subsystem/blackbox/proc/set_details(variable,details)
if(sealed)
return
var/datum/feedback_variable/FV = find_feedback_datum(variable) var/datum/feedback_variable/FV = find_feedback_datum(variable)
FV.set_details(details) FV.set_details(details)
/datum/controller/subsystem/blackbox/proc/add_details(variable,details) /datum/controller/subsystem/blackbox/proc/add_details(variable,details)
if(sealed)
return
var/datum/feedback_variable/FV = find_feedback_datum(variable) var/datum/feedback_variable/FV = find_feedback_datum(variable)
FV.add_details(details) FV.add_details(details)
/datum/controller/subsystem/blackbox/proc/ReportDeath(mob/living/L) /datum/controller/subsystem/blackbox/proc/ReportDeath(mob/living/L)
if(sealed)
return
if(!SSdbcore.Connect()) if(!SSdbcore.Connect())
return return
if(!L || !L.key || !L.mind) if(!L || !L.key || !L.mind)
@@ -182,6 +202,14 @@ SUBSYSTEM_DEF(blackbox)
var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina])") var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina])")
query_report_death.Execute() query_report_death.Execute()
/datum/controller/subsystem/blackbox/proc/Seal()
if(sealed)
return
if(IsAdminAdvancedProcCall())
var/msg = "[key_name_admin(usr)] sealed the blackbox!"
message_admins(msg)
log_game("Blackbox sealed[IsAdminAdvancedProcCall() ? " by [key_name(usr)]" : ""].")
sealed = TRUE
//feedback variable datum, for storing all kinds of data //feedback variable datum, for storing all kinds of data
/datum/feedback_variable /datum/feedback_variable

View File

@@ -592,6 +592,9 @@ SUBSYSTEM_DEF(ticker)
//Collects persistence features //Collects persistence features
SSpersistence.CollectData() SSpersistence.CollectData()
//stop collecting feedback during grifftime
SSblackbox.Seal()
sleep(50) sleep(50)
if(mode.station_was_nuked) if(mode.station_was_nuked)
Reboot("Station destroyed by Nuclear Device.", "nuke") Reboot("Station destroyed by Nuclear Device.", "nuke")