Fixes slow roundstarts (#15326)

* More roundstart optimisations

* Mochi tweaks
This commit is contained in:
AffectedArc07
2021-01-22 14:25:28 +00:00
committed by GitHub
parent 12f43b5508
commit ea0fa2fc85
+12 -7
View File
@@ -73,13 +73,7 @@
spawn (ROUNDSTART_LOGOUT_REPORT_TIME)
display_roundstart_logout_report()
if(SSticker && SSticker.mode && SSdbcore.IsConnected())
var/datum/db_query/query_round_game_mode = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET game_mode=:gm WHERE id=:rid", list(
"gm" = SSticker.mode,
"rid" = GLOB.round_id
))
if(query_round_game_mode.warn_execute())
qdel(query_round_game_mode)
INVOKE_ASYNC(src, .proc/set_mode_in_db) // Async query, dont bother slowing roundstart
generate_station_goals()
GLOB.start_state = new /datum/station_state()
@@ -91,6 +85,17 @@
/datum/game_mode/process()
return 0
// I wonder what this could do guessing by the name
/datum/game_mode/proc/set_mode_in_db()
if(SSticker?.mode && SSdbcore.IsConnected())
var/datum/db_query/query_round_game_mode = SSdbcore.NewQuery("UPDATE [format_table_name("round")] SET game_mode=:gm WHERE id=:rid", list(
"gm" = SSticker.mode.name,
"rid" = GLOB.round_id
))
// We dont do anything with output. Dont bother wrapping with if()
query_round_game_mode.warn_execute()
qdel(query_round_game_mode)
//Called by the gameticker
/datum/game_mode/proc/process_job_tasks()
var/obj/machinery/message_server/useMS = null