mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Massquery (#9395)
This commit is contained in:
@@ -46,8 +46,8 @@
|
||||
|
||||
/datum/config_entry/number/max_concurrent_queries/ValidateAndSet(str_val)
|
||||
. = ..()
|
||||
//if (.) TODO: ENABLE THIS IN FUTURE DB PRs
|
||||
//SSdbcore.max_concurrent_queries = config_entry_value TODO: ENABLE THIS IN FUTURE DB PRs
|
||||
if (.)
|
||||
SSdbcore.max_concurrent_queries = config_entry_value
|
||||
|
||||
/// The exe for mariadbd.exe.
|
||||
/// Shouldn't really be set on production servers, primarily for EZDB.
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
/datum/config_entry/flag/limbs_can_break
|
||||
|
||||
/datum/config_entry/number/organ_health_multiplier
|
||||
default = 1
|
||||
integer = FALSE
|
||||
default = 1.0
|
||||
|
||||
/datum/config_entry/number/organ_regeneration_multiplier
|
||||
default = 1
|
||||
integer = FALSE
|
||||
default = 1.0
|
||||
|
||||
// FIXME: Unused
|
||||
///datum/config_entry/flag/revival_pod_plants
|
||||
|
||||
@@ -10,6 +10,7 @@ SUBSYSTEM_DEF(persist)
|
||||
flags = SS_BACKGROUND|SS_NO_INIT|SS_KEEP_TIMING
|
||||
runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME
|
||||
var/list/currentrun = list()
|
||||
var/list/query_stack = list() //CHOMPAdd TGSQL
|
||||
|
||||
/datum/controller/subsystem/persist/fire(var/resumed = FALSE)
|
||||
update_department_hours(resumed)
|
||||
@@ -29,6 +30,7 @@ SUBSYSTEM_DEF(persist)
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
var/list/query_stack = src.query_stack //CHOMPAdd TGSQL
|
||||
while (currentrun.len)
|
||||
var/mob/M = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
@@ -85,13 +87,20 @@ SUBSYSTEM_DEF(persist)
|
||||
var/sql_dpt = sql_sanitize_text(department_earning)
|
||||
var/sql_bal = text2num("[C.department_hours[department_earning]]")
|
||||
var/sql_total = text2num("[C.play_hours[department_earning]]")
|
||||
var/list/sqlargs = list("t_ckey" = sql_ckey, "t_department" = sql_dpt) //CHOMPEdit TGSQL
|
||||
var/datum/db_query/query = SSdbcore.NewQuery("INSERT INTO vr_player_hours (ckey, department, hours, total_hours) VALUES (:t_ckey, :t_department, [sql_bal], [sql_total]) ON DUPLICATE KEY UPDATE hours = VALUES(hours), total_hours = VALUES(total_hours)", sqlargs) //CHOMPEdit TGSQL
|
||||
if(!query.Execute()) //CHOMPEdit
|
||||
log_admin(query.ErrorMsg()) //CHOMPEdit
|
||||
qdel(query) //CHOMPEdit TGSQL
|
||||
var/list/entry = list(
|
||||
"ckey" = sql_ckey,
|
||||
"department" = sql_dpt,
|
||||
"hours" = sql_bal,
|
||||
"total_hours" = sql_total
|
||||
)
|
||||
query_stack += list(entry) //CHOMPEdit TGSQL
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
//CHOMPAdd Start TGSQL
|
||||
if(query_stack.len)
|
||||
SSdbcore.MassInsert(format_table_name("vr_player_hours"), query_stack, duplicate_key = "ON DUPLICATE KEY UPDATE hours = VALUES(hours), total_hours = VALUES(total_hours)")
|
||||
query_stack.Cut()
|
||||
//CHOMPAdd End TGSQL
|
||||
|
||||
// This proc tries to find the job datum of an arbitrary mob.
|
||||
/datum/controller/subsystem/persist/proc/detect_job(var/mob/M)
|
||||
|
||||
@@ -94,6 +94,7 @@ var/list/runechat_image_cache = list()
|
||||
* * lifespan - The lifespan of the message in deciseconds
|
||||
*/
|
||||
/datum/chatmessage/proc/generate_image(text, atom/target, mob/owner, list/extra_classes, lifespan)
|
||||
set waitfor = FALSE
|
||||
|
||||
if(!target || !owner)
|
||||
qdel(src)
|
||||
|
||||
Reference in New Issue
Block a user