mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-26 10:12:17 +00:00
Merge remote-tracking branch 'ParadiseSS13/master' into multi-instance-support
This commit is contained in:
@@ -34,7 +34,9 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
|
||||
var/datum/configuration_section/logging_configuration/logging
|
||||
/// Holder for the MC configuration datum
|
||||
var/datum/configuration_section/mc_configuration/mc
|
||||
/// Holder for the MC configuration datum
|
||||
/// Holder for the metrics configuration datum
|
||||
var/datum/configuration_section/metrics_configuration/metrics
|
||||
/// Holder for the movement configuration datum
|
||||
var/datum/configuration_section/movement_configuration/movement
|
||||
/// Holder for the overflow configuration datum
|
||||
var/datum/configuration_section/overflow_configuration/overflow
|
||||
@@ -86,6 +88,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
|
||||
jobs = new()
|
||||
logging = new()
|
||||
mc = new()
|
||||
metrics = new()
|
||||
movement = new()
|
||||
overflow = new()
|
||||
ruins = new()
|
||||
@@ -124,6 +127,7 @@ GLOBAL_DATUM_INIT(configuration, /datum/server_configuration, new())
|
||||
safe_load(jobs, "job_configuration")
|
||||
safe_load(logging, "logging_configuration")
|
||||
safe_load(mc, "mc_configuration")
|
||||
safe_load(metrics, "metrics_configuration")
|
||||
safe_load(movement, "movement_configuration")
|
||||
safe_load(overflow, "overflow_configuration")
|
||||
safe_load(ruins, "ruin_configuration")
|
||||
|
||||
@@ -14,8 +14,6 @@
|
||||
var/lobby_time = 240
|
||||
/// Ban all Guest BYOND accounts
|
||||
var/guest_ban = TRUE
|
||||
/// Player threshold to automatically enable panic bunker
|
||||
var/panic_bunker_threshold = 150
|
||||
/// Allow players to use AntagHUD?
|
||||
var/allow_antag_hud = TRUE
|
||||
/// Forbid players from rejoining if they use AntagHUD?
|
||||
@@ -121,7 +119,6 @@
|
||||
|
||||
// Numbers
|
||||
CONFIG_LOAD_NUM(lobby_time, data["lobby_time"])
|
||||
CONFIG_LOAD_NUM(panic_bunker_threshold, data["panic_bunker_threshold"])
|
||||
CONFIG_LOAD_NUM(base_loadout_points, data["base_loadout_points"])
|
||||
CONFIG_LOAD_NUM(cryo_penalty_period, data["cryo_penalty_period"])
|
||||
CONFIG_LOAD_NUM(minimum_client_build, data["minimum_client_build"])
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/// Config holder for stuff relating to metrics management
|
||||
/datum/configuration_section/metrics_configuration
|
||||
// NO EDITS OR READS TO THIS EVER
|
||||
protection_state = PROTECTION_PRIVATE
|
||||
/// Are metrics enabled or disabled
|
||||
var/enable_metrics = FALSE
|
||||
/// Endpoint to send metrics to, including protocol
|
||||
var/metrics_endpoint = null
|
||||
/// Endpoint authorisation API key
|
||||
var/metrics_api_token = null
|
||||
|
||||
/datum/configuration_section/metrics_configuration/load_data(list/data)
|
||||
// Use the load wrappers here. That way the default isnt made 'null' if you comment out the config line
|
||||
CONFIG_LOAD_BOOL(enable_metrics, data["enable_metrics"])
|
||||
|
||||
CONFIG_LOAD_STR(metrics_endpoint, data["metrics_endpoint"])
|
||||
CONFIG_LOAD_STR(metrics_api_token, data["metrics_api_token"])
|
||||
@@ -2,6 +2,8 @@
|
||||
/datum/controller/subsystem
|
||||
// Metadata; you should define these.
|
||||
name = "fire codertrain" //name of the subsystem
|
||||
/// Subsystem ID. Used for when we need a technical name for the SS
|
||||
var/ss_id = "fire_codertrain_again"
|
||||
var/init_order = INIT_ORDER_DEFAULT //order of initialization. Higher numbers are initialized first, lower numbers later. Use defines in __DEFINES/subsystems.dm for easy understanding of order.
|
||||
var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer.
|
||||
var/priority = FIRE_PRIORITY_DEFAULT //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep
|
||||
@@ -227,3 +229,17 @@
|
||||
if("queued_priority") //editing this breaks things.
|
||||
return 0
|
||||
. = ..()
|
||||
|
||||
/**
|
||||
* Returns the metrics for the subsystem.
|
||||
*
|
||||
* This can be overriden on subtypes for variables that could affect tick usage
|
||||
* Example: ATs on SSair
|
||||
*/
|
||||
/datum/controller/subsystem/proc/get_metrics()
|
||||
SHOULD_CALL_PARENT(TRUE)
|
||||
var/list/out = list()
|
||||
out["cost"] = cost
|
||||
out["tick_usage"] = tick_usage
|
||||
out["custom"] = list() // Override as needed on child
|
||||
return out
|
||||
|
||||
@@ -11,6 +11,11 @@ SUBSYSTEM_DEF(acid)
|
||||
/datum/controller/subsystem/acid/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/acid/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/acid/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
|
||||
@@ -66,6 +66,12 @@ SUBSYSTEM_DEF(air)
|
||||
msg += "AT/MS:[round((cost ? active_turfs.len/cost : 0),0.1)]"
|
||||
..(msg)
|
||||
|
||||
/datum/controller/subsystem/air/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["active_turfs"] = length(active_turfs)
|
||||
cust["hotspots"] = length(hotspots)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/air/Initialize(timeofday)
|
||||
setup_overlays() // Assign icons and such for gas-turf-overlays
|
||||
|
||||
@@ -54,9 +54,8 @@ SUBSYSTEM_DEF(changelog)
|
||||
/datum/controller/subsystem/changelog/proc/UpdatePlayerChangelogDate(client/C)
|
||||
if(!ss_ready)
|
||||
return // Only return here, we dont have to worry about a queue list because this will be called from ShowChangelog()
|
||||
// Technically this is only for the date but we can also do the UI button at the same time
|
||||
var/datum/preferences/P = GLOB.preferences_datums[C.ckey]
|
||||
if(P.toggles & PREFTOGGLE_UI_DARKMODE)
|
||||
|
||||
if(C.prefs.toggles & PREFTOGGLE_UI_DARKMODE)
|
||||
winset(C, "rpane.changelog", "background-color=#40628a;font-color=#ffffff;font-style=none")
|
||||
else
|
||||
winset(C, "rpane.changelog", "background-color=none;font-style=none")
|
||||
|
||||
@@ -12,6 +12,12 @@ SUBSYSTEM_DEF(fires)
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
/datum/controller/subsystem/fires/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/fires/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
@@ -30,7 +36,7 @@ SUBSYSTEM_DEF(fires)
|
||||
|
||||
if(O.resistance_flags & ON_FIRE) //in case an object is extinguished while still in currentrun
|
||||
if(!(O.resistance_flags & FIRE_PROOF))
|
||||
O.take_damage(20, BURN, "fire", 0)
|
||||
O.take_damage(20, BURN, FIRE, 0)
|
||||
else
|
||||
O.extinguish()
|
||||
|
||||
|
||||
@@ -61,6 +61,22 @@ SUBSYSTEM_DEF(garbage)
|
||||
msg += " | Fail:[fail_counts.Join(",")]"
|
||||
..(msg)
|
||||
|
||||
/datum/controller/subsystem/garbage/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
if((delslasttick + gcedlasttick) == 0) // Account for DIV0
|
||||
cust["gcr"] = 0
|
||||
else
|
||||
cust["gcr"] = (gcedlasttick / (delslasttick + gcedlasttick))
|
||||
cust["total_harddels"] = totaldels
|
||||
cust["total_softdels"] = totalgcs
|
||||
var/i = 0
|
||||
for(var/list/L in queues)
|
||||
i++
|
||||
cust["queue_[i]"] = length(L)
|
||||
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/garbage/Shutdown()
|
||||
//Adds the del() log to the qdel log file
|
||||
var/list/dellog = list()
|
||||
|
||||
@@ -65,7 +65,7 @@ SUBSYSTEM_DEF(jobs)
|
||||
return type_occupations[jobtype]
|
||||
|
||||
/datum/controller/subsystem/jobs/proc/GetPlayerAltTitle(mob/new_player/player, rank)
|
||||
return player.client.prefs.GetPlayerAltTitle(GetJob(rank))
|
||||
return player.client.prefs.active_character.GetPlayerAltTitle(GetJob(rank))
|
||||
|
||||
/datum/controller/subsystem/jobs/proc/AssignRole(mob/new_player/player, rank, latejoin = 0)
|
||||
Debug("Running AR, Player: [player], Rank: [rank], LJ: [latejoin]")
|
||||
@@ -121,7 +121,7 @@ SUBSYSTEM_DEF(jobs)
|
||||
Debug("Running FOC, Job: [job], Level: [level], Flag: [flag]")
|
||||
var/list/candidates = list()
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
Debug(" - Player: [player] Banned: [jobban_isbanned(player, job.title)] Old Enough: [!job.player_old_enough(player.client)] AvInPlaytime: [job.available_in_playtime(player.client)] Flag && Be Special: [flag] && [player.client.prefs.be_special] Job Department: [player.client.prefs.GetJobDepartment(job, level)] Job Flag: [job.flag] Job Department Flag = [job.department_flag]")
|
||||
Debug(" - Player: [player] Banned: [jobban_isbanned(player, job.title)] Old Enough: [!job.player_old_enough(player.client)] AvInPlaytime: [job.available_in_playtime(player.client)] Flag && Be Special: [flag] && [player.client.prefs.be_special] Job Department: [player.client.prefs.active_character.GetJobDepartment(job, level)] Job Flag: [job.flag] Job Department Flag = [job.department_flag]")
|
||||
if(jobban_isbanned(player, job.title))
|
||||
Debug("FOC isbanned failed, Player: [player]")
|
||||
continue
|
||||
@@ -140,7 +140,7 @@ SUBSYSTEM_DEF(jobs)
|
||||
if(player.mind && (job.title in player.mind.restricted_roles))
|
||||
Debug("FOC incompatbile with antagonist role, Player: [player]")
|
||||
continue
|
||||
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
|
||||
if(player.client.prefs.active_character.GetJobDepartment(job, level) & job.flag)
|
||||
Debug("FOC pass, Player: [player], Level:[level]")
|
||||
candidates += player
|
||||
return candidates
|
||||
@@ -367,12 +367,12 @@ SUBSYSTEM_DEF(jobs)
|
||||
continue
|
||||
|
||||
// If the player wants that job on this level, then try give it to him.
|
||||
if(player.client.prefs.GetJobDepartment(job, level) & job.flag)
|
||||
if(player.client.prefs.active_character.GetJobDepartment(job, level) & job.flag)
|
||||
|
||||
// If the job isn't filled
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("DO pass, Player: [player], Level:[level], Job:[job.title]")
|
||||
Debug(" - Job Flag: [job.flag] Job Department: [player.client.prefs.GetJobDepartment(job, level)] Job Current Pos: [job.current_positions] Job Spawn Positions = [job.spawn_positions]")
|
||||
Debug(" - Job Flag: [job.flag] Job Department: [player.client.prefs.active_character.GetJobDepartment(job, level)] Job Current Pos: [job.current_positions] Job Spawn Positions = [job.spawn_positions]")
|
||||
AssignRole(player, job.title)
|
||||
unassigned -= player
|
||||
break
|
||||
@@ -380,7 +380,7 @@ SUBSYSTEM_DEF(jobs)
|
||||
// Hand out random jobs to the people who didn't get any in the last check
|
||||
// Also makes sure that they got their preference correct
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
if(player.client.prefs.alternate_option == GET_RANDOM_JOB)
|
||||
if(player.client.prefs.active_character.alternate_option == GET_RANDOM_JOB)
|
||||
GiveRandomJob(player)
|
||||
|
||||
Debug("DO, Standard Check end")
|
||||
@@ -390,7 +390,7 @@ SUBSYSTEM_DEF(jobs)
|
||||
// Antags, who have to get in, come first
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
if(player.mind.special_role)
|
||||
if(player.client.prefs.alternate_option != BE_ASSISTANT)
|
||||
if(player.client.prefs.active_character.alternate_option != BE_ASSISTANT)
|
||||
GiveRandomJob(player)
|
||||
if(player in unassigned)
|
||||
AssignRole(player, "Civilian")
|
||||
@@ -399,10 +399,10 @@ SUBSYSTEM_DEF(jobs)
|
||||
|
||||
// Then we assign what we can to everyone else.
|
||||
for(var/mob/new_player/player in unassigned)
|
||||
if(player.client.prefs.alternate_option == BE_ASSISTANT)
|
||||
if(player.client.prefs.active_character.alternate_option == BE_ASSISTANT)
|
||||
Debug("AC2 Assistant located, Player: [player]")
|
||||
AssignRole(player, "Civilian")
|
||||
else if(player.client.prefs.alternate_option == RETURN_TO_LOBBY)
|
||||
else if(player.client.prefs.active_character.alternate_option == RETURN_TO_LOBBY)
|
||||
player.ready = 0
|
||||
unassigned -= player
|
||||
|
||||
@@ -564,11 +564,11 @@ SUBSYSTEM_DEF(jobs)
|
||||
if(job.barred_by_disability(player.client))
|
||||
disabled++
|
||||
continue
|
||||
if(player.client.prefs.GetJobDepartment(job, 1) & job.flag)
|
||||
if(player.client.prefs.active_character.GetJobDepartment(job, 1) & job.flag)
|
||||
high++
|
||||
else if(player.client.prefs.GetJobDepartment(job, 2) & job.flag)
|
||||
else if(player.client.prefs.active_character.GetJobDepartment(job, 2) & job.flag)
|
||||
medium++
|
||||
else if(player.client.prefs.GetJobDepartment(job, 3) & job.flag)
|
||||
else if(player.client.prefs.active_character.GetJobDepartment(job, 3) & job.flag)
|
||||
low++
|
||||
else never++ //not selected
|
||||
|
||||
|
||||
@@ -11,6 +11,14 @@ SUBSYSTEM_DEF(lighting)
|
||||
/datum/controller/subsystem/lighting/stat_entry()
|
||||
..("L:[length(sources_queue)]|C:[length(corners_queue)]|O:[length(objects_queue)]")
|
||||
|
||||
/datum/controller/subsystem/lighting/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["sources_queue"] = length(sources_queue)
|
||||
cust["corners_queue"] = length(corners_queue)
|
||||
cust["objects_queue"] = length(objects_queue)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/lighting/Initialize(timeofday)
|
||||
if(!initialized)
|
||||
if(GLOB.configuration.general.starlight)
|
||||
|
||||
@@ -20,6 +20,12 @@ SUBSYSTEM_DEF(machines)
|
||||
fire()
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/machines/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/machines/proc/makepowernets()
|
||||
for(var/datum/powernet/PN in powernets)
|
||||
qdel(PN)
|
||||
|
||||
@@ -10,6 +10,8 @@ SUBSYSTEM_DEF(mapping)
|
||||
var/list/teleportlocs
|
||||
/// List of all areas that can be accessed via IC and OOC means
|
||||
var/list/ghostteleportlocs
|
||||
///List of areas that exist on the station this shift
|
||||
var/list/existing_station_areas
|
||||
|
||||
// This has to be here because world/New() uses [station_name()], which looks this datum up
|
||||
/datum/controller/subsystem/mapping/PreInit()
|
||||
@@ -62,7 +64,7 @@ SUBSYSTEM_DEF(mapping)
|
||||
log_startup_progress("Populating lavaland...")
|
||||
var/lavaland_setup_timer = start_watch()
|
||||
seedRuins(list(level_name_to_num(MINING)), GLOB.configuration.ruins.lavaland_ruin_budget, /area/lavaland/surface/outdoors/unexplored, GLOB.lava_ruins_templates)
|
||||
spawn_rivers(list(level_name_to_num(MINING)))
|
||||
spawn_rivers(level_name_to_num(MINING))
|
||||
log_startup_progress("Successfully populated lavaland in [stop_watch(lavaland_setup_timer)]s.")
|
||||
|
||||
// Now we make a list of areas for teleport locs
|
||||
@@ -89,6 +91,13 @@ SUBSYSTEM_DEF(mapping)
|
||||
|
||||
ghostteleportlocs = sortAssoc(ghostteleportlocs)
|
||||
|
||||
// Now we make a list of areas that exist on the station. Good for if you don't want to select areas that exist for one station but not others. Directly references
|
||||
existing_station_areas = list()
|
||||
for(var/area/AR in world)
|
||||
var/turf/picked = safepick(get_area_turfs(AR.type))
|
||||
if(picked && is_station_level(picked.z))
|
||||
existing_station_areas += AR
|
||||
|
||||
// World name
|
||||
if(GLOB.configuration.general.server_name)
|
||||
world.name = "[GLOB.configuration.general.server_name]: [station_name()]"
|
||||
|
||||
47
code/controllers/subsystem/metrics.dm
Normal file
47
code/controllers/subsystem/metrics.dm
Normal file
@@ -0,0 +1,47 @@
|
||||
SUBSYSTEM_DEF(metrics)
|
||||
name = "Metrics"
|
||||
wait = 30 SECONDS
|
||||
offline_implications = "Server metrics will no longer be ingested into monitoring systems. No immediate action is needed."
|
||||
runlevels = RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME // ALL THE LEVELS
|
||||
flags = SS_KEEP_TIMING // This needs to ingest every 30 IRL seconds, not ingame seconds.
|
||||
/// The real time of day the server started. Used to calculate time drift
|
||||
var/world_init_time = 0 // Not set in here. Set in world/New()
|
||||
|
||||
/datum/controller/subsystem/metrics/Initialize(start_timeofday)
|
||||
if(!GLOB.configuration.metrics.enable_metrics)
|
||||
flags |= SS_NO_FIRE // Disable firing to save CPU
|
||||
return ..()
|
||||
|
||||
|
||||
/datum/controller/subsystem/metrics/fire(resumed)
|
||||
SShttp.create_async_request(RUSTG_HTTP_METHOD_POST, GLOB.configuration.metrics.metrics_endpoint, get_metrics_json(), list(
|
||||
"Authorization" = "ApiKey [GLOB.configuration.metrics.metrics_api_token]",
|
||||
"Content-Type" = "application/json"
|
||||
))
|
||||
|
||||
/datum/controller/subsystem/metrics/proc/get_metrics_json()
|
||||
var/list/out = list()
|
||||
out["@timestamp"] = time_stamp() // This is required by ElasticSearch, complete with this name. DO NOT REMOVE THIS.
|
||||
out["cpu"] = world.cpu
|
||||
out["maptick"] = world.map_cpu
|
||||
out["elapsed_processed"] = world.time
|
||||
out["elapsed_real"] = (REALTIMEOFDAY - world_init_time)
|
||||
out["client_count"] = length(GLOB.clients)
|
||||
out["round_id"] = text2num(GLOB.round_id) // This is so we can filter the metrics by a single round ID
|
||||
|
||||
// Funnel in all SS metrics
|
||||
var/list/ss_data = list()
|
||||
for(var/datum/controller/subsystem/SS in Master.subsystems)
|
||||
ss_data[SS.ss_id] = SS.get_metrics()
|
||||
|
||||
out["subsystems"] = ss_data
|
||||
// And send it all
|
||||
return json_encode(out)
|
||||
|
||||
/*
|
||||
|
||||
// Uncomment this if you add new metrics to verify how the JSON formats
|
||||
|
||||
/client/verb/debugmetricts()
|
||||
usr << browse(SSmetrics.get_metrics_json(), "window=aadebug")
|
||||
*/
|
||||
@@ -12,6 +12,12 @@ SUBSYSTEM_DEF(mobs)
|
||||
/// The amount of giant spiders that exist in the world. Used for mob capping.
|
||||
var/giant_spiders = 0
|
||||
|
||||
/datum/controller/subsystem/mobs/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(GLOB.mob_living_list)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/mobs/stat_entry()
|
||||
..("P:[GLOB.mob_living_list.len]")
|
||||
|
||||
|
||||
@@ -14,6 +14,12 @@ SUBSYSTEM_DEF(processing)
|
||||
/datum/controller/subsystem/processing/stat_entry()
|
||||
..("[stat_tag]:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/processing/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/processing/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
currentrun = processing.Copy()
|
||||
|
||||
45
code/controllers/subsystem/server_queue.dm
Normal file
45
code/controllers/subsystem/server_queue.dm
Normal file
@@ -0,0 +1,45 @@
|
||||
#define QUEUE_DATA_FILE "data/queue_data.json"
|
||||
// These are defines for the sake of making sure we get the right keys
|
||||
#define QUEUE_DATA_FILE_THRESHOLD_KEY "threshold"
|
||||
#define QUEUE_DATA_FILE_ENABLED_KEY "enabled"
|
||||
#define QUEUE_DATA_FILE_PERSISTENT_KEY "persistent"
|
||||
|
||||
SUBSYSTEM_DEF(queue)
|
||||
name = "Server Queue"
|
||||
init_order = INIT_ORDER_QUEUE // 100
|
||||
flags = SS_NO_FIRE
|
||||
/// Threshold of players to queue new people
|
||||
var/queue_threshold = 0
|
||||
/// Whether the queue is enabled or not
|
||||
var/queue_enabled = FALSE
|
||||
/// Whether to persist these settings over multiple rounds
|
||||
var/persist_queue = FALSE
|
||||
/// List of ckeys allowed to bypass queue this round
|
||||
var/list/queue_bypass_list = list()
|
||||
/// Last world.time we let a ckey in. 3 second delay between each letin to avoid a mass bubble
|
||||
var/last_letin_time = 0
|
||||
|
||||
/datum/controller/subsystem/queue/Initialize(start_timeofday)
|
||||
if(fexists(QUEUE_DATA_FILE))
|
||||
try
|
||||
var/F = file2text(QUEUE_DATA_FILE)
|
||||
var/list/data = json_decode(F)
|
||||
queue_threshold = data[QUEUE_DATA_FILE_THRESHOLD_KEY]
|
||||
queue_enabled = data[QUEUE_DATA_FILE_ENABLED_KEY]
|
||||
persist_queue = data[QUEUE_DATA_FILE_PERSISTENT_KEY]
|
||||
catch
|
||||
stack_trace("Failed to load [QUEUE_DATA_FILE] from disk due to malformed JSON. You may need to setup the queue again.")
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/queue/Shutdown()
|
||||
// Save if persistent
|
||||
if(persist_queue)
|
||||
if(fexists(QUEUE_DATA_FILE))
|
||||
fdel(QUEUE_DATA_FILE)
|
||||
var/data = list()
|
||||
data[QUEUE_DATA_FILE_THRESHOLD_KEY] = queue_threshold
|
||||
data[QUEUE_DATA_FILE_ENABLED_KEY] = queue_enabled
|
||||
data[QUEUE_DATA_FILE_PERSISTENT_KEY] = persist_queue
|
||||
var/json_data = json_encode(data)
|
||||
text2file(json_data, QUEUE_DATA_FILE)
|
||||
@@ -12,6 +12,11 @@ SUBSYSTEM_DEF(spacedrift)
|
||||
/datum/controller/subsystem/spacedrift/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/spacedrift/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/spacedrift/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
|
||||
@@ -27,6 +27,13 @@ SUBSYSTEM_DEF(tgui)
|
||||
/datum/controller/subsystem/tgui/stat_entry()
|
||||
..("P:[processing_uis.len]")
|
||||
|
||||
/datum/controller/subsystem/tgui/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing_uis)
|
||||
.["custom"] = cust
|
||||
|
||||
|
||||
/datum/controller/subsystem/tgui/fire(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = processing_uis.Copy()
|
||||
|
||||
@@ -15,6 +15,12 @@ SUBSYSTEM_DEF(throwing)
|
||||
/datum/controller/subsystem/throwing/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/throwing/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/throwing/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
|
||||
@@ -287,7 +287,7 @@ SUBSYSTEM_DEF(ticker)
|
||||
else
|
||||
log_debug("Playercount: [playercount] versus trigger: [highpop_trigger] - keeping standard job config")
|
||||
|
||||
SSnightshift.check_nightshift()
|
||||
SSnightshift.check_nightshift(TRUE)
|
||||
|
||||
#ifdef UNIT_TESTS
|
||||
RunUnitTests()
|
||||
|
||||
@@ -3,6 +3,7 @@ GLOBAL_REAL(SSmentor_tickets, /datum/controller/subsystem/tickets/mentor_tickets
|
||||
/datum/controller/subsystem/tickets/mentor_tickets/New()
|
||||
NEW_SS_GLOBAL(SSmentor_tickets)
|
||||
PreInit()
|
||||
ss_id = "mentor_tickets"
|
||||
|
||||
/datum/controller/subsystem/tickets/mentor_tickets
|
||||
name = "Mentor Tickets"
|
||||
|
||||
@@ -41,6 +41,12 @@ SUBSYSTEM_DEF(tickets)
|
||||
|
||||
var/ticketCounter = 1
|
||||
|
||||
/datum/controller/subsystem/tickets/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["tickets"] = length(allTickets) // Not a perf metric but I want to see a graph where SSair usage spikes and 20 tickets come in
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/tickets/Initialize()
|
||||
if(!close_messages)
|
||||
close_messages = list("<font color='red' size='4'><b>- [ticket_name] Rejected! -</b></font>",
|
||||
|
||||
@@ -37,6 +37,12 @@ SUBSYSTEM_DEF(timer)
|
||||
/datum/controller/subsystem/timer/stat_entry(msg)
|
||||
..("B:[bucket_count] P:[length(second_queue)] H:[length(hashes)] C:[length(clienttime_timers)] S:[length(timer_id_dict)]")
|
||||
|
||||
/datum/controller/subsystem/timer/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["bucket_count"] = bucket_count
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/timer/fire(resumed = FALSE)
|
||||
var/lit = last_invoke_tick
|
||||
var/last_check = world.time - TICKS2DS(BUCKET_LEN*1.5)
|
||||
|
||||
@@ -209,7 +209,7 @@ SUBSYSTEM_DEF(vote)
|
||||
|
||||
/datum/controller/subsystem/vote/proc/initiate_vote(vote_type, initiator_key, code_invoked = FALSE)
|
||||
if(!mode)
|
||||
if(started_time != null && !check_rights(R_ADMIN))
|
||||
if(usr && started_time != null && !check_rights(R_ADMIN)) // Allow the game to call votes whenever. But check other callers
|
||||
var/next_allowed_time = (started_time + GLOB.configuration.vote.vote_delay)
|
||||
if(next_allowed_time > world.time)
|
||||
return 0
|
||||
|
||||
@@ -9,11 +9,17 @@ SUBSYSTEM_DEF(weather)
|
||||
flags = SS_BACKGROUND
|
||||
wait = 10
|
||||
runlevels = RUNLEVEL_GAME
|
||||
offline_implications = "Ash storms will no longer trigger. No immediate action is needed."
|
||||
offline_implications = "Ash storms will no longer trigger. No immediate action is needed."
|
||||
var/list/processing = list()
|
||||
var/list/eligible_zlevels = list()
|
||||
var/list/next_hit_by_zlevel = list() //Used by barometers to know when the next storm is coming
|
||||
|
||||
/datum/controller/subsystem/weather/get_metrics()
|
||||
. = ..()
|
||||
var/list/cust = list()
|
||||
cust["processing"] = length(processing)
|
||||
.["custom"] = cust
|
||||
|
||||
/datum/controller/subsystem/weather/fire()
|
||||
// process active weather
|
||||
for(var/V in processing)
|
||||
|
||||
Reference in New Issue
Block a user