diff --git a/baystation12.int b/baystation12.int index 72b22a9a205..b82874fded5 100644 --- a/baystation12.int +++ b/baystation12.int @@ -1,8 +1,6 @@ // BEGIN_INTERNALS /* -LAST_COMPILE_TIME: 1466775300 -AUTO_FILE_DIR: OFF MAP_ICON_TYPE: 0 -LAST_COMPILE_VERSION: 510.1347 +AUTO_FILE_DIR: OFF */ // END_INTERNALS diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 1910a7e8cfa..d652ef40233 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -156,6 +156,7 @@ var/list/gamemode_cache = list() var/admin_legacy_system = 0 //Defines whether the server uses the legacy admin system with admins.txt or the SQL system. Config option in config.txt var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database + var/sql_stats = 0 //Do we record round statistics on the database (deaths, round reports, population, etcetera) or not? var/sql_whitelists = 0 //Defined whether the server uses an SQL based whitelist system, or the legacy one with two .txts. Config option in config.txt var/sql_saves = 0 //Defines whether the server uses an SQL based character and preference saving system. Config option in config.txt @@ -718,6 +719,9 @@ var/list/gamemode_cache = list() if("allow_chat_markup") config.allow_chat_markup = 1 + if("sql_stats") + config.sql_stats = 1 + else log_misc("Unknown setting in configuration: '[name]'") diff --git a/code/defines/procs/statistics.dm b/code/defines/procs/statistics.dm index e807e4cbbce..3f9b6954a09 100644 --- a/code/defines/procs/statistics.dm +++ b/code/defines/procs/statistics.dm @@ -1,5 +1,5 @@ proc/sql_poll_population() - if(!config.sql_enabled) + if(!config.sql_enabled || !config.sql_stats) return var/admincount = admins.len var/playercount = 0 @@ -26,7 +26,7 @@ proc/sql_report_round_end() return proc/sql_report_death(var/mob/living/carbon/human/H) - if(!config.sql_enabled) + if(!config.sql_enabled || !config.sql_stats) return if(!H) return @@ -60,7 +60,7 @@ proc/sql_report_death(var/mob/living/carbon/human/H) proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) - if(!config.sql_enabled) + if(!config.sql_enabled || !config.sql_stats) return if(!H) return @@ -94,7 +94,7 @@ proc/sql_report_cyborg_death(var/mob/living/silicon/robot/H) proc/statistic_cycle() - if(!config.sql_enabled) + if(!config.sql_enabled || !config.sql_stats) return while(1) sql_poll_population() @@ -102,6 +102,9 @@ proc/statistic_cycle() //This proc is used for feedback. It is executed at round end. proc/sql_commit_feedback() + if(!config.sql_enabled || !config.sql_stats) + return + if(!blackbox) log_game("Round ended without a blackbox recorder. No feedback was sent to the database.") return diff --git a/code/modules/research/message_server.dm b/code/modules/research/message_server.dm index 9144cd11d98..859131529d1 100644 --- a/code/modules/research/message_server.dm +++ b/code/modules/research/message_server.dm @@ -294,7 +294,11 @@ var/obj/machinery/blackbox_recorder/blackbox //This proc is only to be called at round end. /obj/machinery/blackbox_recorder/proc/save_all_data_to_sql() - if(!feedback) return + if(!feedback) + return + + if (!config.sql_enabled || !config.sql_stats) + return round_end_data_gathering() //round_end time logging and some other data processing establish_db_connection(dbcon) @@ -377,4 +381,4 @@ proc/feedback_add_details(var/variable,var/details) if(!FV) return - FV.add_details(details) \ No newline at end of file + FV.add_details(details) diff --git a/config/example/config.txt b/config/example/config.txt index d10728b64f6..180d5a6763e 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -362,6 +362,9 @@ STARLIGHT 0 ## Uncomment to override default brain health. #DEFAULT_BRAIN_HEALTH 400 +## Uncomment this to upload round statistics to the SQL database. +# SQL_STATS + ## Uncomment this to house whitelists on the SQL database. # SQL_WHITELISTS