mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Re-enables roundid creation again (#7754)
Co-authored-by: Raeschen <rycoop29@gmail.com>
This commit is contained in:
@@ -14,12 +14,17 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
|
// Run all strings to be used in an SQL query through this proc first to properly escape out injection attempts.
|
||||||
/proc/sanitizeSQL(var/t as text)
|
/proc/sanitizeSQL(var/t as text)
|
||||||
//var/sqltext = dbcon.Quote(t); //CHOMPEdit Begin
|
//var/sqltext = dbcon.Quote(t); //CHOMPEdit Begin
|
||||||
//return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that
|
//return copytext(sqltext, 2, length(sqltext));//Quote() adds quotes around input, we already do that
|
||||||
return t
|
return t
|
||||||
//CHOMPEdit End
|
//CHOMPEdit End
|
||||||
|
|
||||||
|
// CHOMPEdit - Adds format_table_name
|
||||||
|
/proc/format_table_name(table as text)
|
||||||
|
//return CONFIG_GET(string/feedback_tableprefix) + table
|
||||||
|
return table // We don't implement tableprefix
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Text sanitization
|
* Text sanitization
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -150,13 +150,14 @@ SUBSYSTEM_DEF(dbcore)
|
|||||||
UNTIL(query.process())
|
UNTIL(query.process())
|
||||||
queries_active -= query
|
queries_active -= query
|
||||||
|
|
||||||
/*var/datum/db_query/query_round_shutdown = SSdbcore.NewQuery(
|
var/datum/db_query/query_round_shutdown = SSdbcore.NewQuery(
|
||||||
"UPDATE [format_table_name("round")] SET shutdown_datetime = Now(), end_state = :end_state WHERE id = :round_id",
|
"UPDATE [format_table_name("round")] SET shutdown_datetime = Now(), end_state = :end_state WHERE id = :round_id",
|
||||||
list("end_state" = SSticker.end_state, "round_id" = GLOB.round_id),
|
//list("end_state" = SSticker.end_state, "round_id" = GLOB.round_id),
|
||||||
|
list("end_state" = "undefined", "round_id" = GLOB.round_id), // FIXME: end_state does not exist on ticker
|
||||||
TRUE
|
TRUE
|
||||||
)*/
|
)
|
||||||
//query_round_shutdown.Execute(FALSE)
|
query_round_shutdown.Execute(FALSE)
|
||||||
//qdel(query_round_shutdown)
|
qdel(query_round_shutdown)
|
||||||
|
|
||||||
log_debug("Done clearing DB queries standby:[length(queries_standby)] active: [length(queries_active)] all: [length(all_queries)]")
|
log_debug("Done clearing DB queries standby:[length(queries_standby)] active: [length(queries_active)] all: [length(all_queries)]")
|
||||||
if(IsConnected())
|
if(IsConnected())
|
||||||
@@ -247,20 +248,18 @@ SUBSYSTEM_DEF(dbcore)
|
|||||||
if(!Connect())
|
if(!Connect())
|
||||||
return
|
return
|
||||||
var/datum/db_query/query_round_initialize = SSdbcore.NewQuery(
|
var/datum/db_query/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]")
|
list("internet_address" = world.internet_address || "0", "port" = "[world.port]")
|
||||||
)
|
)
|
||||||
query_round_initialize.Execute(async = FALSE)
|
query_round_initialize.Execute(async = FALSE)
|
||||||
//GLOB.round_id = "[query_round_initialize.last_insert_id]"
|
GLOB.round_id = "[query_round_initialize.last_insert_id]"
|
||||||
qdel(query_round_initialize)
|
qdel(query_round_initialize)
|
||||||
|
|
||||||
/datum/controller/subsystem/dbcore/proc/SetRoundStart()
|
/datum/controller/subsystem/dbcore/proc/SetRoundStart()
|
||||||
if(!Connect())
|
if(!Connect())
|
||||||
return
|
return
|
||||||
var/datum/db_query/query_round_start = SSdbcore.NewQuery(
|
var/datum/db_query/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)
|
list("round_id" = GLOB.round_id)
|
||||||
)
|
)
|
||||||
query_round_start.Execute()
|
query_round_start.Execute()
|
||||||
@@ -270,8 +269,7 @@ SUBSYSTEM_DEF(dbcore)
|
|||||||
if(!Connect())
|
if(!Connect())
|
||||||
return
|
return
|
||||||
var/datum/db_query/query_round_end = SSdbcore.NewQuery(
|
var/datum/db_query/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",
|
"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" = 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
|
list("game_mode_result" = "extended", "station_name" = station_name(), "round_id" = GLOB.round_id) // FIXME: temporary solution as we only use extended so far
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user