Implementing RoundIDs (#7740)

This commit is contained in:
Selis
2024-02-14 03:07:35 +01:00
committed by GitHub
parent 64729dea85
commit e9effb63f5
8 changed files with 1317 additions and 1283 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -95,11 +95,12 @@ SUBSYSTEM_DEF(dbcore)
else
log_debug("Database is not enabled in configuration.")
/*/datum/controller/subsystem/dbcore/proc/SetRoundID()
/datum/controller/subsystem/dbcore/proc/InitializeRound()
if(!Connect())
return
var/DBQuery/query_round_initialize = SSdbcore.NewQuery(
"INSERT INTO [format_table_name("round")] (initialize_datetime, server_ip, server_port) VALUES (Now(), INET_ATON(:internet_address), :port)",
//"INSERT INTO [format_table_name("round")] (initialize_datetime, server_ip, server_port) VALUES (Now(), INET_ATON(:internet_address), :port)",
"INSERT INTO round (initialize_datetime, server_ip, server_port) VALUES (Now(), INET_ATON(:internet_address), :port)",
list("internet_address" = world.internet_address || "0", "port" = "[world.port]")
)
query_round_initialize.Execute(async = FALSE)
@@ -110,7 +111,8 @@ SUBSYSTEM_DEF(dbcore)
if(!Connect())
return
var/DBQuery/query_round_start = SSdbcore.NewQuery(
"UPDATE [format_table_name("round")] SET start_datetime = Now() WHERE id = :round_id",
//"UPDATE [format_table_name("round")] SET start_datetime = Now() WHERE id = :round_id",
"UPDATE round SET start_datetime = Now() WHERE id = :round_id",
list("round_id" = GLOB.round_id)
)
query_round_start.Execute()
@@ -120,11 +122,13 @@ SUBSYSTEM_DEF(dbcore)
if(!Connect())
return
var/DBQuery/query_round_end = SSdbcore.NewQuery(
"UPDATE [format_table_name("round")] SET end_datetime = Now(), game_mode_result = :game_mode_result, station_name = :station_name WHERE id = :round_id",
list("game_mode_result" = SSticker.mode_result, "station_name" = station_name(), "round_id" = GLOB.round_id)
//"UPDATE [format_table_name("round")] SET end_datetime = Now(), game_mode_result = :game_mode_result, station_name = :station_name WHERE id = :round_id",
"UPDATE round SET end_datetime = Now(), game_mode_result = :game_mode_result, station_name = :station_name WHERE id = :round_id",
//list("game_mode_result" = SSticker.mode_result, "station_name" = station_name(), "round_id" = GLOB.round_id)
list("game_mode_result" = "extended", "station_name" = station_name(), "round_id" = GLOB.round_id) // FIXME: temporary solution as we only use extended so far
)
query_round_end.Execute()
qdel(query_round_end)*/
qdel(query_round_end)
/datum/controller/subsystem/dbcore/proc/Disconnect()
failed_connections = 0
@@ -367,4 +371,4 @@ Delayed insert mode was removed in mysql 7 and only works with MyISAM type table
/DBQuery/proc/Close()
rows = null
item = null
item = null

View File

@@ -540,6 +540,8 @@ var/global/datum/controller/subsystem/ticker/ticker
for(var/i in total_antagonists)
log_game("[i]s[total_antagonists[i]].")
SSdbcore.SetRoundEnd() // CHOMPEdit
return 1
/datum/controller/subsystem/ticker/stat_entry()