April sync (#360)
* Maps and things no code/icons * helpers defines globalvars * Onclick world.dm orphaned_procs * subsystems Round vote and shuttle autocall done here too * datums * Game folder * Admin - chatter modules * clothing - mining * modular computers - zambies * client * mob level 1 * mob stage 2 + simple_animal * silicons n brains * mob stage 3 + Alien/Monkey * human mobs * icons updated * some sounds * emitter y u no commit * update tgstation.dme * compile fixes * travis fixes Also removes Fast digest mode, because reasons. * tweaks for travis Mentors are broke again Also fixes Sizeray guns * oxygen loss fix for vore code. * removes unused code * some code updates * bulk fixes * further fixes * outside things * whoops. * Maint bar ported * GLOBs.
This commit is contained in:
@@ -43,9 +43,9 @@
|
||||
switch(controller)
|
||||
if("Master")
|
||||
Recreate_MC()
|
||||
feedback_add_details("admin_verb","RMC")
|
||||
feedback_add_details("admin_verb","Restart Master Controller")
|
||||
if("Failsafe")
|
||||
new /datum/controller/failsafe()
|
||||
feedback_add_details("admin_verb","RFailsafe")
|
||||
feedback_add_details("admin_verb","Restart Failsafe Controller")
|
||||
|
||||
message_admins("Admin [key_name_admin(usr)] has restarted the [controller] controller.")
|
||||
|
||||
@@ -5,10 +5,10 @@
|
||||
#define SECURITY_HAS_MAINT_ACCESS 2
|
||||
#define EVERYONE_HAS_MAINT_ACCESS 4
|
||||
|
||||
/datum/configuration/vv_get_var(var_name)
|
||||
var/static/list/banned_views = list("autoadmin", "autoadmin_rank")
|
||||
if(var_name in banned_views)
|
||||
return debug_variable(var_name, "SECRET", 0, src)
|
||||
/datum/configuration/can_vv_get(var_name)
|
||||
var/static/list/banned_gets = list("autoadmin", "autoadmin_rank")
|
||||
if (var_name in banned_gets)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/configuration/vv_edit_var(var_name, var_value)
|
||||
@@ -267,7 +267,7 @@
|
||||
|
||||
if(M.config_tag)
|
||||
if(!(M.config_tag in modes)) // ensure each mode is added only once
|
||||
diary << "Adding game mode [M.name] ([M.config_tag]) to configuration."
|
||||
GLOB.diary << "Adding game mode [M.name] ([M.config_tag]) to configuration."
|
||||
modes += M.config_tag
|
||||
mode_names[M.config_tag] = M.name
|
||||
probabilities[M.config_tag] = M.probability
|
||||
@@ -391,7 +391,7 @@
|
||||
if("guest_jobban")
|
||||
config.guest_jobban = 1
|
||||
if("guest_ban")
|
||||
guests_allowed = 0
|
||||
GLOB.guests_allowed = 0
|
||||
if("usewhitelist")
|
||||
config.usewhitelist = TRUE
|
||||
if("allow_metadata")
|
||||
@@ -421,9 +421,9 @@
|
||||
if("automute_on")
|
||||
automute_on = 1
|
||||
if("comms_key")
|
||||
global.comms_key = value
|
||||
GLOB.comms_key = value
|
||||
if(value != "default_pwd" && length(value) > 6) //It's the default value or less than 6 characters long, warn badmins
|
||||
global.comms_allowed = 1
|
||||
GLOB.comms_allowed = 1
|
||||
if("cross_server_address")
|
||||
cross_address = value
|
||||
if(value != "byond:\\address:port")
|
||||
@@ -437,9 +437,9 @@
|
||||
if(value != "byond:\\address:port")
|
||||
allow_panic_bunker_bounce = 1
|
||||
if("medal_hub_address")
|
||||
global.medal_hub = value
|
||||
GLOB.medal_hub = value
|
||||
if("medal_hub_password")
|
||||
global.medal_pass = value
|
||||
GLOB.medal_pass = value
|
||||
if("show_irc_name")
|
||||
config.showircname = 1
|
||||
if("see_own_notes")
|
||||
@@ -480,9 +480,9 @@
|
||||
if("log_runtimes")
|
||||
log_runtimes = TRUE
|
||||
var/newlog = file("data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log")
|
||||
if(runtime_diary != newlog)
|
||||
if(GLOB.runtime_diary != newlog)
|
||||
world.log << "Now logging runtimes to data/logs/runtimes/runtime-[time2text(world.realtime, "YYYY-MM-DD")].log"
|
||||
runtime_diary = newlog
|
||||
GLOB.runtime_diary = newlog
|
||||
if("autoconvert_notes")
|
||||
config.autoconvert_notes = 1
|
||||
if("allow_webclient")
|
||||
@@ -526,7 +526,7 @@
|
||||
if("error_msg_delay")
|
||||
error_msg_delay = text2num(value)
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
GLOB.diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
else if(type == "game_options")
|
||||
switch(name)
|
||||
@@ -589,13 +589,13 @@
|
||||
if(mode_name in config.modes)
|
||||
config.continuous[mode_name] = 1
|
||||
else
|
||||
diary << "Unknown continuous configuration definition: [mode_name]."
|
||||
GLOB.diary << "Unknown continuous configuration definition: [mode_name]."
|
||||
if("midround_antag")
|
||||
var/mode_name = lowertext(value)
|
||||
if(mode_name in config.modes)
|
||||
config.midround_antag[mode_name] = 1
|
||||
else
|
||||
diary << "Unknown midround antagonist configuration definition: [mode_name]."
|
||||
GLOB.diary << "Unknown midround antagonist configuration definition: [mode_name]."
|
||||
if("midround_antag_time_check")
|
||||
config.midround_antag_time_check = text2num(value)
|
||||
if("midround_antag_life_check")
|
||||
@@ -611,9 +611,9 @@
|
||||
if(mode_name in config.modes)
|
||||
config.min_pop[mode_name] = text2num(mode_value)
|
||||
else
|
||||
diary << "Unknown minimum population configuration definition: [mode_name]."
|
||||
GLOB.diary << "Unknown minimum population configuration definition: [mode_name]."
|
||||
else
|
||||
diary << "Incorrect minimum population configuration definition: [mode_name] [mode_value]."
|
||||
GLOB.diary << "Incorrect minimum population configuration definition: [mode_name] [mode_value]."
|
||||
if("max_pop")
|
||||
var/pop_pos = findtext(value, " ")
|
||||
var/mode_name = null
|
||||
@@ -625,9 +625,9 @@
|
||||
if(mode_name in config.modes)
|
||||
config.max_pop[mode_name] = text2num(mode_value)
|
||||
else
|
||||
diary << "Unknown maximum population configuration definition: [mode_name]."
|
||||
GLOB.diary << "Unknown maximum population configuration definition: [mode_name]."
|
||||
else
|
||||
diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]."
|
||||
GLOB.diary << "Incorrect maximum population configuration definition: [mode_name] [mode_value]."
|
||||
if("shuttle_refuel_delay")
|
||||
config.shuttle_refuel_delay = text2num(value)
|
||||
if("show_game_type_odds")
|
||||
@@ -655,9 +655,9 @@
|
||||
if(prob_name in config.modes)
|
||||
config.probabilities[prob_name] = text2num(prob_value)
|
||||
else
|
||||
diary << "Unknown game mode probability configuration definition: [prob_name]."
|
||||
GLOB.diary << "Unknown game mode probability configuration definition: [prob_name]."
|
||||
else
|
||||
diary << "Incorrect probability configuration definition: [prob_name] [prob_value]."
|
||||
GLOB.diary << "Incorrect probability configuration definition: [prob_name] [prob_value]."
|
||||
|
||||
if("protect_roles_from_antagonist")
|
||||
config.protect_roles_from_antagonist = 1
|
||||
@@ -691,10 +691,6 @@
|
||||
config.forbid_peaceborg = 1
|
||||
if("silent_ai")
|
||||
config.silent_ai = 1
|
||||
if ("mentor_mobname_only")
|
||||
config.mentors_mobname_only = 1
|
||||
if ("mentor_legacy_system")
|
||||
config.mentor_legacy_system = 1
|
||||
if("silent_borg")
|
||||
config.silent_borg = 1
|
||||
if("sandbox_autoclose")
|
||||
@@ -708,7 +704,7 @@
|
||||
// Value is in the form "LAWID,NUMBER"
|
||||
var/list/L = splittext(value, ",")
|
||||
if(L.len != 2)
|
||||
diary << "Invalid LAW_WEIGHT: " + t
|
||||
GLOB.diary << "Invalid LAW_WEIGHT: " + t
|
||||
continue
|
||||
var/lawid = L[1]
|
||||
var/weight = text2num(L[2])
|
||||
@@ -720,10 +716,10 @@
|
||||
config.mutant_races = 1
|
||||
if("roundstart_races")
|
||||
var/race_id = lowertext(value)
|
||||
for(var/species_id in species_list)
|
||||
for(var/species_id in GLOB.species_list)
|
||||
if(species_id == race_id)
|
||||
roundstart_races += species_list[species_id]
|
||||
roundstart_species[species_id] = species_list[species_id]
|
||||
roundstart_races += GLOB.species_list[species_id]
|
||||
GLOB.roundstart_species[species_id] = GLOB.species_list[species_id]
|
||||
if("join_with_mutant_humans")
|
||||
config.mutant_humans = 1
|
||||
if("assistant_cap")
|
||||
@@ -751,17 +747,21 @@
|
||||
if (BombCap < 4)
|
||||
BombCap = 4
|
||||
|
||||
MAX_EX_DEVESTATION_RANGE = round(BombCap/4)
|
||||
MAX_EX_HEAVY_RANGE = round(BombCap/2)
|
||||
MAX_EX_LIGHT_RANGE = BombCap
|
||||
MAX_EX_FLASH_RANGE = BombCap
|
||||
MAX_EX_FLAME_RANGE = BombCap
|
||||
GLOB.MAX_EX_DEVESTATION_RANGE = round(BombCap/4)
|
||||
GLOB.MAX_EX_HEAVY_RANGE = round(BombCap/2)
|
||||
GLOB.MAX_EX_LIGHT_RANGE = BombCap
|
||||
GLOB.MAX_EX_FLASH_RANGE = BombCap
|
||||
GLOB.MAX_EX_FLAME_RANGE = BombCap
|
||||
if("arrivals_shuttle_dock_window")
|
||||
config.arrivals_shuttle_dock_window = max(PARALLAX_LOOP_TIME, text2num(value))
|
||||
if("arrivals_shuttle_require_safe_latejoin")
|
||||
config.arrivals_shuttle_require_safe_latejoin = text2num(value)
|
||||
if ("mentor_mobname_only")
|
||||
config.mentors_mobname_only = 1
|
||||
if ("mentor_legacy_system")
|
||||
config.mentor_legacy_system = 1
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
GLOB.diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
fps = round(fps)
|
||||
if(fps <= 0)
|
||||
@@ -815,7 +815,7 @@
|
||||
config.maplist[currentmap.map_name] = currentmap
|
||||
currentmap = null
|
||||
else
|
||||
diary << "Unknown command in map vote config: '[command]'"
|
||||
GLOB.diary << "Unknown command in map vote config: '[command]'"
|
||||
|
||||
|
||||
/datum/configuration/proc/loadsql(filename)
|
||||
@@ -847,19 +847,19 @@
|
||||
if("sql_enabled")
|
||||
config.sql_enabled = 1
|
||||
if("address")
|
||||
sqladdress = value
|
||||
GLOB.sqladdress = value
|
||||
if("port")
|
||||
sqlport = value
|
||||
GLOB.sqlport = value
|
||||
if("feedback_database")
|
||||
sqlfdbkdb = value
|
||||
GLOB.sqlfdbkdb = value
|
||||
if("feedback_login")
|
||||
sqlfdbklogin = value
|
||||
GLOB.sqlfdbklogin = value
|
||||
if("feedback_password")
|
||||
sqlfdbkpass = value
|
||||
GLOB.sqlfdbkpass = value
|
||||
if("feedback_tableprefix")
|
||||
sqlfdbktableprefix = value
|
||||
GLOB.sqlfdbktableprefix = value
|
||||
else
|
||||
diary << "Unknown setting in configuration: '[name]'"
|
||||
GLOB.diary << "Unknown setting in configuration: '[name]'"
|
||||
|
||||
/datum/configuration/proc/pick_mode(mode_name)
|
||||
// I wish I didn't have to instance the game modes in order to look up
|
||||
@@ -893,7 +893,7 @@
|
||||
|
||||
/datum/configuration/proc/get_runnable_midround_modes(crew)
|
||||
var/list/datum/game_mode/runnable_modes = new
|
||||
for(var/T in (gamemode_cache - ticker.mode.type))
|
||||
for(var/T in (gamemode_cache - SSticker.mode.type))
|
||||
var/datum/game_mode/M = new T()
|
||||
if(!(M.config_tag in modes))
|
||||
qdel(M)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Pretty much pokes the MC to make sure it's still alive.
|
||||
**/
|
||||
|
||||
var/datum/controller/failsafe/Failsafe
|
||||
GLOBAL_REAL(Failsafe, /datum/controller/failsafe)
|
||||
|
||||
/datum/controller/failsafe // This thing pretty much just keeps poking the master controller
|
||||
name = "Failsafe"
|
||||
@@ -56,23 +56,23 @@ var/datum/controller/failsafe/Failsafe
|
||||
if(4,5)
|
||||
--defcon
|
||||
if(3)
|
||||
to_chat(admins, "<span class='adminnotice'>Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks.")
|
||||
to_chat(GLOB.admins, "<span class='adminnotice'>Notice: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks.")
|
||||
--defcon
|
||||
if(2)
|
||||
to_chat(admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has not fired in the last [(5-defcon) * processing_interval] ticks. Automatic restart in [processing_interval] ticks.</span>")
|
||||
--defcon
|
||||
if(1)
|
||||
|
||||
to_chat(admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>Warning: DEFCON [defcon_pretty()]. The Master Controller has still not fired within the last [(5-defcon) * processing_interval] ticks. Killing and restarting...</span>")
|
||||
--defcon
|
||||
var/rtn = Recreate_MC()
|
||||
if(rtn > 0)
|
||||
defcon = 4
|
||||
master_iteration = 0
|
||||
to_chat(admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
to_chat(GLOB.admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
else if(rtn < 0)
|
||||
log_game("FailSafe: Could not restart MC, runtime encountered. Entering defcon 0")
|
||||
to_chat(admins, "<span class='boldannounce'>ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.</span>")
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>ERROR: DEFCON [defcon_pretty()]. Could not restart MC, runtime encountered. I will silently keep retrying.</span>")
|
||||
//if the return number was 0, it just means the mc was restarted too recently, and it just needs some time before we try again
|
||||
//no need to handle that specially when defcon 0 can handle it
|
||||
if(0) //DEFCON 0! (mc failed to restart)
|
||||
@@ -80,7 +80,7 @@ var/datum/controller/failsafe/Failsafe
|
||||
if(rtn > 0)
|
||||
defcon = 4
|
||||
master_iteration = 0
|
||||
to_chat(admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
to_chat(GLOB.admins, "<span class='adminnotice'>MC restarted successfully</span>")
|
||||
else
|
||||
defcon = min(defcon + 1,5)
|
||||
master_iteration = Master.iteration
|
||||
|
||||
62
code/controllers/globals.dm
Normal file
62
code/controllers/globals.dm
Normal file
@@ -0,0 +1,62 @@
|
||||
GLOBAL_REAL(GLOB, /datum/controller/global_vars)
|
||||
|
||||
/datum/controller/global_vars
|
||||
name = "Global Variables"
|
||||
|
||||
var/list/gvars_datum_protected_varlist
|
||||
var/list/gvars_datum_in_built_vars
|
||||
var/list/gvars_datum_init_order
|
||||
|
||||
/datum/controller/global_vars/New()
|
||||
if(GLOB)
|
||||
CRASH("Multiple instances of global variable controller created")
|
||||
GLOB = src
|
||||
|
||||
var/datum/controller/exclude_these = new
|
||||
gvars_datum_in_built_vars = exclude_these.vars + list("gvars_datum_protected_varlist", "gvars_datum_in_built_vars", "gvars_datum_init_order")
|
||||
qdel(exclude_these)
|
||||
|
||||
Initialize()
|
||||
|
||||
/datum/controller/global_vars/Destroy(force)
|
||||
if(!force)
|
||||
return QDEL_HINT_LETMELIVE
|
||||
|
||||
stack_trace("Some fucker deleted the global holder!")
|
||||
|
||||
QDEL_NULL(statclick)
|
||||
gvars_datum_protected_varlist.Cut()
|
||||
gvars_datum_in_built_vars.Cut()
|
||||
|
||||
GLOB = null
|
||||
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/stat_entry()
|
||||
if(!statclick)
|
||||
statclick = new/obj/effect/statclick/debug(null, "Initializing...", src)
|
||||
|
||||
var/static/num_globals
|
||||
if(!num_globals)
|
||||
num_globals = vars.len - gvars_datum_in_built_vars.len
|
||||
stat("Globals:", statclick.update("Count: [num_globals]"))
|
||||
|
||||
/datum/controller/global_vars/can_vv_get(var_name)
|
||||
if(var_name in gvars_datum_protected_varlist)
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/vv_edit_var(var_name, var_value)
|
||||
if((var_name in gvars_datum_protected_varlist))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
/datum/controller/global_vars/Initialize()
|
||||
gvars_datum_init_order = list()
|
||||
gvars_datum_protected_varlist = list("gvars_datum_protected_varlist")
|
||||
for(var/I in vars - gvars_datum_in_built_vars)
|
||||
var/start_tick = world.time
|
||||
call(src, "InitGlobal[I]")()
|
||||
var/end_tick = world.time
|
||||
if(end_tick - start_tick)
|
||||
warning("Global [I] slept during initialization!")
|
||||
@@ -6,15 +6,18 @@
|
||||
* Odds are, there is a reason
|
||||
*
|
||||
**/
|
||||
var/datum/controller/master/Master = new()
|
||||
var/MC_restart_clear = 0
|
||||
var/MC_restart_timeout = 0
|
||||
var/MC_restart_count = 0
|
||||
|
||||
//This is the ABSOLUTE ONLY THING that should init globally like this
|
||||
GLOBAL_REAL(Master, /datum/controller/master) = new
|
||||
|
||||
GLOBAL_VAR_INIT(MC_restart_clear, 0)
|
||||
GLOBAL_VAR_INIT(MC_restart_timeout, 0)
|
||||
GLOBAL_VAR_INIT(MC_restart_count, 0)
|
||||
|
||||
|
||||
//current tick limit, assigned by the queue controller before running a subsystem.
|
||||
//used by check_tick as well so that the procs subsystems call can obey that SS's tick limits
|
||||
var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
||||
|
||||
/datum/controller/master
|
||||
name = "Master"
|
||||
@@ -62,6 +65,9 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
else
|
||||
init_subtypes(/datum/controller/subsystem, subsystems)
|
||||
Master = src
|
||||
|
||||
if(!GLOB)
|
||||
new /datum/controller/global_vars
|
||||
|
||||
/datum/controller/master/Destroy()
|
||||
..()
|
||||
@@ -77,14 +83,14 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
// -1 if we encountered a runtime trying to recreate it
|
||||
/proc/Recreate_MC()
|
||||
. = -1 //so if we runtime, things know we failed
|
||||
if (world.time < MC_restart_timeout)
|
||||
if (world.time < GLOB.MC_restart_timeout)
|
||||
return 0
|
||||
if (world.time < MC_restart_clear)
|
||||
MC_restart_count *= 0.5
|
||||
if (world.time < GLOB.MC_restart_clear)
|
||||
GLOB.MC_restart_count *= 0.5
|
||||
|
||||
var/delay = 50 * ++MC_restart_count
|
||||
MC_restart_timeout = world.time + delay
|
||||
MC_restart_clear = world.time + (delay * 2)
|
||||
var/delay = 50 * ++GLOB.MC_restart_count
|
||||
GLOB.MC_restart_timeout = world.time + delay
|
||||
GLOB.MC_restart_clear = world.time + (delay * 2)
|
||||
Master.processing = 0 //stop ticking this one
|
||||
try
|
||||
new/datum/controller/master()
|
||||
@@ -107,7 +113,25 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
else
|
||||
msg += "\t [varname] = [varval]\n"
|
||||
log_world(msg)
|
||||
|
||||
var/datum/controller/subsystem/BadBoy = Master.last_type_processed
|
||||
var/FireHim = FALSE
|
||||
if(istype(BadBoy))
|
||||
msg = null
|
||||
switch(++BadBoy.failure_strikes)
|
||||
if(2)
|
||||
msg = "The [BadBoy.name] subsystem was the last to fire for 2 controller restarts. It will be recovered now and disabled if it happens again."
|
||||
FireHim = TRUE
|
||||
if(3)
|
||||
msg = "The [BadBoy.name] subsystem seems to be destabilizing the MC and will be offlined."
|
||||
BadBoy.flags |= SS_NO_FIRE
|
||||
if(msg)
|
||||
to_chat(GLOB.admins, "<span class='boldannounce'>[msg]</span>")
|
||||
log_world(msg)
|
||||
|
||||
if (istype(Master.subsystems))
|
||||
if(FireHim)
|
||||
Master.subsystems += new BadBoy.type //NEW_SS_GLOBAL will remove the old one
|
||||
subsystems = Master.subsystems
|
||||
StartProcessing(10)
|
||||
else
|
||||
@@ -133,13 +157,13 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
|
||||
var/start_timeofday = REALTIMEOFDAY
|
||||
// Initialize subsystems.
|
||||
CURRENT_TICKLIMIT = config.tick_limit_mc_init
|
||||
GLOB.CURRENT_TICKLIMIT = config.tick_limit_mc_init
|
||||
for (var/datum/controller/subsystem/SS in subsystems)
|
||||
if (SS.flags & SS_NO_INIT)
|
||||
continue
|
||||
SS.Initialize(REALTIMEOFDAY)
|
||||
CHECK_TICK
|
||||
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
var/time = (REALTIMEOFDAY - start_timeofday) / 10
|
||||
|
||||
var/msg = "Initializations complete within [time] second[time == 1 ? "" : "s"]!"
|
||||
@@ -242,7 +266,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
while (1)
|
||||
tickdrift = max(0, MC_AVERAGE_FAST(tickdrift, (((REALTIMEOFDAY - init_timeofday) - (world.time - init_time)) / world.tick_lag)))
|
||||
if (processing <= 0)
|
||||
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
sleep(10)
|
||||
continue
|
||||
|
||||
@@ -250,7 +274,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
// because sleeps are processed in the order received, so longer sleeps are more likely to run first
|
||||
if (world.tick_usage > TICK_LIMIT_MC)
|
||||
sleep_delta += 2
|
||||
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.5)
|
||||
GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.5)
|
||||
sleep(world.tick_lag * (processing + sleep_delta))
|
||||
continue
|
||||
|
||||
@@ -279,7 +303,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
if (!error_level)
|
||||
iteration++
|
||||
error_level++
|
||||
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
sleep(10)
|
||||
continue
|
||||
|
||||
@@ -291,7 +315,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
if (!error_level)
|
||||
iteration++
|
||||
error_level++
|
||||
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
sleep(10)
|
||||
continue
|
||||
error_level--
|
||||
@@ -302,7 +326,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
iteration++
|
||||
last_run = world.time
|
||||
src.sleep_delta = MC_AVERAGE_FAST(src.sleep_delta, sleep_delta)
|
||||
CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc.
|
||||
GLOB.CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING - (TICK_LIMIT_RUNNING * 0.25) //reserve the tail 1/4 of the next tick for the mc.
|
||||
sleep(world.tick_lag * (processing + sleep_delta))
|
||||
|
||||
|
||||
@@ -391,7 +415,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
|
||||
else
|
||||
tick_precentage = tick_remaining
|
||||
|
||||
CURRENT_TICKLIMIT = world.tick_usage + tick_precentage
|
||||
GLOB.CURRENT_TICKLIMIT = world.tick_usage + tick_precentage
|
||||
|
||||
if (!(queue_node_flags & SS_TICKER))
|
||||
ran_non_ticker = TRUE
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
|
||||
/datum/controller/subsystem
|
||||
// Metadata; you should define these.
|
||||
name = "fire coderbus" //name of the subsystem
|
||||
@@ -29,8 +28,17 @@
|
||||
var/datum/controller/subsystem/queue_next
|
||||
var/datum/controller/subsystem/queue_prev
|
||||
|
||||
// Used to initialize the subsystem BEFORE the map has loaded
|
||||
var/static/failure_strikes = 0 //How many times we suspect this subsystem has crashed the MC, 3 strikes and you're out!
|
||||
|
||||
//Do not override
|
||||
/datum/controller/subsystem/New()
|
||||
return
|
||||
|
||||
// Used to initialize the subsystem BEFORE the map has loaded
|
||||
// Called AFTER Recover if that is called
|
||||
// Prefer to use Initialize if possible
|
||||
/datum/controller/subsystem/proc/PreInit()
|
||||
return
|
||||
|
||||
//This is used so the mc knows when the subsystem sleeps. do not override.
|
||||
/datum/controller/subsystem/proc/ignite(resumed = 0)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/acid/SSacid
|
||||
|
||||
/datum/controller/subsystem/acid
|
||||
SUBSYSTEM_DEF(acid)
|
||||
name = "Acid"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT|SS_BACKGROUND
|
||||
@@ -8,10 +6,6 @@ var/datum/controller/subsystem/acid/SSacid
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/acid/New()
|
||||
NEW_SS_GLOBAL(SSacid)
|
||||
|
||||
|
||||
/datum/controller/subsystem/acid/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
@@ -34,7 +28,7 @@ var/datum/controller/subsystem/acid/SSacid
|
||||
|
||||
if(O.acid_level && O.acid_processing())
|
||||
else
|
||||
O.cut_overlay(acid_overlay, TRUE)
|
||||
O.cut_overlay(GLOB.acid_overlay, TRUE)
|
||||
processing -= O
|
||||
|
||||
if (MC_TICK_CHECK)
|
||||
|
||||
@@ -5,9 +5,8 @@
|
||||
#define SSAIR_HIGHPRESSURE 5
|
||||
#define SSAIR_HOTSPOTS 6
|
||||
#define SSAIR_SUPERCONDUCTIVITY 7
|
||||
var/datum/controller/subsystem/air/SSair
|
||||
|
||||
/datum/controller/subsystem/air
|
||||
SUBSYSTEM_DEF(air)
|
||||
name = "Air"
|
||||
init_order = -1
|
||||
priority = 20
|
||||
@@ -41,9 +40,6 @@ var/datum/controller/subsystem/air/SSair
|
||||
var/map_loading = TRUE
|
||||
var/list/queued_for_activation
|
||||
|
||||
/datum/controller/subsystem/air/New()
|
||||
NEW_SS_GLOBAL(SSair)
|
||||
|
||||
/datum/controller/subsystem/air/stat_entry(msg)
|
||||
msg += "C:{"
|
||||
msg += "AT:[round(cost_turfs,1)]|"
|
||||
@@ -69,6 +65,7 @@ var/datum/controller/subsystem/air/SSair
|
||||
setup_allturfs()
|
||||
setup_atmos_machinery()
|
||||
setup_pipenets()
|
||||
gas_reactions = init_gas_reactions()
|
||||
..()
|
||||
|
||||
|
||||
@@ -244,6 +241,9 @@ var/datum/controller/subsystem/air/SSair
|
||||
active_turfs -= T
|
||||
if(currentpart == SSAIR_ACTIVETURFS)
|
||||
currentrun -= T
|
||||
#ifdef VISUALIZE_ACTIVE_TURFS
|
||||
T.remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#00ff00")
|
||||
#endif
|
||||
if(istype(T))
|
||||
T.excited = 0
|
||||
if(T.excited_group)
|
||||
@@ -251,6 +251,9 @@ var/datum/controller/subsystem/air/SSair
|
||||
|
||||
/datum/controller/subsystem/air/proc/add_to_active(turf/open/T, blockchanges = 1)
|
||||
if(istype(T) && T.air)
|
||||
#ifdef VISUALIZE_ACTIVE_TURFS
|
||||
T.add_atom_colour("#00ff00", TEMPORARY_COLOUR_PRIORITY)
|
||||
#endif
|
||||
T.excited = 1
|
||||
active_turfs |= T
|
||||
if(currentpart == SSAIR_ACTIVETURFS)
|
||||
@@ -296,7 +299,7 @@ var/datum/controller/subsystem/air/SSair
|
||||
var/timer = world.timeofday
|
||||
warning("There are [starting_ats] active turfs at roundstart, this is a mapping error caused by a difference of the air between the adjacent turfs. You can see its coordinates using \"Mapping -> Show roundstart AT list\" verb (debug verbs required)")
|
||||
for(var/turf/T in active_turfs)
|
||||
active_turfs_startlist += text("[T.x], [T.y], [T.z]\n")
|
||||
GLOB.active_turfs_startlist += text("[T.x], [T.y], [T.z]\n")
|
||||
|
||||
//now lets clear out these active turfs
|
||||
var/list/turfs_to_check = active_turfs.Copy()
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
var/datum/controller/subsystem/assets/SSasset
|
||||
|
||||
/datum/controller/subsystem/assets
|
||||
SUBSYSTEM_DEF(assets)
|
||||
name = "Assets"
|
||||
init_order = -3
|
||||
flags = SS_NO_FIRE
|
||||
var/list/cache = list()
|
||||
|
||||
/datum/controller/subsystem/assets/New()
|
||||
NEW_SS_GLOBAL(SSasset)
|
||||
|
||||
/datum/controller/subsystem/assets/Initialize(timeofday)
|
||||
for(var/type in typesof(/datum/asset) - list(/datum/asset, /datum/asset/simple))
|
||||
var/datum/asset/A = new type()
|
||||
A.register()
|
||||
|
||||
for(var/client/C in clients)
|
||||
for(var/client/C in GLOB.clients)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/getFilesSlow, C, cache, FALSE), 10)
|
||||
..()
|
||||
@@ -1,10 +1,8 @@
|
||||
var/datum/controller/subsystem/atoms/SSatoms
|
||||
|
||||
#define INITIALIZATION_INSSATOMS 0 //New should not call Initialize
|
||||
#define INITIALIZATION_INNEW_MAPLOAD 1 //New should call Initialize(TRUE)
|
||||
#define INITIALIZATION_INNEW_REGULAR 2 //New should call Initialize(FALSE)
|
||||
|
||||
/datum/controller/subsystem/atoms
|
||||
SUBSYSTEM_DEF(atoms)
|
||||
name = "Atoms"
|
||||
init_order = 11
|
||||
flags = SS_NO_FIRE
|
||||
@@ -12,11 +10,10 @@ var/datum/controller/subsystem/atoms/SSatoms
|
||||
var/initialized = INITIALIZATION_INSSATOMS
|
||||
var/old_initialized
|
||||
|
||||
/datum/controller/subsystem/atoms/New()
|
||||
NEW_SS_GLOBAL(SSatoms)
|
||||
var/list/late_loaders
|
||||
|
||||
/datum/controller/subsystem/atoms/Initialize(timeofday)
|
||||
fire_overlay.appearance_flags = RESET_COLOR
|
||||
GLOB.fire_overlay.appearance_flags = RESET_COLOR
|
||||
setupGenetics() //to set the mutations' place in structural enzymes, so monkey.initialize() knows where to put the monkey mutation.
|
||||
initialized = INITIALIZATION_INNEW_MAPLOAD
|
||||
InitializeAtoms()
|
||||
@@ -26,8 +23,6 @@ var/datum/controller/subsystem/atoms/SSatoms
|
||||
if(initialized == INITIALIZATION_INSSATOMS)
|
||||
return
|
||||
|
||||
var/list/late_loaders
|
||||
|
||||
initialized = INITIALIZATION_INNEW_MAPLOAD
|
||||
|
||||
var/static/list/NewQdelList = list()
|
||||
@@ -73,15 +68,15 @@ var/datum/controller/subsystem/atoms/SSatoms
|
||||
|
||||
initialized = INITIALIZATION_INNEW_REGULAR
|
||||
|
||||
if(late_loaders)
|
||||
for(var/I in late_loaders)
|
||||
var/atom/A = I
|
||||
var/start_tick = world.time
|
||||
A.Initialize(FALSE)
|
||||
if(start_tick != world.time)
|
||||
WARNING("[A]: [A.type] slept during it's Initialize!")
|
||||
CHECK_TICK
|
||||
testing("Late-initialized [late_loaders.len] atoms")
|
||||
for(var/I in late_loaders)
|
||||
var/atom/A = I
|
||||
var/start_tick = world.time
|
||||
A.Initialize(FALSE)
|
||||
if(start_tick != world.time)
|
||||
WARNING("[A]: [A.type] slept during it's Initialize!")
|
||||
CHECK_TICK
|
||||
testing("Late-initialized [LAZYLEN(late_loaders)] atoms")
|
||||
LAZYCLEARLIST(late_loaders)
|
||||
|
||||
/datum/controller/subsystem/atoms/proc/map_loader_begin()
|
||||
old_initialized = initialized
|
||||
@@ -108,9 +103,9 @@ var/datum/controller/subsystem/atoms/SSatoms
|
||||
continue
|
||||
B.dna_block = pick_n_take(avnums)
|
||||
if(B.quality == POSITIVE)
|
||||
good_mutations |= B
|
||||
GLOB.good_mutations |= B
|
||||
else if(B.quality == NEGATIVE)
|
||||
bad_mutations |= B
|
||||
GLOB.bad_mutations |= B
|
||||
else if(B.quality == MINOR_NEGATIVE)
|
||||
not_good_mutations |= B
|
||||
CHECK_TICK
|
||||
GLOB.not_good_mutations |= B
|
||||
CHECK_TICK
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/augury/SSaugury
|
||||
|
||||
/datum/controller/subsystem/augury
|
||||
SUBSYSTEM_DEF(augury)
|
||||
name = "Augury"
|
||||
flags = SS_NO_INIT
|
||||
|
||||
@@ -9,9 +7,6 @@ var/datum/controller/subsystem/augury/SSaugury
|
||||
|
||||
var/list/observers_given_action = list()
|
||||
|
||||
/datum/controller/subsystem/augury/New()
|
||||
NEW_SS_GLOBAL(SSaugury)
|
||||
|
||||
/datum/controller/subsystem/augury/stat_entry(msg)
|
||||
..("W:[watchers.len]|D:[doombringers.len]")
|
||||
|
||||
@@ -33,7 +28,7 @@ var/datum/controller/subsystem/augury/SSaugury
|
||||
biggest_threat = threat
|
||||
|
||||
if(doombringers.len)
|
||||
for(var/i in player_list)
|
||||
for(var/i in GLOB.player_list)
|
||||
if(isobserver(i) && (!(observers_given_action[i])))
|
||||
var/datum/action/innate/augury/A = new
|
||||
A.Grant(i)
|
||||
|
||||
@@ -1,18 +1,13 @@
|
||||
#define COMMUNICATION_COOLDOWN 600
|
||||
#define COMMUNICATION_COOLDOWN_AI 600
|
||||
|
||||
var/datum/controller/subsystem/communications/SScommunications
|
||||
|
||||
/datum/controller/subsystem/communications
|
||||
SUBSYSTEM_DEF(communications)
|
||||
name = "Communications"
|
||||
flags = SS_NO_INIT | SS_NO_FIRE
|
||||
|
||||
var/silicon_message_cooldown
|
||||
var/nonsilicon_message_cooldown
|
||||
|
||||
/datum/controller/subsystem/communications/New()
|
||||
NEW_SS_GLOBAL(SScommunications)
|
||||
|
||||
/datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon)
|
||||
if(is_silicon && silicon_message_cooldown > world.time)
|
||||
. = FALSE
|
||||
|
||||
40
code/controllers/subsystem/disease.dm
Normal file
40
code/controllers/subsystem/disease.dm
Normal file
@@ -0,0 +1,40 @@
|
||||
SUBSYSTEM_DEF(disease)
|
||||
name = "Disease"
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
var/list/diseases
|
||||
var/list/archive_diseases = list()
|
||||
|
||||
var/static/list/list_symptoms = subtypesof(/datum/symptom)
|
||||
|
||||
/datum/controller/subsystem/disease/PreInit()
|
||||
if(!diseases)
|
||||
diseases = subtypesof(/datum/disease)
|
||||
|
||||
/datum/controller/subsystem/disease/Recover()
|
||||
currentrun = SSdisease.currentrun
|
||||
processing = SSdisease.processing
|
||||
diseases = SSdisease.diseases
|
||||
archive_diseases = SSdisease.archive_diseases
|
||||
|
||||
/datum/controller/subsystem/disease/stat_entry(msg)
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/disease/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
while(currentrun.len)
|
||||
var/datum/thing = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(thing)
|
||||
thing.process()
|
||||
else
|
||||
processing.Remove(thing)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
@@ -1,30 +0,0 @@
|
||||
var/datum/controller/subsystem/diseases/SSdisease
|
||||
|
||||
/datum/controller/subsystem/diseases
|
||||
name = "Diseases"
|
||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/diseases/New()
|
||||
NEW_SS_GLOBAL(SSdisease)
|
||||
|
||||
/datum/controller/subsystem/diseases/stat_entry(msg)
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/diseases/fire(resumed = 0)
|
||||
if(!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
while(currentrun.len)
|
||||
var/datum/thing = currentrun[currentrun.len]
|
||||
currentrun.len--
|
||||
if(thing)
|
||||
thing.process()
|
||||
else
|
||||
processing.Remove(thing)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/events/SSevent
|
||||
|
||||
/datum/controller/subsystem/events
|
||||
SUBSYSTEM_DEF(events)
|
||||
name = "Events"
|
||||
init_order = 6
|
||||
|
||||
@@ -15,11 +13,6 @@ var/datum/controller/subsystem/events/SSevent
|
||||
var/list/holidays //List of all holidays occuring today or null if no holidays
|
||||
var/wizardmode = 0
|
||||
|
||||
|
||||
/datum/controller/subsystem/events/New()
|
||||
NEW_SS_GLOBAL(SSevent)
|
||||
|
||||
|
||||
/datum/controller/subsystem/events/Initialize(time, zlevel)
|
||||
for(var/type in typesof(/datum/round_event_control))
|
||||
var/datum/round_event_control/E = new type()
|
||||
@@ -67,7 +60,7 @@ var/datum/controller/subsystem/events/SSevent
|
||||
// if(E) E.runEvent()
|
||||
return
|
||||
|
||||
var/gamemode = ticker.mode.config_tag
|
||||
var/gamemode = SSticker.mode.config_tag
|
||||
var/players_amt = get_active_player_count(alive_check = 1, afk_check = 1, human_check = 1)
|
||||
// Only alive, non-AFK human players count towards this.
|
||||
|
||||
@@ -114,7 +107,7 @@ var/datum/controller/subsystem/events/SSevent
|
||||
/area/engine/chiefs_office)
|
||||
|
||||
//Need to locate() as it's just a list of paths.
|
||||
return locate(pick((the_station_areas - safe_areas) + danger_areas))
|
||||
return locate(pick((GLOB.the_station_areas - safe_areas) + danger_areas))
|
||||
|
||||
|
||||
//allows a client to trigger an event
|
||||
@@ -133,7 +126,7 @@ var/datum/controller/subsystem/events/SSevent
|
||||
var/normal = ""
|
||||
var/magic = ""
|
||||
var/holiday = ""
|
||||
for(var/datum/round_event_control/E in SSevent.control)
|
||||
for(var/datum/round_event_control/E in SSevents.control)
|
||||
dat = "<BR><A href='?src=\ref[src];forceevent=\ref[E]'>[E]</A>"
|
||||
if(E.holidayID)
|
||||
holiday += dat
|
||||
@@ -156,7 +149,7 @@ var/datum/controller/subsystem/events/SSevent
|
||||
//Uncommenting ALLOW_HOLIDAYS in config.txt will enable holidays
|
||||
|
||||
//It's easy to add stuff. Just add a holiday datum in code/modules/holiday/holidays.dm
|
||||
//You can then check if it's a special day in any code in the game by doing if(SSevent.holidays["Groundhog Day"])
|
||||
//You can then check if it's a special day in any code in the game by doing if(SSevents.holidays["Groundhog Day"])
|
||||
|
||||
//You can also make holiday random events easily thanks to Pete/Gia's system.
|
||||
//simply make a random event normally, then assign it a holidayID string which matches the holiday's name.
|
||||
@@ -193,7 +186,7 @@ var/datum/controller/subsystem/events/SSevent
|
||||
|
||||
/datum/controller/subsystem/events/proc/toggleWizardmode()
|
||||
wizardmode = !wizardmode
|
||||
message_admins("Summon Events has been [wizardmode ? "enabled, events will occur every [SSevent.frequency_lower / 600] to [SSevent.frequency_upper / 600] minutes" : "disabled"]!")
|
||||
message_admins("Summon Events has been [wizardmode ? "enabled, events will occur every [SSevents.frequency_lower / 600] to [SSevents.frequency_upper / 600] minutes" : "disabled"]!")
|
||||
log_game("Summon Events was [wizardmode ? "enabled" : "disabled"]!")
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/fire_burning/SSfire_burning
|
||||
|
||||
/datum/controller/subsystem/fire_burning
|
||||
SUBSYSTEM_DEF(fire_burning)
|
||||
name = "Fire Burning"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT|SS_BACKGROUND
|
||||
@@ -8,10 +6,6 @@ var/datum/controller/subsystem/fire_burning/SSfire_burning
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/fire_burning/New()
|
||||
NEW_SS_GLOBAL(SSfire_burning)
|
||||
|
||||
|
||||
/datum/controller/subsystem/fire_burning/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
|
||||
/datum/controller/subsystem/garbage_collector
|
||||
SUBSYSTEM_DEF(garbage)
|
||||
name = "Garbage"
|
||||
priority = 15
|
||||
wait = 5
|
||||
@@ -34,10 +32,7 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
var/list/qdel_list = list() // list of all types that have been qdel()eted
|
||||
#endif
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/New()
|
||||
NEW_SS_GLOBAL(SSgarbage)
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/stat_entry(msg)
|
||||
/datum/controller/subsystem/garbage/stat_entry(msg)
|
||||
msg += "Q:[queue.len]|D:[delslasttick]|G:[gcedlasttick]|"
|
||||
msg += "GR:"
|
||||
if (!(delslasttick+gcedlasttick))
|
||||
@@ -52,14 +47,14 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
msg += "TGR:[round((totalgcs/(totaldels+totalgcs))*100, 0.01)]%"
|
||||
..(msg)
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/fire()
|
||||
/datum/controller/subsystem/garbage/fire()
|
||||
HandleToBeQueued()
|
||||
if(state == SS_RUNNING)
|
||||
HandleQueue()
|
||||
|
||||
//If you see this proc high on the profile, what you are really seeing is the garbage collection/soft delete overhead in byond.
|
||||
//Don't attempt to optimize, not worth the effort.
|
||||
/datum/controller/subsystem/garbage_collector/proc/HandleToBeQueued()
|
||||
/datum/controller/subsystem/garbage/proc/HandleToBeQueued()
|
||||
var/list/tobequeued = src.tobequeued
|
||||
var/starttime = world.time
|
||||
var/starttimeofday = world.timeofday
|
||||
@@ -70,7 +65,7 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
Queue(ref)
|
||||
tobequeued.Cut(1, 2)
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/proc/HandleQueue()
|
||||
/datum/controller/subsystem/garbage/proc/HandleQueue()
|
||||
delslasttick = 0
|
||||
gcedlasttick = 0
|
||||
var/time_to_kill = world.time - collection_timeout // Anything qdel() but not GC'd BEFORE this time needs to be manually del()
|
||||
@@ -124,12 +119,12 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
++gcedlasttick
|
||||
++totalgcs
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/proc/QueueForQueuing(datum/A)
|
||||
/datum/controller/subsystem/garbage/proc/QueueForQueuing(datum/A)
|
||||
if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
|
||||
tobequeued += A
|
||||
A.gc_destroyed = GC_QUEUED_FOR_QUEUING
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/proc/Queue(datum/A)
|
||||
/datum/controller/subsystem/garbage/proc/Queue(datum/A)
|
||||
if (!istype(A) || (!isnull(A.gc_destroyed) && A.gc_destroyed >= 0))
|
||||
return
|
||||
if (A.gc_destroyed == GC_QUEUED_FOR_HARD_DEL)
|
||||
@@ -145,12 +140,12 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
|
||||
queue[refid] = gctime
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/proc/HardQueue(datum/A)
|
||||
/datum/controller/subsystem/garbage/proc/HardQueue(datum/A)
|
||||
if (istype(A) && A.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)
|
||||
tobequeued += A
|
||||
A.gc_destroyed = GC_QUEUED_FOR_HARD_DEL
|
||||
|
||||
/datum/controller/subsystem/garbage_collector/Recover()
|
||||
/datum/controller/subsystem/garbage/Recover()
|
||||
if (istype(SSgarbage.queue))
|
||||
queue |= SSgarbage.queue
|
||||
if (istype(SSgarbage.tobequeued))
|
||||
@@ -264,7 +259,7 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
|
||||
testing("Beginning search for references to a [type].")
|
||||
last_find_references = world.time
|
||||
find_references_in_globals()
|
||||
DoSearchVar(GLOB)
|
||||
for(var/datum/thing in world)
|
||||
DoSearchVar(thing, "WorldRef: [thing]")
|
||||
testing("Completed search for references to a [type].")
|
||||
@@ -314,8 +309,6 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
|
||||
usr << browse(dat, "window=qdeletedlog")
|
||||
|
||||
#define SearchVar(X) DoSearchVar(X, "Global: " + #X)
|
||||
|
||||
/datum/proc/DoSearchVar(X, Xname)
|
||||
if(usr && usr.client && !usr.client.running_find_references) return
|
||||
if(istype(X, /datum))
|
||||
@@ -347,692 +340,4 @@ var/datum/controller/subsystem/garbage_collector/SSgarbage
|
||||
CHECK_TICK
|
||||
#endif
|
||||
|
||||
//if find_references isn't working for some datum
|
||||
//update this list using tools/DMTreeToGlobalsList
|
||||
/datum/proc/find_references_in_globals()
|
||||
SearchVar(clockwork_construction_value)
|
||||
SearchVar(clockwork_caches)
|
||||
SearchVar(clockwork_daemons)
|
||||
SearchVar(clockwork_generals_invoked)
|
||||
SearchVar(all_clockwork_objects)
|
||||
SearchVar(all_clockwork_mobs)
|
||||
SearchVar(clockwork_component_cache)
|
||||
SearchVar(ratvar_awakens)
|
||||
SearchVar(clockwork_gateway_activated)
|
||||
SearchVar(all_scripture)
|
||||
SearchVar(pointed_types)
|
||||
SearchVar(bloody_footprints_cache)
|
||||
SearchVar(ghost_accs_options)
|
||||
SearchVar(ghost_others_options)
|
||||
SearchVar(special_roles)
|
||||
SearchVar(string_cache)
|
||||
SearchVar(string_filename_current_key)
|
||||
SearchVar(cmp_field)
|
||||
SearchVar(friendly_animal_types)
|
||||
SearchVar(humanoid_icon_cache)
|
||||
SearchVar(freeze_item_icons)
|
||||
SearchVar(E)
|
||||
SearchVar(Sqrt2)
|
||||
SearchVar(sqrtTable)
|
||||
SearchVar(gaussian_next)
|
||||
SearchVar(skin_tones)
|
||||
SearchVar(species_list)
|
||||
SearchVar(roundstart_species)
|
||||
SearchVar(church_name)
|
||||
SearchVar(command_name)
|
||||
SearchVar(religion_name)
|
||||
SearchVar(syndicate_name)
|
||||
SearchVar(syndicate_code_phrase)
|
||||
SearchVar(syndicate_code_response)
|
||||
SearchVar(zero_character_only)
|
||||
SearchVar(hex_characters)
|
||||
SearchVar(alphabet)
|
||||
SearchVar(binary)
|
||||
SearchVar(can_embed_types)
|
||||
SearchVar(WALLITEMS)
|
||||
SearchVar(WALLITEMS_EXTERNAL)
|
||||
SearchVar(WALLITEMS_INVERSE)
|
||||
SearchVar(sortInstance)
|
||||
SearchVar(config)
|
||||
SearchVar(host)
|
||||
SearchVar(join_motd)
|
||||
SearchVar(station_name)
|
||||
SearchVar(game_version)
|
||||
SearchVar(changelog_hash)
|
||||
SearchVar(ooc_allowed)
|
||||
SearchVar(dooc_allowed)
|
||||
SearchVar(abandon_allowed)
|
||||
SearchVar(enter_allowed)
|
||||
SearchVar(guests_allowed)
|
||||
SearchVar(shuttle_frozen)
|
||||
SearchVar(shuttle_left)
|
||||
SearchVar(tinted_weldhelh)
|
||||
SearchVar(Debug)
|
||||
SearchVar(Debug2)
|
||||
SearchVar(comms_key)
|
||||
SearchVar(comms_allowed)
|
||||
SearchVar(medal_hub)
|
||||
SearchVar(medal_pass)
|
||||
SearchVar(medals_enabled)
|
||||
SearchVar(MAX_EX_DEVESTATION_RANGE)
|
||||
SearchVar(MAX_EX_HEAVY_RANGE)
|
||||
SearchVar(MAX_EX_LIGHT_RANGE)
|
||||
SearchVar(MAX_EX_FLASH_RANGE)
|
||||
SearchVar(MAX_EX_FLAME_RANGE)
|
||||
SearchVar(DYN_EX_SCALE)
|
||||
SearchVar(sqladdress)
|
||||
SearchVar(sqlport)
|
||||
SearchVar(sqlfdbkdb)
|
||||
SearchVar(sqlfdbklogin)
|
||||
SearchVar(sqlfdbkpass)
|
||||
SearchVar(sqlfdbktableprefix)
|
||||
SearchVar(dbcon)
|
||||
SearchVar(master_mode)
|
||||
SearchVar(secret_force_mode)
|
||||
SearchVar(wavesecret)
|
||||
SearchVar(start_state)
|
||||
SearchVar(NEARSIGHTBLOCK)
|
||||
SearchVar(EPILEPSYBLOCK)
|
||||
SearchVar(COUGHBLOCK)
|
||||
SearchVar(TOURETTESBLOCK)
|
||||
SearchVar(NERVOUSBLOCK)
|
||||
SearchVar(BLINDBLOCK)
|
||||
SearchVar(DEAFBLOCK)
|
||||
SearchVar(HULKBLOCK)
|
||||
SearchVar(TELEBLOCK)
|
||||
SearchVar(FIREBLOCK)
|
||||
SearchVar(XRAYBLOCK)
|
||||
SearchVar(CLUMSYBLOCK)
|
||||
SearchVar(STRANGEBLOCK)
|
||||
SearchVar(RACEBLOCK)
|
||||
SearchVar(bad_se_blocks)
|
||||
SearchVar(good_se_blocks)
|
||||
SearchVar(op_se_blocks)
|
||||
SearchVar(NULLED_SE)
|
||||
SearchVar(NULLED_UI)
|
||||
SearchVar(global_mutations)
|
||||
SearchVar(bad_mutations)
|
||||
SearchVar(good_mutations)
|
||||
SearchVar(not_good_mutations)
|
||||
SearchVar(diary)
|
||||
SearchVar(diaryofmeanpeople)
|
||||
SearchVar(href_logfile)
|
||||
SearchVar(bombers)
|
||||
SearchVar(admin_log)
|
||||
SearchVar(lastsignalers)
|
||||
SearchVar(lawchanges)
|
||||
SearchVar(combatlog)
|
||||
SearchVar(IClog)
|
||||
SearchVar(OOClog)
|
||||
SearchVar(adminlog)
|
||||
SearchVar(active_turfs_startlist)
|
||||
SearchVar(admin_notice)
|
||||
SearchVar(timezoneOffset)
|
||||
SearchVar(fileaccess_timer)
|
||||
SearchVar(TAB)
|
||||
SearchVar(data_core)
|
||||
SearchVar(CELLRATE)
|
||||
SearchVar(CHARGELEVEL)
|
||||
SearchVar(powernets)
|
||||
SearchVar(hair_styles_list)
|
||||
SearchVar(hair_styles_male_list)
|
||||
SearchVar(hair_styles_female_list)
|
||||
SearchVar(facial_hair_styles_list)
|
||||
SearchVar(facial_hair_styles_male_list)
|
||||
SearchVar(facial_hair_styles_female_list)
|
||||
SearchVar(underwear_list)
|
||||
SearchVar(underwear_m)
|
||||
SearchVar(underwear_f)
|
||||
SearchVar(undershirt_list)
|
||||
SearchVar(undershirt_m)
|
||||
SearchVar(undershirt_f)
|
||||
SearchVar(socks_list)
|
||||
SearchVar(body_markings_list)
|
||||
SearchVar(tails_list_lizard)
|
||||
SearchVar(animated_tails_list_lizard)
|
||||
SearchVar(snouts_list)
|
||||
SearchVar(horns_list)
|
||||
SearchVar(frills_list)
|
||||
SearchVar(spines_list)
|
||||
SearchVar(legs_list)
|
||||
SearchVar(animated_spines_list)
|
||||
SearchVar(tails_list_human)
|
||||
SearchVar(animated_tails_list_human)
|
||||
SearchVar(ears_list)
|
||||
SearchVar(wings_list)
|
||||
SearchVar(wings_open_list)
|
||||
SearchVar(r_wings_list)
|
||||
SearchVar(ghost_forms_with_directions_list)
|
||||
SearchVar(ghost_forms_with_accessories_list)
|
||||
SearchVar(security_depts_prefs)
|
||||
SearchVar(backbaglist)
|
||||
SearchVar(uplink_spawn_loc_list)
|
||||
SearchVar(female_clothing_icons)
|
||||
SearchVar(hit_appends)
|
||||
SearchVar(scarySounds)
|
||||
SearchVar(TAGGERLOCATIONS)
|
||||
SearchVar(guitar_notes)
|
||||
SearchVar(station_prefixes)
|
||||
SearchVar(station_names)
|
||||
SearchVar(station_suffixes)
|
||||
SearchVar(greek_letters)
|
||||
SearchVar(phonetic_alphabet)
|
||||
SearchVar(numbers_as_words)
|
||||
SearchVar(station_numerals)
|
||||
SearchVar(cardinal)
|
||||
SearchVar(alldirs)
|
||||
SearchVar(diagonals)
|
||||
SearchVar(accessable_z_levels)
|
||||
SearchVar(global_map)
|
||||
SearchVar(landmarks_list)
|
||||
SearchVar(start_landmarks_list)
|
||||
SearchVar(department_security_spawns)
|
||||
SearchVar(generic_event_spawns)
|
||||
SearchVar(monkeystart)
|
||||
SearchVar(wizardstart)
|
||||
SearchVar(newplayer_start)
|
||||
SearchVar(latejoin)
|
||||
SearchVar(prisonwarp)
|
||||
SearchVar(holdingfacility)
|
||||
SearchVar(xeno_spawn)
|
||||
SearchVar(tdome1)
|
||||
SearchVar(tdome2)
|
||||
SearchVar(tdomeobserve)
|
||||
SearchVar(tdomeadmin)
|
||||
SearchVar(prisonsecuritywarp)
|
||||
SearchVar(prisonwarped)
|
||||
SearchVar(blobstart)
|
||||
SearchVar(secequipment)
|
||||
SearchVar(deathsquadspawn)
|
||||
SearchVar(emergencyresponseteamspawn)
|
||||
SearchVar(ruin_landmarks)
|
||||
SearchVar(awaydestinations)
|
||||
SearchVar(sortedAreas)
|
||||
SearchVar(transit_markers)
|
||||
SearchVar(clients)
|
||||
SearchVar(admins)
|
||||
SearchVar(deadmins)
|
||||
SearchVar(directory)
|
||||
SearchVar(stealthminID)
|
||||
SearchVar(player_list)
|
||||
SearchVar(mob_list)
|
||||
SearchVar(living_mob_list)
|
||||
SearchVar(dead_mob_list)
|
||||
SearchVar(joined_player_list)
|
||||
SearchVar(silicon_mobs)
|
||||
SearchVar(pai_list)
|
||||
SearchVar(ai_names)
|
||||
SearchVar(wizard_first)
|
||||
SearchVar(wizard_second)
|
||||
SearchVar(ninja_titles)
|
||||
SearchVar(ninja_names)
|
||||
SearchVar(commando_names)
|
||||
SearchVar(first_names_male)
|
||||
SearchVar(first_names_female)
|
||||
SearchVar(last_names)
|
||||
SearchVar(lizard_names_male)
|
||||
SearchVar(lizard_names_female)
|
||||
SearchVar(clown_names)
|
||||
SearchVar(mime_names)
|
||||
SearchVar(carp_names)
|
||||
SearchVar(golem_names)
|
||||
SearchVar(plasmaman_names)
|
||||
SearchVar(verbs)
|
||||
SearchVar(adjectives)
|
||||
SearchVar(cable_list)
|
||||
SearchVar(portals)
|
||||
SearchVar(airlocks)
|
||||
SearchVar(mechas_list)
|
||||
SearchVar(shuttle_caller_list)
|
||||
SearchVar(machines)
|
||||
SearchVar(syndicate_shuttle_boards)
|
||||
SearchVar(navbeacons)
|
||||
SearchVar(teleportbeacons)
|
||||
SearchVar(deliverybeacons)
|
||||
SearchVar(deliverybeacontags)
|
||||
SearchVar(nuke_list)
|
||||
SearchVar(alarmdisplay)
|
||||
SearchVar(chemical_reactions_list)
|
||||
SearchVar(chemical_reagents_list)
|
||||
SearchVar(materials_list)
|
||||
SearchVar(tech_list)
|
||||
SearchVar(surgeries_list)
|
||||
SearchVar(crafting_recipes)
|
||||
SearchVar(rcd_list)
|
||||
SearchVar(apcs_list)
|
||||
SearchVar(tracked_implants)
|
||||
SearchVar(tracked_chem_implants)
|
||||
SearchVar(poi_list)
|
||||
SearchVar(pinpointer_list)
|
||||
SearchVar(zombie_infection_list)
|
||||
SearchVar(meteor_list)
|
||||
SearchVar(poll_ignore)
|
||||
SearchVar(typecache_mob)
|
||||
SearchVar(tk_maxrange)
|
||||
SearchVar(Failsafe)
|
||||
SearchVar(Master)
|
||||
SearchVar(MC_restart_clear)
|
||||
SearchVar(MC_restart_timeout)
|
||||
SearchVar(MC_restart_count)
|
||||
SearchVar(CURRENT_TICKLIMIT)
|
||||
SearchVar(SSacid)
|
||||
SearchVar(SSair)
|
||||
SearchVar(SSasset)
|
||||
SearchVar(SSaugury)
|
||||
SearchVar(SScommunications)
|
||||
SearchVar(SSdisease)
|
||||
SearchVar(SSevent)
|
||||
SearchVar(SSfire_burning)
|
||||
SearchVar(SSgarbage)
|
||||
SearchVar(SSicon_smooth)
|
||||
SearchVar(SSipintel)
|
||||
SearchVar(SSjob)
|
||||
SearchVar(SSlighting)
|
||||
SearchVar(SSmachine)
|
||||
SearchVar(SSmapping)
|
||||
SearchVar(SSminimap)
|
||||
SearchVar(SSmob)
|
||||
SearchVar(SSnpc)
|
||||
SearchVar(SSorbit)
|
||||
SearchVar(SSpai)
|
||||
SearchVar(pai_card_list)
|
||||
SearchVar(SSparallax)
|
||||
SearchVar(SSpersistence)
|
||||
SearchVar(SSping)
|
||||
SearchVar(SSradio)
|
||||
SearchVar(SSreligion)
|
||||
SearchVar(SSserver)
|
||||
SearchVar(SSshuttle)
|
||||
SearchVar(SSspacedrift)
|
||||
SearchVar(SSsqueak)
|
||||
SearchVar(SSstickyban)
|
||||
SearchVar(SSsun)
|
||||
SearchVar(SStgui)
|
||||
SearchVar(SSthrowing)
|
||||
SearchVar(round_start_time)
|
||||
SearchVar(ticker)
|
||||
SearchVar(SStimer)
|
||||
SearchVar(SSvote)
|
||||
SearchVar(SSweather)
|
||||
SearchVar(SSfastprocess)
|
||||
SearchVar(SSflightpacks)
|
||||
SearchVar(SSobj)
|
||||
SearchVar(SSprocessing)
|
||||
SearchVar(record_id_num)
|
||||
SearchVar(emote_list)
|
||||
SearchVar(huds)
|
||||
SearchVar(diseases)
|
||||
SearchVar(archive_diseases)
|
||||
SearchVar(advance_cures)
|
||||
SearchVar(list_symptoms)
|
||||
SearchVar(dictionary_symptoms)
|
||||
SearchVar(SYMPTOM_ACTIVATION_PROB)
|
||||
SearchVar(revdata)
|
||||
SearchVar(all_status_effects)
|
||||
SearchVar(wire_colors)
|
||||
SearchVar(wire_color_directory)
|
||||
SearchVar(wire_name_directory)
|
||||
SearchVar(blood_splatter_icons)
|
||||
SearchVar(all_radios)
|
||||
SearchVar(radiochannels)
|
||||
SearchVar(radiochannelsreverse)
|
||||
SearchVar(SYND_FREQ)
|
||||
SearchVar(SUPP_FREQ)
|
||||
SearchVar(SERV_FREQ)
|
||||
SearchVar(SCI_FREQ)
|
||||
SearchVar(COMM_FREQ)
|
||||
SearchVar(MED_FREQ)
|
||||
SearchVar(ENG_FREQ)
|
||||
SearchVar(SEC_FREQ)
|
||||
SearchVar(CENTCOM_FREQ)
|
||||
SearchVar(AIPRIV_FREQ)
|
||||
SearchVar(RADIO_TO_AIRALARM)
|
||||
SearchVar(RADIO_FROM_AIRALARM)
|
||||
SearchVar(RADIO_CHAT)
|
||||
SearchVar(RADIO_ATMOSIA)
|
||||
SearchVar(RADIO_NAVBEACONS)
|
||||
SearchVar(RADIO_AIRLOCK)
|
||||
SearchVar(RADIO_MAGNETS)
|
||||
SearchVar(pointers)
|
||||
SearchVar(freqtospan)
|
||||
SearchVar(teleportlocs)
|
||||
SearchVar(the_station_areas)
|
||||
SearchVar(possible_items)
|
||||
SearchVar(possible_items_special)
|
||||
SearchVar(blobs)
|
||||
SearchVar(blob_cores)
|
||||
SearchVar(overminds)
|
||||
SearchVar(blob_nodes)
|
||||
SearchVar(blobs_legit)
|
||||
SearchVar(possible_changeling_IDs)
|
||||
SearchVar(slots)
|
||||
SearchVar(slot2slot)
|
||||
SearchVar(slot2type)
|
||||
SearchVar(hivemind_bank)
|
||||
SearchVar(blacklisted_pylon_turfs)
|
||||
SearchVar(non_revealed_runes)
|
||||
SearchVar(teleport_runes)
|
||||
SearchVar(wall_runes)
|
||||
SearchVar(whiteness)
|
||||
SearchVar(allDevils)
|
||||
SearchVar(lawlorify)
|
||||
SearchVar(gang_name_pool)
|
||||
SearchVar(gang_colors_pool)
|
||||
SearchVar(borers)
|
||||
SearchVar(total_borer_hosts_needed)
|
||||
SearchVar(bomb_set)
|
||||
SearchVar(hsboxspawn)
|
||||
SearchVar(multiverse)
|
||||
SearchVar(announcement_systems)
|
||||
SearchVar(doppler_arrays)
|
||||
SearchVar(HOLOPAD_MODE)
|
||||
SearchVar(holopads)
|
||||
SearchVar(news_network)
|
||||
SearchVar(allCasters)
|
||||
SearchVar(SAFETY_COOLDOWN)
|
||||
SearchVar(req_console_assistance)
|
||||
SearchVar(req_console_supplies)
|
||||
SearchVar(req_console_information)
|
||||
SearchVar(allConsoles)
|
||||
SearchVar(time_last_changed_position)
|
||||
SearchVar(CALL_SHUTTLE_REASON_LENGTH)
|
||||
SearchVar(crewmonitor)
|
||||
SearchVar(possible_uplinker_IDs)
|
||||
SearchVar(airlock_overlays)
|
||||
SearchVar(pipeID2State)
|
||||
SearchVar(telecomms_list)
|
||||
SearchVar(recentmessages)
|
||||
SearchVar(message_delay)
|
||||
SearchVar(year)
|
||||
SearchVar(year_integer)
|
||||
SearchVar(explosionid)
|
||||
SearchVar(fire_overlay)
|
||||
SearchVar(acid_overlay)
|
||||
SearchVar(BUMP_TELEPORTERS)
|
||||
SearchVar(blacklisted_glowshroom_turfs)
|
||||
SearchVar(PDAs)
|
||||
SearchVar(rod_recipes)
|
||||
SearchVar(glass_recipes)
|
||||
SearchVar(reinforced_glass_recipes)
|
||||
SearchVar(human_recipes)
|
||||
SearchVar(corgi_recipes)
|
||||
SearchVar(monkey_recipes)
|
||||
SearchVar(xeno_recipes)
|
||||
SearchVar(sinew_recipes)
|
||||
SearchVar(sandstone_recipes)
|
||||
SearchVar(sandbag_recipes)
|
||||
SearchVar(diamond_recipes)
|
||||
SearchVar(uranium_recipes)
|
||||
SearchVar(plasma_recipes)
|
||||
SearchVar(gold_recipes)
|
||||
SearchVar(silver_recipes)
|
||||
SearchVar(clown_recipes)
|
||||
SearchVar(titanium_recipes)
|
||||
SearchVar(plastitanium_recipes)
|
||||
SearchVar(snow_recipes)
|
||||
SearchVar(abductor_recipes)
|
||||
SearchVar(metal_recipes)
|
||||
SearchVar(plasteel_recipes)
|
||||
SearchVar(wood_recipes)
|
||||
SearchVar(cloth_recipes)
|
||||
SearchVar(cardboard_recipes)
|
||||
SearchVar(runed_metal_recipes)
|
||||
SearchVar(brass_recipes)
|
||||
SearchVar(disposalpipeID2State)
|
||||
SearchVar(RPD_recipes)
|
||||
SearchVar(biblenames)
|
||||
SearchVar(biblestates)
|
||||
SearchVar(bibleitemstates)
|
||||
SearchVar(globalBlankCanvases)
|
||||
SearchVar(crematoriums)
|
||||
SearchVar(icons_to_ignore_at_floor_init)
|
||||
SearchVar(js_byjax)
|
||||
SearchVar(js_dropdowns)
|
||||
SearchVar(BSACooldown)
|
||||
SearchVar(admin_ranks)
|
||||
SearchVar(admin_verbs_default)
|
||||
SearchVar(admin_verbs_admin)
|
||||
SearchVar(admin_verbs_ban)
|
||||
SearchVar(admin_verbs_sounds)
|
||||
SearchVar(admin_verbs_fun)
|
||||
SearchVar(admin_verbs_spawn)
|
||||
SearchVar(admin_verbs_server)
|
||||
SearchVar(admin_verbs_debug)
|
||||
SearchVar(admin_verbs_possess)
|
||||
SearchVar(admin_verbs_permissions)
|
||||
SearchVar(admin_verbs_rejuv)
|
||||
SearchVar(admin_verbs_hideable)
|
||||
SearchVar(create_object_html)
|
||||
SearchVar(create_object_forms)
|
||||
SearchVar(admin_datums)
|
||||
SearchVar(CMinutes)
|
||||
SearchVar(Banlist)
|
||||
SearchVar(whitelist)
|
||||
SearchVar(TYPES_SHORTCUTS)
|
||||
SearchVar(intercom_range_display_status)
|
||||
SearchVar(admin_verbs_debug_mapping)
|
||||
SearchVar(say_disabled)
|
||||
SearchVar(VVlocked)
|
||||
SearchVar(VVicon_edit_lock)
|
||||
SearchVar(VVckey_edit)
|
||||
SearchVar(VVpixelmovement)
|
||||
SearchVar(highlander)
|
||||
SearchVar(admin_sound)
|
||||
SearchVar(custom_outfits)
|
||||
SearchVar(meta_gas_info)
|
||||
SearchVar(gaslist_cache)
|
||||
SearchVar(hardcoded_gases)
|
||||
SearchVar(pipenetwarnings)
|
||||
SearchVar(the_gateway)
|
||||
SearchVar(potentialRandomZlevels)
|
||||
SearchVar(use_preloader)
|
||||
SearchVar(_preloader)
|
||||
SearchVar(swapmaps_iconcache)
|
||||
SearchVar(SWAPMAPS_SAV)
|
||||
SearchVar(SWAPMAPS_TEXT)
|
||||
SearchVar(swapmaps_mode)
|
||||
SearchVar(swapmaps_compiled_maxx)
|
||||
SearchVar(swapmaps_compiled_maxy)
|
||||
SearchVar(swapmaps_compiled_maxz)
|
||||
SearchVar(swapmaps_initialized)
|
||||
SearchVar(swapmaps_loaded)
|
||||
SearchVar(swapmaps_byname)
|
||||
SearchVar(sc_safecode1)
|
||||
SearchVar(sc_safecode2)
|
||||
SearchVar(sc_safecode3)
|
||||
SearchVar(sc_safecode4)
|
||||
SearchVar(sc_safecode5)
|
||||
SearchVar(exports_list)
|
||||
SearchVar(clientmessages)
|
||||
SearchVar(preferences_datums)
|
||||
SearchVar(ghost_forms)
|
||||
SearchVar(ghost_orbits)
|
||||
SearchVar(normal_ooc_colour)
|
||||
SearchVar(damaged_clothes_icons)
|
||||
SearchVar(emojis)
|
||||
SearchVar(non_fakeattack_weapons)
|
||||
SearchVar(cards_against_space)
|
||||
SearchVar(chem_t1_reagents)
|
||||
SearchVar(chem_t2_reagents)
|
||||
SearchVar(chem_t3_reagents)
|
||||
SearchVar(chem_t4_reagents)
|
||||
SearchVar(ENGSEC)
|
||||
SearchVar(CAPTAIN)
|
||||
SearchVar(HOS)
|
||||
SearchVar(WARDEN)
|
||||
SearchVar(DETECTIVE)
|
||||
SearchVar(OFFICER)
|
||||
SearchVar(CHIEF)
|
||||
SearchVar(ENGINEER)
|
||||
SearchVar(ATMOSTECH)
|
||||
SearchVar(ROBOTICIST)
|
||||
SearchVar(AI)
|
||||
SearchVar(CYBORG)
|
||||
SearchVar(MEDSCI)
|
||||
SearchVar(RD)
|
||||
SearchVar(SCIENTIST)
|
||||
SearchVar(CHEMIST)
|
||||
SearchVar(CMO)
|
||||
SearchVar(DOCTOR)
|
||||
SearchVar(GENETICIST)
|
||||
SearchVar(VIROLOGIST)
|
||||
SearchVar(CIVILIAN)
|
||||
SearchVar(HOP)
|
||||
SearchVar(BARTENDER)
|
||||
SearchVar(BOTANIST)
|
||||
SearchVar(COOK)
|
||||
SearchVar(JANITOR)
|
||||
SearchVar(LIBRARIAN)
|
||||
SearchVar(QUARTERMASTER)
|
||||
SearchVar(CARGOTECH)
|
||||
SearchVar(MINER)
|
||||
SearchVar(LAWYER)
|
||||
SearchVar(CHAPLAIN)
|
||||
SearchVar(CLOWN)
|
||||
SearchVar(MIME)
|
||||
SearchVar(ASSISTANT)
|
||||
SearchVar(assistant_occupations)
|
||||
SearchVar(command_positions)
|
||||
SearchVar(engineering_positions)
|
||||
SearchVar(medical_positions)
|
||||
SearchVar(science_positions)
|
||||
SearchVar(supply_positions)
|
||||
SearchVar(civilian_positions)
|
||||
SearchVar(security_positions)
|
||||
SearchVar(nonhuman_positions)
|
||||
SearchVar(cap_expand)
|
||||
SearchVar(cmo_expand)
|
||||
SearchVar(hos_expand)
|
||||
SearchVar(hop_expand)
|
||||
SearchVar(rd_expand)
|
||||
SearchVar(ce_expand)
|
||||
SearchVar(qm_expand)
|
||||
SearchVar(sec_expand)
|
||||
SearchVar(engi_expand)
|
||||
SearchVar(atmos_expand)
|
||||
SearchVar(doc_expand)
|
||||
SearchVar(mine_expand)
|
||||
SearchVar(chef_expand)
|
||||
SearchVar(borg_expand)
|
||||
SearchVar(available_depts)
|
||||
SearchVar(cachedbooks)
|
||||
SearchVar(total_extraction_beacons)
|
||||
SearchVar(next_mob_id)
|
||||
SearchVar(firstname)
|
||||
SearchVar(ghost_darkness_images)
|
||||
SearchVar(ghost_images_full)
|
||||
SearchVar(ghost_images_default)
|
||||
SearchVar(ghost_images_simple)
|
||||
SearchVar(department_radio_keys)
|
||||
SearchVar(crit_allowed_modes)
|
||||
SearchVar(ventcrawl_machinery)
|
||||
SearchVar(posibrain_notif_cooldown)
|
||||
SearchVar(NO_SLIP_WHEN_WALKING)
|
||||
SearchVar(SLIDE)
|
||||
SearchVar(GALOSHES_DONT_HELP)
|
||||
SearchVar(SLIDE_ICE)
|
||||
SearchVar(limb_icon_cache)
|
||||
SearchVar(MIN_IMPREGNATION_TIME)
|
||||
SearchVar(MAX_IMPREGNATION_TIME)
|
||||
SearchVar(MIN_ACTIVE_TIME)
|
||||
SearchVar(MAX_ACTIVE_TIME)
|
||||
SearchVar(default_martial_art)
|
||||
SearchVar(plasmaman_on_fire)
|
||||
SearchVar(ai_list)
|
||||
SearchVar(announcing_vox)
|
||||
SearchVar(VOX_CHANNEL)
|
||||
SearchVar(VOX_DELAY)
|
||||
SearchVar(vox_sounds)
|
||||
SearchVar(CHUNK_SIZE)
|
||||
SearchVar(cameranet)
|
||||
SearchVar(mulebot_count)
|
||||
SearchVar(MAX_CHICKENS)
|
||||
SearchVar(chicken_count)
|
||||
SearchVar(parasites)
|
||||
SearchVar(protected_objects)
|
||||
SearchVar(AISwarmers)
|
||||
SearchVar(AISwarmersByType)
|
||||
SearchVar(AISwarmerCapsByType)
|
||||
SearchVar(slime_colours)
|
||||
SearchVar(global_modular_computers)
|
||||
SearchVar(file_uid)
|
||||
SearchVar(nttransfer_uid)
|
||||
SearchVar(ntnet_card_uid)
|
||||
SearchVar(ntnet_global)
|
||||
SearchVar(ntnrc_uid)
|
||||
SearchVar(employmentCabinets)
|
||||
SearchVar(cable_coil_recipes)
|
||||
SearchVar(gravity_generators)
|
||||
SearchVar(POWER_IDLE)
|
||||
SearchVar(POWER_UP)
|
||||
SearchVar(POWER_DOWN)
|
||||
SearchVar(GRAV_NEEDS_SCREWDRIVER)
|
||||
SearchVar(GRAV_NEEDS_WELDING)
|
||||
SearchVar(GRAV_NEEDS_PLASTEEL)
|
||||
SearchVar(GRAV_NEEDS_WRENCH)
|
||||
SearchVar(rad_collectors)
|
||||
SearchVar(blacklisted_tesla_types)
|
||||
SearchVar(TOUCH)
|
||||
SearchVar(INGEST)
|
||||
SearchVar(VAPOR)
|
||||
SearchVar(PATCH)
|
||||
SearchVar(INJECT)
|
||||
SearchVar(chemical_mob_spawn_meancritters)
|
||||
SearchVar(chemical_mob_spawn_nicecritters)
|
||||
SearchVar(message_servers)
|
||||
SearchVar(blackbox)
|
||||
SearchVar(keycard_events)
|
||||
SearchVar(blacklisted_cargo_types)
|
||||
SearchVar(z_levels_list)
|
||||
SearchVar(spells)
|
||||
SearchVar(non_simple_animals)
|
||||
SearchVar(FrozenAccounts)
|
||||
SearchVar(stockExchange)
|
||||
SearchVar(stun_words)
|
||||
SearchVar(weaken_words)
|
||||
SearchVar(sleep_words)
|
||||
SearchVar(vomit_words)
|
||||
SearchVar(silence_words)
|
||||
SearchVar(hallucinate_words)
|
||||
SearchVar(wakeup_words)
|
||||
SearchVar(heal_words)
|
||||
SearchVar(hurt_words)
|
||||
SearchVar(bleed_words)
|
||||
SearchVar(burn_words)
|
||||
SearchVar(hot_words)
|
||||
SearchVar(cold_words)
|
||||
SearchVar(repulse_words)
|
||||
SearchVar(attract_words)
|
||||
SearchVar(whoareyou_words)
|
||||
SearchVar(saymyname_words)
|
||||
SearchVar(knockknock_words)
|
||||
SearchVar(statelaws_words)
|
||||
SearchVar(move_words)
|
||||
SearchVar(left_words)
|
||||
SearchVar(right_words)
|
||||
SearchVar(up_words)
|
||||
SearchVar(down_words)
|
||||
SearchVar(walk_words)
|
||||
SearchVar(run_words)
|
||||
SearchVar(helpintent_words)
|
||||
SearchVar(disarmintent_words)
|
||||
SearchVar(grabintent_words)
|
||||
SearchVar(harmintent_words)
|
||||
SearchVar(throwmode_words)
|
||||
SearchVar(flip_words)
|
||||
SearchVar(speak_words)
|
||||
SearchVar(rest_words)
|
||||
SearchVar(getup_words)
|
||||
SearchVar(sit_words)
|
||||
SearchVar(stand_words)
|
||||
SearchVar(dance_words)
|
||||
SearchVar(jump_words)
|
||||
SearchVar(salute_words)
|
||||
SearchVar(deathgasp_words)
|
||||
SearchVar(clap_words)
|
||||
SearchVar(honk_words)
|
||||
SearchVar(multispin_words)
|
||||
SearchVar(GPS_list)
|
||||
SearchVar(uplinks)
|
||||
SearchVar(uplink_items)
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/icon_smooth/SSicon_smooth
|
||||
|
||||
/datum/controller/subsystem/icon_smooth
|
||||
SUBSYSTEM_DEF(icon_smooth)
|
||||
name = "Icon Smoothing"
|
||||
init_order = -5
|
||||
wait = 1
|
||||
@@ -9,9 +7,6 @@ var/datum/controller/subsystem/icon_smooth/SSicon_smooth
|
||||
|
||||
var/list/smooth_queue = list()
|
||||
|
||||
/datum/controller/subsystem/icon_smooth/New()
|
||||
NEW_SS_GLOBAL(SSicon_smooth)
|
||||
|
||||
/datum/controller/subsystem/icon_smooth/fire()
|
||||
while(smooth_queue.len)
|
||||
var/atom/A = smooth_queue[smooth_queue.len]
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
var/datum/controller/subsystem/inbounds/SSinbounds
|
||||
/datum/controller/subsystem/inbounds
|
||||
SUBSYSTEM_DEF(inbounds)
|
||||
name = "Inbounds"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT
|
||||
@@ -7,8 +6,6 @@ var/datum/controller/subsystem/inbounds/SSinbounds
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/inbounds/New()
|
||||
NEW_SS_GLOBAL(SSinbounds)
|
||||
/datum/controller/subsystem/inbounds/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/ipintel/SSipintel
|
||||
|
||||
/datum/controller/subsystem/ipintel
|
||||
SUBSYSTEM_DEF(ipintel)
|
||||
name = "XKeyScore"
|
||||
init_order = -10
|
||||
flags = SS_NO_FIRE
|
||||
@@ -10,9 +8,6 @@ var/datum/controller/subsystem/ipintel/SSipintel
|
||||
|
||||
var/list/cache = list()
|
||||
|
||||
/datum/controller/subsystem/ipintel/New()
|
||||
NEW_SS_GLOBAL(SSipintel)
|
||||
|
||||
/datum/controller/subsystem/ipintel/Initialize(timeofday, zlevel)
|
||||
enabled = 1
|
||||
. = ..()
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/job/SSjob
|
||||
|
||||
/datum/controller/subsystem/job
|
||||
SUBSYSTEM_DEF(job)
|
||||
name = "Jobs"
|
||||
init_order = 14
|
||||
flags = SS_NO_FIRE
|
||||
@@ -14,10 +12,6 @@ var/datum/controller/subsystem/job/SSjob
|
||||
|
||||
var/list/prioritized_jobs = list()
|
||||
|
||||
/datum/controller/subsystem/job/New()
|
||||
NEW_SS_GLOBAL(SSjob)
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/Initialize(timeofday)
|
||||
if(!occupations.len)
|
||||
SetupOccupations()
|
||||
@@ -52,7 +46,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/Debug(text)
|
||||
if(!Debug2)
|
||||
if(!GLOB.Debug2)
|
||||
return 0
|
||||
job_debug.Add(text)
|
||||
return 1
|
||||
@@ -116,6 +110,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
|
||||
/datum/controller/subsystem/job/proc/GiveRandomJob(mob/dead/new_player/player)
|
||||
Debug("GRJ Giving random job, Player: [player]")
|
||||
. = FALSE
|
||||
for(var/datum/job/job in shuffle(occupations))
|
||||
if(!job)
|
||||
continue
|
||||
@@ -123,7 +118,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
if(istype(job, GetJob("Assistant"))) // We don't want to give him assistant, that's boring!
|
||||
continue
|
||||
|
||||
if(job.title in command_positions) //If you want a command position, select it!
|
||||
if(job.title in GLOB.command_positions) //If you want a command position, select it!
|
||||
continue
|
||||
|
||||
if(jobban_isbanned(player, job.title))
|
||||
@@ -145,12 +140,11 @@ var/datum/controller/subsystem/job/SSjob
|
||||
|
||||
if((job.current_positions < job.spawn_positions) || job.spawn_positions == -1)
|
||||
Debug("GRJ Random job given, Player: [player], Job: [job]")
|
||||
AssignRole(player, job.title)
|
||||
unassigned -= player
|
||||
break
|
||||
if(AssignRole(player, job.title))
|
||||
return TRUE
|
||||
|
||||
/datum/controller/subsystem/job/proc/ResetOccupations()
|
||||
for(var/mob/dead/new_player/player in player_list)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if((player) && (player.mind))
|
||||
player.mind.assigned_role = null
|
||||
player.mind.special_role = null
|
||||
@@ -164,7 +158,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
//This is basically to ensure that there's atleast a few heads in the round
|
||||
/datum/controller/subsystem/job/proc/FillHeadPosition()
|
||||
for(var/level = 1 to 3)
|
||||
for(var/command_position in command_positions)
|
||||
for(var/command_position in GLOB.command_positions)
|
||||
var/datum/job/job = GetJob(command_position)
|
||||
if(!job)
|
||||
continue
|
||||
@@ -182,7 +176,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
//This proc is called at the start of the level loop of DivideOccupations() and will cause head jobs to be checked before any other jobs of the same level
|
||||
//This is also to ensure we get as many heads as possible
|
||||
/datum/controller/subsystem/job/proc/CheckHeadPositions(level)
|
||||
for(var/command_position in command_positions)
|
||||
for(var/command_position in GLOB.command_positions)
|
||||
var/datum/job/job = GetJob(command_position)
|
||||
if(!job)
|
||||
continue
|
||||
@@ -193,8 +187,6 @@ var/datum/controller/subsystem/job/SSjob
|
||||
continue
|
||||
var/mob/dead/new_player/candidate = pick(candidates)
|
||||
AssignRole(candidate, command_position)
|
||||
return
|
||||
|
||||
|
||||
/datum/controller/subsystem/job/proc/FillAIPosition()
|
||||
var/ai_selected = 0
|
||||
@@ -223,14 +215,14 @@ var/datum/controller/subsystem/job/SSjob
|
||||
//Setup new player list and get the jobs list
|
||||
Debug("Running DO")
|
||||
|
||||
//Holder for Triumvirate is stored in the ticker, this just processes it
|
||||
if(ticker)
|
||||
//Holder for Triumvirate is stored in the SSticker, this just processes it
|
||||
if(SSticker)
|
||||
for(var/datum/job/ai/A in occupations)
|
||||
if(ticker.triai)
|
||||
if(SSticker.triai)
|
||||
A.spawn_positions = 3
|
||||
|
||||
//Get the players who are ready
|
||||
for(var/mob/dead/new_player/player in player_list)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if(player.ready && player.mind && !player.mind.assigned_role)
|
||||
unassigned += player
|
||||
|
||||
@@ -356,7 +348,8 @@ var/datum/controller/subsystem/job/SSjob
|
||||
RejectPlayer(player)
|
||||
|
||||
for(var/mob/dead/new_player/player in unassigned) //Players that wanted to back out but couldn't because they're antags (can you feel the edge case?)
|
||||
GiveRandomJob(player)
|
||||
if(!GiveRandomJob(player))
|
||||
AssignRole(player, "Assistant") //If everything is already filled, make them an assistant
|
||||
|
||||
return 1
|
||||
|
||||
@@ -377,7 +370,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
//If we joined at roundstart we should be positioned at our workstation
|
||||
if(!joined_late)
|
||||
var/obj/S = null
|
||||
for(var/obj/effect/landmark/start/sloc in start_landmarks_list)
|
||||
for(var/obj/effect/landmark/start/sloc in GLOB.start_landmarks_list)
|
||||
if(sloc.name != rank)
|
||||
S = sloc //so we can revert to spawning them on top of eachother if something goes wrong
|
||||
continue
|
||||
@@ -387,7 +380,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
break
|
||||
if(!S) //if there isn't a spawnpoint send them to latejoin, if there's no latejoin go yell at your mapper
|
||||
log_world("Couldn't find a round start spawn point for [rank]")
|
||||
S = get_turf(pick(latejoin))
|
||||
S = get_turf(pick(GLOB.latejoin))
|
||||
if(!S) //final attempt, lets find some area in the arrivals shuttle to spawn them in to.
|
||||
log_world("Couldn't find a round start latejoin spawn point.")
|
||||
for(var/turf/T in get_area_turfs(/area/shuttle/arrival))
|
||||
@@ -446,10 +439,10 @@ var/datum/controller/subsystem/job/SSjob
|
||||
if(equip_needed < 0) // -1: infinite available slots
|
||||
equip_needed = 12
|
||||
for(var/i=equip_needed-5, i>0, i--)
|
||||
if(secequipment.len)
|
||||
var/spawnloc = secequipment[1]
|
||||
if(GLOB.secequipment.len)
|
||||
var/spawnloc = GLOB.secequipment[1]
|
||||
new /obj/structure/closet/secure_closet/security/sec(spawnloc)
|
||||
secequipment -= spawnloc
|
||||
GLOB.secequipment -= spawnloc
|
||||
else //We ran out of spare locker spawns!
|
||||
break
|
||||
|
||||
@@ -472,7 +465,7 @@ var/datum/controller/subsystem/job/SSjob
|
||||
var/level4 = 0 //never
|
||||
var/level5 = 0 //banned
|
||||
var/level6 = 0 //account too young
|
||||
for(var/mob/dead/new_player/player in player_list)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if(!(player.ready && player.mind && !player.mind.assigned_role))
|
||||
continue //This player is not ready
|
||||
if(jobban_isbanned(player, job.title))
|
||||
@@ -1,11 +1,8 @@
|
||||
var/datum/controller/subsystem/lighting/SSlighting
|
||||
GLOBAL_LIST_EMPTY(lighting_update_lights) // List of lighting sources queued for update.
|
||||
GLOBAL_LIST_EMPTY(lighting_update_corners) // List of lighting corners queued for update.
|
||||
GLOBAL_LIST_EMPTY(lighting_update_objects) // List of lighting objects queued for update.
|
||||
|
||||
var/list/lighting_update_lights = list() // List of lighting sources queued for update.
|
||||
var/list/lighting_update_corners = list() // List of lighting corners queued for update.
|
||||
var/list/lighting_update_objects = list() // List of lighting objects queued for update.
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting
|
||||
SUBSYSTEM_DEF(lighting)
|
||||
name = "Lighting"
|
||||
wait = 2
|
||||
init_order = -20
|
||||
@@ -13,13 +10,8 @@ var/list/lighting_update_objects = list() // List of lighting objects queued fo
|
||||
|
||||
var/initialized = FALSE
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting/New()
|
||||
NEW_SS_GLOBAL(SSlighting)
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting/stat_entry()
|
||||
..("L:[lighting_update_lights.len]|C:[lighting_update_corners.len]|O:[lighting_update_objects.len]")
|
||||
..("L:[GLOB.lighting_update_lights.len]|C:[GLOB.lighting_update_corners.len]|O:[GLOB.lighting_update_objects.len]")
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting/Initialize(timeofday)
|
||||
@@ -30,7 +22,7 @@ var/list/lighting_update_objects = list() // List of lighting objects queued fo
|
||||
|
||||
create_all_lighting_objects()
|
||||
initialized = TRUE
|
||||
|
||||
|
||||
fire(FALSE, TRUE)
|
||||
|
||||
..()
|
||||
@@ -38,11 +30,11 @@ var/list/lighting_update_objects = list() // List of lighting objects queued fo
|
||||
/datum/controller/subsystem/lighting/fire(resumed, init_tick_checks)
|
||||
var/real_tick_limit
|
||||
if(!init_tick_checks)
|
||||
real_tick_limit = CURRENT_TICKLIMIT
|
||||
CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage) / 3) + world.tick_usage
|
||||
real_tick_limit = GLOB.CURRENT_TICKLIMIT
|
||||
GLOB.CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage) / 3) + world.tick_usage
|
||||
var/i = 0
|
||||
for (i in 1 to lighting_update_lights.len)
|
||||
var/datum/light_source/L = lighting_update_lights[i]
|
||||
for (i in 1 to GLOB.lighting_update_lights.len)
|
||||
var/datum/light_source/L = GLOB.lighting_update_lights[i]
|
||||
|
||||
if (L.check() || L.destroyed || L.force_update)
|
||||
L.remove_lum()
|
||||
@@ -55,20 +47,20 @@ var/list/lighting_update_objects = list() // List of lighting objects queued fo
|
||||
L.vis_update = FALSE
|
||||
L.force_update = FALSE
|
||||
L.needs_update = FALSE
|
||||
|
||||
|
||||
if(init_tick_checks)
|
||||
CHECK_TICK
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
lighting_update_lights.Cut(1, i+1)
|
||||
GLOB.lighting_update_lights.Cut(1, i+1)
|
||||
i = 0
|
||||
|
||||
if(!init_tick_checks)
|
||||
CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage)/2)+world.tick_usage
|
||||
GLOB.CURRENT_TICKLIMIT = ((real_tick_limit - world.tick_usage)/2)+world.tick_usage
|
||||
|
||||
for (i in 1 to lighting_update_corners.len)
|
||||
var/datum/lighting_corner/C = lighting_update_corners[i]
|
||||
for (i in 1 to GLOB.lighting_update_corners.len)
|
||||
var/datum/lighting_corner/C = GLOB.lighting_update_corners[i]
|
||||
|
||||
C.update_objects()
|
||||
C.needs_update = FALSE
|
||||
@@ -77,15 +69,15 @@ var/list/lighting_update_objects = list() // List of lighting objects queued fo
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
lighting_update_corners.Cut(1, i+1)
|
||||
GLOB.lighting_update_corners.Cut(1, i+1)
|
||||
i = 0
|
||||
|
||||
|
||||
if(!init_tick_checks)
|
||||
CURRENT_TICKLIMIT = real_tick_limit
|
||||
GLOB.CURRENT_TICKLIMIT = real_tick_limit
|
||||
|
||||
for (i in 1 to lighting_update_objects.len)
|
||||
var/atom/movable/lighting_object/O = lighting_update_objects[i]
|
||||
for (i in 1 to GLOB.lighting_update_objects.len)
|
||||
var/atom/movable/lighting_object/O = GLOB.lighting_update_objects[i]
|
||||
|
||||
if (QDELETED(O))
|
||||
continue
|
||||
@@ -97,9 +89,9 @@ var/list/lighting_update_objects = list() // List of lighting objects queued fo
|
||||
else if (MC_TICK_CHECK)
|
||||
break
|
||||
if (i)
|
||||
lighting_update_objects.Cut(1, i+1)
|
||||
GLOB.lighting_update_objects.Cut(1, i+1)
|
||||
|
||||
|
||||
/datum/controller/subsystem/lighting/Recover()
|
||||
initialized = SSlighting.initialized
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/machines/SSmachine
|
||||
|
||||
/datum/controller/subsystem/machines
|
||||
SUBSYSTEM_DEF(machines)
|
||||
name = "Machines"
|
||||
init_order = 9
|
||||
flags = SS_KEEP_TIMING
|
||||
@@ -8,7 +6,6 @@ var/datum/controller/subsystem/machines/SSmachine
|
||||
var/list/currentrun = list()
|
||||
var/list/powernets = list()
|
||||
|
||||
|
||||
/datum/controller/subsystem/machines/Initialize()
|
||||
makepowernets()
|
||||
fire()
|
||||
@@ -19,16 +16,12 @@ var/datum/controller/subsystem/machines/SSmachine
|
||||
qdel(PN)
|
||||
powernets.Cut()
|
||||
|
||||
for(var/obj/structure/cable/PC in cable_list)
|
||||
for(var/obj/structure/cable/PC in GLOB.cable_list)
|
||||
if(!PC.powernet)
|
||||
var/datum/powernet/NewPN = new()
|
||||
NewPN.add_cable(PC)
|
||||
propagate_network(PC,PC.powernet)
|
||||
|
||||
/datum/controller/subsystem/machines/New()
|
||||
NEW_SS_GLOBAL(SSmachine)
|
||||
|
||||
|
||||
/datum/controller/subsystem/machines/stat_entry()
|
||||
..("M:[processing.len]|PN:[powernets.len]")
|
||||
|
||||
@@ -65,7 +58,7 @@ var/datum/controller/subsystem/machines/SSmachine
|
||||
propagate_network(PC,PC.powernet)
|
||||
|
||||
/datum/controller/subsystem/machines/Recover()
|
||||
if (istype(SSmachine.processing))
|
||||
processing = SSmachine.processing
|
||||
if (istype(SSmachine.powernets))
|
||||
powernets = SSmachine.powernets
|
||||
if (istype(SSmachines.processing))
|
||||
processing = SSmachines.processing
|
||||
if (istype(SSmachines.powernets))
|
||||
powernets = SSmachines.powernets
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/mapping/SSmapping
|
||||
|
||||
/datum/controller/subsystem/mapping
|
||||
SUBSYSTEM_DEF(mapping)
|
||||
name = "Mapping"
|
||||
init_order = 12
|
||||
flags = SS_NO_FIRE
|
||||
@@ -8,7 +6,6 @@ var/datum/controller/subsystem/mapping/SSmapping
|
||||
var/list/nuke_tiles = list()
|
||||
var/list/nuke_threats = list()
|
||||
|
||||
var/datum/map_config/previous_map_config
|
||||
var/datum/map_config/config
|
||||
var/datum/map_config/next_map_config
|
||||
|
||||
@@ -21,12 +18,7 @@ var/datum/controller/subsystem/mapping/SSmapping
|
||||
var/list/shuttle_templates = list()
|
||||
var/list/shelter_templates = list()
|
||||
|
||||
/datum/controller/subsystem/mapping/New()
|
||||
NEW_SS_GLOBAL(SSmapping)
|
||||
if(!previous_map_config)
|
||||
previous_map_config = new("data/previous_map.json", delete_after = TRUE)
|
||||
if(previous_map_config.defaulted)
|
||||
previous_map_config = null
|
||||
/datum/controller/subsystem/mapping/PreInit()
|
||||
if(!config)
|
||||
#ifdef FORCE_MAP
|
||||
config = new(FORCE_MAP)
|
||||
@@ -97,7 +89,6 @@ var/datum/controller/subsystem/mapping/SSmapping
|
||||
shuttle_templates = SSmapping.shuttle_templates
|
||||
shelter_templates = SSmapping.shelter_templates
|
||||
|
||||
previous_map_config = SSmapping.previous_map_config
|
||||
config = SSmapping.config
|
||||
next_map_config = SSmapping.next_map_config
|
||||
|
||||
@@ -119,12 +110,13 @@ var/datum/controller/subsystem/mapping/SSmapping
|
||||
/datum/controller/subsystem/mapping/proc/loadWorld()
|
||||
//if any of these fail, something has gone horribly, HORRIBLY, wrong
|
||||
var/list/FailedZs = list()
|
||||
|
||||
|
||||
var/start_time = REALTIMEOFDAY
|
||||
|
||||
|
||||
INIT_ANNOUNCE("Loading [config.map_name]...")
|
||||
TryLoadZ(config.GetFullMapPath(), FailedZs, ZLEVEL_STATION)
|
||||
INIT_ANNOUNCE("Loaded station in [(REALTIMEOFDAY - start_time)/10]s!")
|
||||
feedback_add_details("map_name", config.map_name)
|
||||
|
||||
if(config.minetype != "lavaland")
|
||||
INIT_ANNOUNCE("WARNING: A map without lavaland set as it's minetype was loaded! This is being ignored! Update the maploader code!")
|
||||
@@ -141,11 +133,11 @@ var/datum/controller/subsystem/mapping/SSmapping
|
||||
#undef INIT_ANNOUNCE
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/maprotate()
|
||||
var/players = clients.len
|
||||
var/players = GLOB.clients.len
|
||||
var/list/mapvotes = list()
|
||||
//count votes
|
||||
if(global.config.allow_map_voting)
|
||||
for (var/client/c in clients)
|
||||
for (var/client/c in GLOB.clients)
|
||||
var/vote = c.prefs.preferred_map
|
||||
if (!vote)
|
||||
if (global.config.defaultmap)
|
||||
@@ -194,10 +186,6 @@ var/datum/controller/subsystem/mapping/SSmapping
|
||||
next_map_config = VM
|
||||
return TRUE
|
||||
|
||||
/datum/controller/subsystem/mapping/Shutdown()
|
||||
if(config)
|
||||
config.MakePreviousMap()
|
||||
|
||||
/datum/controller/subsystem/mapping/proc/preloadTemplates(path = "_maps/templates/") //see master controller setup
|
||||
var/list/filelist = flist(path)
|
||||
for(var/map in filelist)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/minimap/SSminimap
|
||||
|
||||
/datum/controller/subsystem/minimap
|
||||
SUBSYSTEM_DEF(minimap)
|
||||
name = "Minimap"
|
||||
init_order = -2
|
||||
flags = SS_NO_FIRE
|
||||
@@ -9,9 +7,6 @@ var/datum/controller/subsystem/minimap/SSminimap
|
||||
|
||||
var/list/z_levels = list(ZLEVEL_STATION)
|
||||
|
||||
/datum/controller/subsystem/minimap/New()
|
||||
NEW_SS_GLOBAL(SSminimap)
|
||||
|
||||
/datum/controller/subsystem/minimap/Initialize(timeofday)
|
||||
var/hash = md5(SSmapping.config.GetFullMapPath())
|
||||
if(config.generate_minimaps)
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/mobs/SSmob
|
||||
|
||||
/datum/controller/subsystem/mobs
|
||||
SUBSYSTEM_DEF(mobs)
|
||||
name = "Mobs"
|
||||
init_order = 4
|
||||
priority = 100
|
||||
@@ -8,18 +6,14 @@ var/datum/controller/subsystem/mobs/SSmob
|
||||
|
||||
var/list/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/mobs/New()
|
||||
NEW_SS_GLOBAL(SSmob)
|
||||
|
||||
|
||||
/datum/controller/subsystem/mobs/stat_entry()
|
||||
..("P:[mob_list.len]")
|
||||
..("P:[GLOB.mob_list.len]")
|
||||
|
||||
|
||||
/datum/controller/subsystem/mobs/fire(resumed = 0)
|
||||
var/seconds = wait * 0.1
|
||||
if (!resumed)
|
||||
src.currentrun = mob_list.Copy()
|
||||
src.currentrun = GLOB.mob_list.Copy()
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
@@ -30,6 +24,6 @@ var/datum/controller/subsystem/mobs/SSmob
|
||||
if(M)
|
||||
M.Life(seconds)
|
||||
else
|
||||
mob_list.Remove(M)
|
||||
GLOB.mob_list.Remove(M)
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
@@ -1,39 +1,31 @@
|
||||
var/datum/controller/subsystem/npcpool/SSnpc
|
||||
#define PROCESSING_NPCS 0
|
||||
#define PROCESSING_DELEGATES 1
|
||||
#define PROCESSING_ASSISTANTS 2
|
||||
|
||||
/datum/controller/subsystem/npcpool
|
||||
SUBSYSTEM_DEF(npcpool)
|
||||
name = "NPC Pool"
|
||||
init_order = 17
|
||||
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_NO_TICK_CHECK
|
||||
priority = 25
|
||||
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
||||
priority = 20
|
||||
|
||||
var/list/canBeUsed = list()
|
||||
var/list/canBeUsed_non = list()
|
||||
var/list/needsDelegate = list()
|
||||
var/list/needsAssistant = list()
|
||||
var/list/needsHelp_non = list()
|
||||
var/list/botPool_l = list() //list of all npcs using the pool
|
||||
var/list/botPool_l_non = list() //list of all non SNPC mobs using the pool
|
||||
|
||||
/datum/controller/subsystem/npcpool/proc/insertBot(toInsert)
|
||||
if(istype(toInsert,/mob/living/carbon/human/interactive))
|
||||
botPool_l |= toInsert
|
||||
|
||||
/datum/controller/subsystem/npcpool/New()
|
||||
NEW_SS_GLOBAL(SSnpc)
|
||||
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
var/stage
|
||||
|
||||
/datum/controller/subsystem/npcpool/stat_entry()
|
||||
..("T:[botPool_l.len + botPool_l_non.len]|D:[needsDelegate.len]|A:[needsAssistant.len + needsHelp_non.len]|U:[canBeUsed.len + canBeUsed_non.len]")
|
||||
..("NPCS:[processing.len]|D:[needsDelegate.len]|A:[needsAssistant.len]|U:[canBeUsed.len]")
|
||||
|
||||
/datum/controller/subsystem/npcpool/proc/stop_processing(mob/living/carbon/human/interactive/I)
|
||||
processing -= I
|
||||
currentrun -= I
|
||||
needsDelegate -= I
|
||||
canBeUsed -= I
|
||||
needsAssistant -= I
|
||||
|
||||
/datum/controller/subsystem/npcpool/proc/cleanNull()
|
||||
//cleanup nulled bots
|
||||
listclearnulls(botPool_l)
|
||||
listclearnulls(needsDelegate)
|
||||
listclearnulls(canBeUsed)
|
||||
listclearnulls(needsAssistant)
|
||||
|
||||
|
||||
/datum/controller/subsystem/npcpool/fire()
|
||||
/datum/controller/subsystem/npcpool/fire(resumed = FALSE)
|
||||
//bot delegation and coordination systems
|
||||
//General checklist/Tasks for delegating a task or coordinating it (for SNPCs)
|
||||
// 1. Bot proximity to task target: if too far, delegate, if close, coordinate
|
||||
@@ -41,87 +33,94 @@ var/datum/controller/subsystem/npcpool/SSnpc
|
||||
// 3. Process delegation: if a bot (or bots) has been delegated, assign them to the task.
|
||||
// 4. Process coordination: if a bot(or bots) has been asked to coordinate, assign them to help.
|
||||
// 5. Do all assignments: goes through the delegated/coordianted bots and assigns the right variables/tasks to them.
|
||||
var/npcCount = 1
|
||||
|
||||
cleanNull()
|
||||
if (!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
stage = PROCESSING_NPCS
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
var/list/canBeUsed = src.canBeUsed
|
||||
|
||||
//SNPC handling
|
||||
for(var/mob/living/carbon/human/interactive/check in botPool_l)
|
||||
if(!check)
|
||||
botPool_l.Cut(npcCount,npcCount+1)
|
||||
continue
|
||||
var/checkInRange = view(MAX_RANGE_FIND,check)
|
||||
if(!(locate(check.TARGET) in checkInRange))
|
||||
needsDelegate |= check
|
||||
if(stage == PROCESSING_NPCS)
|
||||
while(currentrun.len)
|
||||
var/mob/living/carbon/human/interactive/thing = currentrun[currentrun.len]
|
||||
--currentrun.len
|
||||
|
||||
else if(check.IsDeadOrIncap(FALSE))
|
||||
needsDelegate |= check
|
||||
thing.InteractiveProcess()
|
||||
|
||||
else if(check.doing & FIGHTING)
|
||||
needsAssistant |= check
|
||||
var/checkInRange = view(MAX_RANGE_FIND,thing)
|
||||
if(thing.IsDeadOrIncap(FALSE) || !(locate(thing.TARGET) in checkInRange))
|
||||
needsDelegate += thing
|
||||
else if(thing.doing & FIGHTING)
|
||||
needsAssistant += thing
|
||||
else
|
||||
canBeUsed += thing
|
||||
|
||||
else
|
||||
canBeUsed |= check
|
||||
npcCount++
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
stage = PROCESSING_DELEGATES
|
||||
currentrun = needsDelegate //localcache
|
||||
src.currentrun = currentrun
|
||||
|
||||
if(needsDelegate.len)
|
||||
if(stage == PROCESSING_DELEGATES)
|
||||
while(currentrun.len && canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
|
||||
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
|
||||
--currentrun.len
|
||||
|
||||
needsDelegate -= pick(needsDelegate) // cheapo way to make sure stuff doesn't pingpong around in the pool forever. delegation runs seperately to each loop so it will work much smoother
|
||||
var/helpProb = 0
|
||||
var/list/chfac = check.faction
|
||||
var/list/canfac = candidate.faction
|
||||
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
|
||||
|
||||
npcCount = 1 //reset the count
|
||||
for(var/mob/living/carbon/human/interactive/check in needsDelegate)
|
||||
if(!check)
|
||||
needsDelegate.Cut(npcCount,npcCount+1)
|
||||
continue
|
||||
if(canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/candidate = pick(canBeUsed)
|
||||
var/facCount = 0
|
||||
var/helpProb = 0
|
||||
for(var/C in check.faction)
|
||||
for(var/D in candidate.faction)
|
||||
if(D == C)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
facCount++
|
||||
if(facCount == 1 && helpProb > 0)
|
||||
helpProb = 100
|
||||
if(prob(helpProb))
|
||||
if(candidate.takeDelegate(check))
|
||||
needsDelegate -= check
|
||||
canBeUsed -= candidate
|
||||
candidate.eye_color = "red"
|
||||
candidate.update_icons()
|
||||
npcCount++
|
||||
for(var/C in chfac)
|
||||
if(C in canfac)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
if(helpProb >= 100)
|
||||
break
|
||||
|
||||
if(needsAssistant.len)
|
||||
if(facCount == 1 && helpProb)
|
||||
helpProb = 100
|
||||
|
||||
needsAssistant -= pick(needsAssistant)
|
||||
if(prob(helpProb) && candidate.takeDelegate(check))
|
||||
--canBeUsed.len
|
||||
candidate.eye_color = "red"
|
||||
candidate.update_icons()
|
||||
|
||||
npcCount = 1 //reset the count
|
||||
for(var/mob/living/carbon/human/interactive/check in needsAssistant)
|
||||
if(!check)
|
||||
needsAssistant.Cut(npcCount,npcCount+1)
|
||||
continue
|
||||
if(canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/candidate = pick(canBeUsed)
|
||||
var/facCount = 0
|
||||
var/helpProb = 0
|
||||
for(var/C in check.faction)
|
||||
for(var/D in candidate.faction)
|
||||
if(D == C)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
facCount++
|
||||
if(facCount == 1 && helpProb > 0)
|
||||
helpProb = 100
|
||||
if(prob(helpProb))
|
||||
if(candidate.takeDelegate(check,FALSE))
|
||||
needsAssistant -= check
|
||||
canBeUsed -= candidate
|
||||
candidate.eye_color = "yellow"
|
||||
candidate.update_icons()
|
||||
npcCount++
|
||||
if(MC_TICK_CHECK)
|
||||
return
|
||||
stage = PROCESSING_ASSISTANTS
|
||||
currentrun = needsAssistant //localcache
|
||||
src.currentrun = currentrun
|
||||
|
||||
//no need for the stage check
|
||||
|
||||
while(currentrun.len && canBeUsed.len)
|
||||
var/mob/living/carbon/human/interactive/check = currentrun[currentrun.len]
|
||||
var/mob/living/carbon/human/interactive/candidate = canBeUsed[canBeUsed.len]
|
||||
--currentrun.len
|
||||
|
||||
var/helpProb = 0
|
||||
var/list/chfac = check.faction
|
||||
var/list/canfac = candidate.faction
|
||||
var/facCount = LAZYLEN(chfac) * LAZYLEN(canfac)
|
||||
|
||||
for(var/C in chfac)
|
||||
if(C in canfac)
|
||||
helpProb = min(100,helpProb + 25)
|
||||
if(helpProb >= 100)
|
||||
break
|
||||
|
||||
if(facCount == 1 && helpProb)
|
||||
helpProb = 100
|
||||
|
||||
if(prob(helpProb) && candidate.takeDelegate(check,FALSE))
|
||||
--canBeUsed.len
|
||||
candidate.eye_color = "yellow"
|
||||
candidate.update_icons()
|
||||
|
||||
if(!currentrun.len || MC_TICK_CHECK) //don't change SS state if it isn't necessary
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/npcpool/Recover()
|
||||
if (istype(SSnpc.botPool_l))
|
||||
botPool_l = SSnpc.botPool_l
|
||||
if (istype(SSnpc.botPool_l_non))
|
||||
botPool_l_non = SSnpc.botPool_l_non
|
||||
processing = SSnpcpool.processing
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/orbit/SSorbit
|
||||
|
||||
/datum/controller/subsystem/orbit
|
||||
SUBSYSTEM_DEF(orbit)
|
||||
name = "Orbits"
|
||||
priority = 35
|
||||
wait = 2
|
||||
@@ -9,10 +7,6 @@ var/datum/controller/subsystem/orbit/SSorbit
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/orbit/New()
|
||||
NEW_SS_GLOBAL(SSorbit)
|
||||
|
||||
|
||||
/datum/controller/subsystem/orbit/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
var/datum/controller/subsystem/pai/SSpai
|
||||
var/list/obj/item/device/paicard/pai_card_list = list()
|
||||
|
||||
/datum/controller/subsystem/pai
|
||||
SUBSYSTEM_DEF(pai)
|
||||
name = "pAI"
|
||||
|
||||
flags = SS_NO_INIT|SS_NO_FIRE
|
||||
@@ -9,9 +6,7 @@ var/list/obj/item/device/paicard/pai_card_list = list()
|
||||
var/list/candidates = list()
|
||||
var/ghost_spam = FALSE
|
||||
var/spam_delay = 100
|
||||
|
||||
/datum/controller/subsystem/pai/New()
|
||||
NEW_SS_GLOBAL(SSpai)
|
||||
var/list/pai_card_list = list()
|
||||
|
||||
/datum/controller/subsystem/pai/Topic(href, href_list[])
|
||||
if(href_list["download"])
|
||||
@@ -24,7 +19,7 @@ var/list/obj/item/device/paicard/pai_card_list = list()
|
||||
return FALSE
|
||||
var/mob/living/silicon/pai/pai = new(card)
|
||||
if(!candidate.name)
|
||||
pai.name = pick(ninja_names)
|
||||
pai.name = pick(GLOB.ninja_names)
|
||||
else
|
||||
pai.name = candidate.name
|
||||
pai.real_name = pai.name
|
||||
@@ -32,8 +27,8 @@ var/list/obj/item/device/paicard/pai_card_list = list()
|
||||
|
||||
card.setPersonality(pai)
|
||||
|
||||
ticker.mode.update_cult_icons_removed(card.pai.mind)
|
||||
ticker.mode.update_rev_icons_removed(card.pai.mind)
|
||||
SSticker.mode.update_cult_icons_removed(card.pai.mind)
|
||||
SSticker.mode.update_rev_icons_removed(card.pai.mind)
|
||||
|
||||
candidates -= candidate
|
||||
usr << browse(null, "window=findPai")
|
||||
@@ -141,7 +136,7 @@ var/list/obj/item/device/paicard/pai_card_list = list()
|
||||
/datum/controller/subsystem/pai/proc/check_ready(var/datum/paiCandidate/C)
|
||||
if(!C.ready)
|
||||
return FALSE
|
||||
for(var/mob/dead/observer/O in player_list)
|
||||
for(var/mob/dead/observer/O in GLOB.player_list)
|
||||
if(O.key == C.key)
|
||||
return C
|
||||
return FALSE
|
||||
@@ -149,7 +144,7 @@ var/list/obj/item/device/paicard/pai_card_list = list()
|
||||
/datum/controller/subsystem/pai/proc/findPAI(obj/item/device/paicard/p, mob/user)
|
||||
if(!ghost_spam)
|
||||
ghost_spam = TRUE
|
||||
for(var/mob/dead/observer/G in player_list)
|
||||
for(var/mob/dead/observer/G in GLOB.player_list)
|
||||
if(!G.key || !G.client)
|
||||
continue
|
||||
if(!(ROLE_PAI in G.client.prefs.be_special))
|
||||
|
||||
@@ -1,19 +1,13 @@
|
||||
var/datum/controller/subsystem/parallax/SSparallax
|
||||
|
||||
/datum/controller/subsystem/parallax
|
||||
SUBSYSTEM_DEF(parallax)
|
||||
name = "Parallax"
|
||||
wait = 2
|
||||
flags = SS_POST_FIRE_TIMING | SS_FIRE_IN_LOBBY | SS_BACKGROUND | SS_NO_INIT
|
||||
priority = 65
|
||||
var/list/currentrun
|
||||
|
||||
/datum/controller/subsystem/parallax/New()
|
||||
NEW_SS_GLOBAL(SSparallax)
|
||||
return ..()
|
||||
|
||||
/datum/controller/subsystem/parallax/fire(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = clients.Copy()
|
||||
src.currentrun = GLOB.clients.Copy()
|
||||
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
var/list/currentrun = src.currentrun
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/persistence/SSpersistence
|
||||
|
||||
/datum/controller/subsystem/persistence
|
||||
SUBSYSTEM_DEF(persistence)
|
||||
name = "Persistence"
|
||||
init_order = -100
|
||||
flags = SS_NO_FIRE
|
||||
@@ -13,9 +11,6 @@ var/datum/controller/subsystem/persistence/SSpersistence
|
||||
var/list/saved_messages = list()
|
||||
var/savefile/chisel_messages_sav
|
||||
|
||||
/datum/controller/subsystem/persistence/New()
|
||||
NEW_SS_GLOBAL(SSpersistence)
|
||||
|
||||
/datum/controller/subsystem/persistence/Initialize()
|
||||
LoadSatchels()
|
||||
LoadPoly()
|
||||
@@ -71,7 +66,7 @@ var/datum/controller/subsystem/persistence/SSpersistence
|
||||
return 1
|
||||
|
||||
/datum/controller/subsystem/persistence/proc/LoadPoly()
|
||||
for(var/mob/living/simple_animal/parrot/Poly/P in living_mob_list)
|
||||
for(var/mob/living/simple_animal/parrot/Poly/P in GLOB.living_mob_list)
|
||||
twitterize(P.speech_buffer, "polytalk")
|
||||
break //Who's been duping the bird?!
|
||||
|
||||
@@ -86,12 +81,25 @@ var/datum/controller/subsystem/persistence/SSpersistence
|
||||
var/saved_messages = json_decode(saved_json)
|
||||
|
||||
for(var/item in saved_messages)
|
||||
var/turf/T = locate(item["x"], item["y"], ZLEVEL_STATION)
|
||||
if(!islist(item))
|
||||
continue
|
||||
|
||||
var/xvar = item["x"]
|
||||
var/yvar = item["y"]
|
||||
var/zvar = item["z"]
|
||||
|
||||
if(!xvar || !yvar || !zvar)
|
||||
continue
|
||||
|
||||
var/turf/T = locate(xvar, yvar, zvar)
|
||||
if(!isturf(T))
|
||||
continue
|
||||
|
||||
if(locate(/obj/structure/chisel_message) in T)
|
||||
continue
|
||||
|
||||
var/obj/structure/chisel_message/M = new(T)
|
||||
|
||||
M.unpack(item)
|
||||
if(!M.loc)
|
||||
M.persists = FALSE
|
||||
|
||||
@@ -1,20 +1,15 @@
|
||||
#define PING_BUFFER_TIME 25
|
||||
|
||||
var/datum/controller/subsystem/ping/SSping
|
||||
|
||||
/datum/controller/subsystem/ping
|
||||
SUBSYSTEM_DEF(ping)
|
||||
name = "Ping"
|
||||
wait = 6
|
||||
flags = SS_NO_INIT|SS_POST_FIRE_TIMING|SS_FIRE_IN_LOBBY
|
||||
priority = 10
|
||||
var/list/currentrun
|
||||
|
||||
/datum/controller/subsystem/ping/New()
|
||||
NEW_SS_GLOBAL(SSping)
|
||||
|
||||
/datum/controller/subsystem/ping/fire(resumed = FALSE)
|
||||
if (!resumed)
|
||||
src.currentrun = clients.Copy()
|
||||
src.currentrun = GLOB.clients.Copy()
|
||||
|
||||
var/list/currentrun = src.currentrun
|
||||
while (length(currentrun))
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
//Fires five times every second.
|
||||
|
||||
var/datum/controller/subsystem/processing/fastprocess/SSfastprocess
|
||||
/datum/controller/subsystem/processing/fastprocess
|
||||
PROCESSING_SUBSYSTEM_DEF(fastprocess)
|
||||
name = "Fast Processing"
|
||||
wait = 2
|
||||
stat_tag = "FP"
|
||||
|
||||
/datum/controller/subsystem/processing/fastprocess/New()
|
||||
NEW_SS_GLOBAL(SSfastprocess)
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
|
||||
var/datum/controller/subsystem/processing/flightpacks/SSflightpacks
|
||||
/datum/controller/subsystem/processing/flightpacks
|
||||
PROCESSING_SUBSYSTEM_DEF(flightpacks)
|
||||
name = "Flightpack Movement"
|
||||
priority = 30
|
||||
wait = 2
|
||||
stat_tag = "FM"
|
||||
flags = SS_NO_INIT|SS_TICKER|SS_KEEP_TIMING
|
||||
|
||||
/datum/controller/subsystem/processing/flightpacks/New()
|
||||
NEW_SS_GLOBAL(SSflightpacks)
|
||||
var/flightsuit_processing = FLIGHTSUIT_PROCESSING_FULL
|
||||
|
||||
/datum/controller/subsystem/processing/flightpacks/Initialize()
|
||||
sync_flightsuit_processing()
|
||||
|
||||
/datum/controller/subsystem/processing/flightpacks/vv_edit_var(var_name, var_value)
|
||||
..()
|
||||
switch(var_name)
|
||||
if("flightsuit_processing")
|
||||
sync_flightsuit_processing()
|
||||
|
||||
/datum/controller/subsystem/processing/flightpacks/proc/sync_flightsuit_processing()
|
||||
for(var/obj/item/device/flightpack/FP in processing)
|
||||
FP.sync_processing(src)
|
||||
if(flightsuit_processing == FLIGHTSUIT_PROCESSING_NONE) //Don't even bother firing.
|
||||
can_fire = FALSE
|
||||
else
|
||||
can_fire = TRUE
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
var/datum/controller/subsystem/objects/SSobj
|
||||
/datum/controller/subsystem/objects
|
||||
SUBSYSTEM_DEF(obj)
|
||||
name = "Objects"
|
||||
priority = 40
|
||||
flags = SS_NO_INIT
|
||||
@@ -7,12 +6,10 @@ var/datum/controller/subsystem/objects/SSobj
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/objects/New()
|
||||
NEW_SS_GLOBAL(SSobj)
|
||||
/datum/controller/subsystem/objects/stat_entry()
|
||||
/datum/controller/subsystem/obj/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
/datum/controller/subsystem/objects/fire(resumed = 0)
|
||||
/datum/controller/subsystem/obj/fire(resumed = 0)
|
||||
if (!resumed)
|
||||
src.currentrun = processing.Copy()
|
||||
//cache for sanic speed (lists are references anyways)
|
||||
@@ -28,5 +25,5 @@ var/datum/controller/subsystem/objects/SSobj
|
||||
if (MC_TICK_CHECK)
|
||||
return
|
||||
|
||||
/datum/controller/subsystem/objects/Recover()
|
||||
/datum/controller/subsystem/obj/Recover()
|
||||
processing = SSobj.processing
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/processing/overlays/SSoverlays
|
||||
|
||||
/datum/controller/subsystem/processing/overlays
|
||||
PROCESSING_SUBSYSTEM_DEF(overlays)
|
||||
name = "Overlay"
|
||||
flags = SS_TICKER|SS_FIRE_IN_LOBBY
|
||||
wait = 1
|
||||
@@ -13,8 +11,7 @@ var/datum/controller/subsystem/processing/overlays/SSoverlays
|
||||
var/list/overlay_icon_cache
|
||||
var/initialized = FALSE
|
||||
|
||||
/datum/controller/subsystem/processing/overlays/New()
|
||||
NEW_SS_GLOBAL(SSoverlays)
|
||||
/datum/controller/subsystem/processing/overlays/PreInit()
|
||||
LAZYINITLIST(overlay_icon_state_caches)
|
||||
LAZYINITLIST(overlay_icon_cache)
|
||||
|
||||
@@ -171,7 +168,7 @@ var/datum/controller/subsystem/processing/overlays/SSoverlays
|
||||
|
||||
var/list/cached_other = other.our_overlays
|
||||
if(cached_other)
|
||||
if(cut_old)
|
||||
if(cut_old || !LAZYLEN(our_overlays))
|
||||
our_overlays = cached_other.Copy()
|
||||
else
|
||||
our_overlays |= cached_other
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//Used to process objects. Fires once every second.
|
||||
|
||||
var/datum/controller/subsystem/processing/SSprocessing
|
||||
/datum/controller/subsystem/processing
|
||||
SUBSYSTEM_DEF(processing)
|
||||
name = "Processing"
|
||||
priority = 25
|
||||
flags = SS_BACKGROUND|SS_POST_FIRE_TIMING|SS_NO_INIT
|
||||
@@ -11,9 +10,6 @@ var/datum/controller/subsystem/processing/SSprocessing
|
||||
var/list/processing = list()
|
||||
var/list/currentrun = list()
|
||||
|
||||
/datum/controller/subsystem/processing/New()
|
||||
NEW_SS_GLOBAL(SSprocessing)
|
||||
|
||||
/datum/controller/subsystem/processing/stat_entry()
|
||||
..("[stat_tag]:[processing.len]")
|
||||
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
var/datum/controller/subsystem/radio/SSradio
|
||||
|
||||
/datum/controller/subsystem/radio
|
||||
SUBSYSTEM_DEF(radio)
|
||||
name = "Radio"
|
||||
init_order = 18
|
||||
flags = SS_NO_FIRE|SS_NO_INIT
|
||||
|
||||
var/list/datum/radio_frequency/frequencies = list()
|
||||
|
||||
/datum/controller/subsystem/radio/New()
|
||||
NEW_SS_GLOBAL(SSradio)
|
||||
|
||||
/datum/controller/subsystem/radio/proc/add_object(obj/device, new_frequency as num, filter = null as text|null)
|
||||
var/f_text = num2text(new_frequency)
|
||||
var/datum/radio_frequency/frequency = frequencies[f_text]
|
||||
|
||||
@@ -1,17 +1,11 @@
|
||||
var/datum/controller/subsystem/religion/SSreligion
|
||||
|
||||
/datum/controller/subsystem/religion
|
||||
SUBSYSTEM_DEF(religion)
|
||||
name = "Religion"
|
||||
init_order = 19
|
||||
flags = SS_NO_FIRE|SS_NO_INIT
|
||||
|
||||
var/bible_deity_name
|
||||
var/Bible_icon_state
|
||||
var/Bible_item_state
|
||||
var/Bible_name
|
||||
var/Bible_deity_name
|
||||
|
||||
var/holy_weapon
|
||||
|
||||
/datum/controller/subsystem/religion/New()
|
||||
NEW_SS_GLOBAL(SSreligion)
|
||||
var/religion
|
||||
var/deity
|
||||
var/bible_name
|
||||
var/bible_icon_state
|
||||
var/bible_item_state
|
||||
var/holy_weapon_type
|
||||
@@ -1,13 +1,8 @@
|
||||
var/datum/controller/subsystem/server_maint/SSserver
|
||||
|
||||
/datum/controller/subsystem/server_maint
|
||||
SUBSYSTEM_DEF(server_maint)
|
||||
name = "Server Tasks"
|
||||
wait = 6000
|
||||
flags = SS_NO_TICK_CHECK
|
||||
|
||||
/datum/controller/subsystem/server_maint/New()
|
||||
NEW_SS_GLOBAL(SSserver)
|
||||
|
||||
/datum/controller/subsystem/server_maint/Initialize(timeofday)
|
||||
if (config.hub)
|
||||
world.visibility = 1
|
||||
@@ -16,7 +11,7 @@ var/datum/controller/subsystem/server_maint/SSserver
|
||||
/datum/controller/subsystem/server_maint/fire()
|
||||
//handle kicking inactive players
|
||||
if(config.kick_inactive > 0)
|
||||
for(var/client/C in clients)
|
||||
for(var/client/C in GLOB.clients)
|
||||
if(C.is_afk(INACTIVITY_KICK))
|
||||
if(!istype(C.mob, /mob/dead))
|
||||
log_access("AFK: [key_name(C)]")
|
||||
@@ -1,9 +1,7 @@
|
||||
#define HIGHLIGHT_DYNAMIC_TRANSIT 1
|
||||
|
||||
var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
|
||||
/datum/controller/subsystem/shuttle
|
||||
name = "Shuttles"
|
||||
SUBSYSTEM_DEF(shuttle)
|
||||
name = "Shuttle"
|
||||
wait = 10
|
||||
init_order = 3
|
||||
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
|
||||
@@ -49,9 +47,6 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
|
||||
var/auto_call = 72000 //time before in deciseconds in which the shuttle is auto called. Default is 2 hours.
|
||||
|
||||
/datum/controller/subsystem/shuttle/New()
|
||||
NEW_SS_GLOBAL(SSshuttle)
|
||||
|
||||
/datum/controller/subsystem/shuttle/Initialize(timeofday)
|
||||
if(!emergency)
|
||||
WARNING("No /obj/docking_port/mobile/arrivals placed on the map!")
|
||||
@@ -78,12 +73,12 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
..()
|
||||
|
||||
/datum/controller/subsystem/shuttle/proc/setup_transit_zone()
|
||||
if(transit_markers.len == 0)
|
||||
if(GLOB.transit_markers.len == 0)
|
||||
WARNING("No /obj/effect/landmark/transit placed on the map!")
|
||||
return
|
||||
// transit zone
|
||||
var/turf/A = get_turf(transit_markers[1])
|
||||
var/turf/B = get_turf(transit_markers[2])
|
||||
var/turf/A = get_turf(GLOB.transit_markers[1])
|
||||
var/turf/B = get_turf(GLOB.transit_markers[2])
|
||||
for(var/i in block(A, B))
|
||||
var/turf/T = i
|
||||
T.ChangeTurf(/turf/open/space)
|
||||
@@ -92,11 +87,11 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
|
||||
#ifdef HIGHLIGHT_DYNAMIC_TRANSIT
|
||||
/datum/controller/subsystem/shuttle/proc/color_space()
|
||||
if(transit_markers.len == 0)
|
||||
if(GLOB.transit_markers.len == 0)
|
||||
WARNING("No /obj/effect/landmark/transit placed on the map!")
|
||||
return
|
||||
var/turf/A = get_turf(transit_markers[1])
|
||||
var/turf/B = get_turf(transit_markers[2])
|
||||
var/turf/A = get_turf(GLOB.transit_markers[1])
|
||||
var/turf/B = get_turf(GLOB.transit_markers[2])
|
||||
for(var/i in block(A, B))
|
||||
var/turf/T = i
|
||||
// Only dying the "pure" space, not the transit tiles
|
||||
@@ -181,8 +176,8 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
return
|
||||
emergency = backup_shuttle
|
||||
|
||||
if(world.time - round_start_time < config.shuttle_refuel_delay)
|
||||
to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.")
|
||||
if(world.time - SSticker.round_start_time < config.shuttle_refuel_delay)
|
||||
to_chat(user, "The emergency shuttle is refueling. Please wait another [abs(round(((world.time - SSticker.round_start_time) - config.shuttle_refuel_delay)/600))] minutes before trying again.")
|
||||
return
|
||||
|
||||
switch(emergency.mode)
|
||||
@@ -242,7 +237,7 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
/datum/controller/subsystem/shuttle/proc/canRecall()
|
||||
if(!emergency || emergency.mode != SHUTTLE_CALL)
|
||||
return
|
||||
if(ticker.mode.name == "meteor")
|
||||
if(SSticker.mode.name == "meteor")
|
||||
return
|
||||
var/security_num = seclevel2num(get_security_level())
|
||||
switch(security_num)
|
||||
@@ -260,9 +255,11 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
/datum/controller/subsystem/shuttle/proc/autoEvac()
|
||||
var/callShuttle = 1
|
||||
|
||||
for(var/thing in shuttle_caller_list)
|
||||
for(var/thing in GLOB.shuttle_caller_list)
|
||||
if(isAI(thing))
|
||||
var/mob/living/silicon/ai/AI = thing
|
||||
if(AI.deployed_shell && !AI.deployed_shell.client)
|
||||
continue
|
||||
if(AI.stat || !AI.client)
|
||||
continue
|
||||
else if(istype(thing, /obj/machinery/computer/communications))
|
||||
@@ -281,8 +278,6 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
log_game("There is no means of calling the shuttle anymore. Shuttle automatically called.")
|
||||
message_admins("All the communications consoles were destroyed and all AIs are inactive. Shuttle called.")
|
||||
|
||||
|
||||
|
||||
/datum/controller/subsystem/shuttle/proc/registerHostileEnvironment(datum/bad)
|
||||
hostileEnvironments[bad] = TRUE
|
||||
checkHostileEnvironment()
|
||||
@@ -360,7 +355,6 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
log_game("Round time limit reached. Shuttle has been auto-called.")
|
||||
message_admins("Round time limit reached. Shuttle called.")
|
||||
|
||||
|
||||
/datum/controller/subsystem/shuttle/proc/generate_transit_dock(obj/docking_port/mobile/M)
|
||||
// First, determine the size of the needed zone
|
||||
// Because of shuttle rotation, the "width" of the shuttle is not
|
||||
@@ -469,6 +463,7 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
//to_chat(world, "Making transit dock at [COORD(midpoint)]")
|
||||
var/area/shuttle/transit/A = new()
|
||||
A.parallax_movedir = travel_dir
|
||||
A.contents = proposed_zone
|
||||
var/obj/docking_port/stationary/transit/new_transit_dock = new(midpoint)
|
||||
new_transit_dock.assigned_turfs = proposed_zone
|
||||
new_transit_dock.name = "Transit for [M.id]/[M.name]"
|
||||
@@ -484,7 +479,6 @@ var/datum/controller/subsystem/shuttle/SSshuttle
|
||||
var/turf/T = i
|
||||
T.ChangeTurf(transit_path)
|
||||
T.flags &= ~(UNUSED_TRANSIT_TURF)
|
||||
A.contents += T
|
||||
|
||||
M.assigned_transit = new_transit_dock
|
||||
return TRUE
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/spacedrift/SSspacedrift
|
||||
|
||||
/datum/controller/subsystem/spacedrift
|
||||
SUBSYSTEM_DEF(spacedrift)
|
||||
name = "Space Drift"
|
||||
priority = 30
|
||||
wait = 5
|
||||
@@ -9,10 +7,6 @@ var/datum/controller/subsystem/spacedrift/SSspacedrift
|
||||
var/list/currentrun = list()
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/spacedrift/New()
|
||||
NEW_SS_GLOBAL(SSspacedrift)
|
||||
|
||||
|
||||
/datum/controller/subsystem/spacedrift/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
|
||||
|
||||
@@ -1,19 +1,14 @@
|
||||
var/datum/controller/subsystem/squeak/SSsqueak
|
||||
|
||||
// The Squeak
|
||||
// because this is about placement of mice mobs, and nothing to do with
|
||||
// mice - the computer peripheral
|
||||
|
||||
/datum/controller/subsystem/squeak
|
||||
SUBSYSTEM_DEF(squeak)
|
||||
name = "Squeak"
|
||||
priority = 40
|
||||
flags = SS_NO_FIRE
|
||||
|
||||
var/list/exposed_wires = list()
|
||||
|
||||
/datum/controller/subsystem/squeak/New()
|
||||
NEW_SS_GLOBAL(SSsqueak)
|
||||
|
||||
/datum/controller/subsystem/squeak/Initialize(timeofday)
|
||||
trigger_migration()
|
||||
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
var/datum/controller/subsystem/stickyban/SSstickyban
|
||||
|
||||
/datum/controller/subsystem/stickyban
|
||||
SUBSYSTEM_DEF(stickyban)
|
||||
name = "Sticky Ban"
|
||||
init_order = -10
|
||||
flags = SS_NO_FIRE
|
||||
|
||||
var/list/cache = list()
|
||||
|
||||
/datum/controller/subsystem/stickyban/New()
|
||||
NEW_SS_GLOBAL(SSstickyban)
|
||||
|
||||
/datum/controller/subsystem/stickyban/Initialize(timeofday)
|
||||
var/list/bannedkeys = world.GetConfig("ban")
|
||||
//sanitize the sticky ban list
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/sun/SSsun
|
||||
|
||||
/datum/controller/subsystem/sun
|
||||
SUBSYSTEM_DEF(sun)
|
||||
name = "Sun"
|
||||
wait = 600
|
||||
init_order = 2
|
||||
@@ -11,9 +9,7 @@ var/datum/controller/subsystem/sun/SSsun
|
||||
var/rate
|
||||
var/list/solars = list()
|
||||
|
||||
/datum/controller/subsystem/sun/New()
|
||||
NEW_SS_GLOBAL(SSsun)
|
||||
|
||||
/datum/controller/subsystem/sun/PreInit()
|
||||
angle = rand (0,360) // the station position to the sun is randomised at round start
|
||||
rate = rand(50,200)/100 // 50% - 200% of standard rotation
|
||||
if(prob(50)) // same chance to rotate clockwise than counter-clockwise
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/tgui/SStgui
|
||||
|
||||
/datum/controller/subsystem/tgui
|
||||
SUBSYSTEM_DEF(tgui)
|
||||
name = "tgui"
|
||||
wait = 9
|
||||
init_order = 16
|
||||
@@ -12,11 +10,9 @@ var/datum/controller/subsystem/tgui/SStgui
|
||||
var/list/processing_uis = list() // A list of processing UIs, ungrouped.
|
||||
var/basehtml // The HTML base used for all UIs.
|
||||
|
||||
/datum/controller/subsystem/tgui/New()
|
||||
/datum/controller/subsystem/tgui/PreInit()
|
||||
basehtml = file2text('tgui/tgui.html') // Read the HTML from disk.
|
||||
|
||||
NEW_SS_GLOBAL(SStgui)
|
||||
|
||||
/datum/controller/subsystem/tgui/Shutdown()
|
||||
close_all_uis()
|
||||
|
||||
|
||||
@@ -1,20 +1,14 @@
|
||||
#define MAX_THROWING_DIST 512 // 2 z-levels on default width
|
||||
#define MAX_TICKS_TO_MAKE_UP 3 //how many missed ticks will we attempt to make up for this run.
|
||||
var/datum/controller/subsystem/throwing/SSthrowing
|
||||
|
||||
/datum/controller/subsystem/throwing
|
||||
SUBSYSTEM_DEF(throwing)
|
||||
name = "Throwing"
|
||||
priority = 25
|
||||
wait = 1
|
||||
flags = SS_NO_INIT|SS_KEEP_TIMING|SS_TICKER
|
||||
|
||||
var/list/currentrun
|
||||
var/list/processing
|
||||
|
||||
/datum/controller/subsystem/throwing/New()
|
||||
NEW_SS_GLOBAL(SSthrowing)
|
||||
processing = list()
|
||||
|
||||
var/list/processing = list()
|
||||
|
||||
/datum/controller/subsystem/throwing/stat_entry()
|
||||
..("P:[processing.len]")
|
||||
@@ -76,7 +70,7 @@ var/datum/controller/subsystem/throwing/SSthrowing
|
||||
var/atom/step
|
||||
|
||||
//calculate how many tiles to move, making up for any missed ticks.
|
||||
var/tilestomove = round(min(((((world.time+world.tick_lag) - start_time) * speed) - (dist_travelled ? dist_travelled : -1)), speed*MAX_TICKS_TO_MAKE_UP) * (world.tick_lag * SSthrowing.wait))
|
||||
var/tilestomove = Ceiling(min(((((world.time+world.tick_lag) - start_time) * speed) - (dist_travelled ? dist_travelled : -1)), speed*MAX_TICKS_TO_MAKE_UP) * (world.tick_lag * SSthrowing.wait))
|
||||
while (tilestomove-- > 0)
|
||||
if ((dist_travelled >= maxrange || AM.loc == target_turf) && AM.has_gravity(AM.loc))
|
||||
finalize()
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
#define ROUND_START_MUSIC_LIST "strings/round_start_sounds.txt"
|
||||
|
||||
var/round_start_time = 0
|
||||
|
||||
var/datum/controller/subsystem/ticker/ticker
|
||||
|
||||
/datum/controller/subsystem/ticker
|
||||
SUBSYSTEM_DEF(ticker)
|
||||
name = "Ticker"
|
||||
init_order = 13
|
||||
|
||||
@@ -44,6 +40,8 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
var/timeLeft //pregame timer
|
||||
var/start_at
|
||||
|
||||
var/gametime_offset = 432000 // equal to 12 hours, making gametime at roundstart 12:00:00
|
||||
|
||||
var/totalPlayers = 0 //used for pregame stats on statpanel
|
||||
var/totalPlayersReady = 0 //used for pregame stats on statpanel
|
||||
|
||||
@@ -58,19 +56,19 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
|
||||
var/late_join_disabled
|
||||
|
||||
var/modevoted = FALSE //Have we sent a vote for the gamemode?
|
||||
var/round_start_time = 0
|
||||
var/list/round_start_events
|
||||
|
||||
/datum/controller/subsystem/ticker/New()
|
||||
NEW_SS_GLOBAL(ticker)
|
||||
var/modevoted = FALSE //Have we sent a vote for the gamemode?
|
||||
|
||||
/datum/controller/subsystem/ticker/Initialize(timeofday)
|
||||
var/list/music = file2list(ROUND_START_MUSIC_LIST, "\n")
|
||||
login_music = pick(music)
|
||||
|
||||
if(!syndicate_code_phrase)
|
||||
syndicate_code_phrase = generate_code_phrase()
|
||||
if(!syndicate_code_response)
|
||||
syndicate_code_response = generate_code_phrase()
|
||||
if(!GLOB.syndicate_code_phrase)
|
||||
GLOB.syndicate_code_phrase = generate_code_phrase()
|
||||
if(!GLOB.syndicate_code_response)
|
||||
GLOB.syndicate_code_response = generate_code_phrase()
|
||||
..()
|
||||
start_at = world.time + (config.lobby_countdown * 10)
|
||||
|
||||
@@ -79,7 +77,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
if(GAME_STATE_STARTUP)
|
||||
if(Master.initializations_finished_with_no_players_logged_in)
|
||||
start_at = world.time + (config.lobby_countdown * 10)
|
||||
for(var/client/C in clients)
|
||||
for(var/client/C in GLOB.clients)
|
||||
window_flash(C, ignorepref = TRUE) //let them know lobby has opened up.
|
||||
to_chat(world, "<span class='boldnotice'>Welcome to [station_name()]!</span>")
|
||||
current_state = GAME_STATE_PREGAME
|
||||
@@ -93,7 +91,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
timeLeft = max(0,start_at - world.time)
|
||||
totalPlayers = 0
|
||||
totalPlayersReady = 0
|
||||
for(var/mob/dead/new_player/player in player_list)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
++totalPlayers
|
||||
if(player.ready)
|
||||
++totalPlayersReady
|
||||
@@ -137,15 +135,15 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
var/init_start = world.timeofday
|
||||
//Create and announce mode
|
||||
var/list/datum/game_mode/runnable_modes
|
||||
if(master_mode == "random" || master_mode == "secret")
|
||||
if(GLOB.master_mode == "random" || GLOB.master_mode == "secret")
|
||||
runnable_modes = config.get_runnable_modes()
|
||||
|
||||
if(master_mode == "secret")
|
||||
if(GLOB.master_mode == "secret")
|
||||
hide_mode = 1
|
||||
if(secret_force_mode != "secret")
|
||||
var/datum/game_mode/smode = config.pick_mode(secret_force_mode)
|
||||
if(GLOB.secret_force_mode != "secret")
|
||||
var/datum/game_mode/smode = config.pick_mode(GLOB.secret_force_mode)
|
||||
if(!smode.can_start())
|
||||
message_admins("\blue Unable to force secret [secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.")
|
||||
message_admins("\blue Unable to force secret [GLOB.secret_force_mode]. [smode.required_players] players and [smode.required_enemies] eligible antagonists needed.")
|
||||
else
|
||||
mode = smode
|
||||
|
||||
@@ -156,7 +154,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
mode = pickweight(runnable_modes)
|
||||
|
||||
else
|
||||
mode = config.pick_mode(master_mode)
|
||||
mode = config.pick_mode(GLOB.master_mode)
|
||||
if(!mode.can_start())
|
||||
to_chat(world, "<B>Unable to start [mode.name].</B> Not enough players, [mode.required_players] players and [mode.required_enemies] eligible antagonists needed. Reverting to pre-game lobby.")
|
||||
qdel(mode)
|
||||
@@ -172,11 +170,11 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
SSjob.DivideOccupations() //Distribute jobs
|
||||
CHECK_TICK
|
||||
|
||||
if(!Debug2)
|
||||
if(!GLOB.Debug2)
|
||||
if(!can_continue)
|
||||
qdel(mode)
|
||||
mode = null
|
||||
to_chat(world, "<B>Error setting up [master_mode].</B> Reverting to pre-game lobby.")
|
||||
to_chat(world, "<B>Error setting up [GLOB.master_mode].</B> Reverting to pre-game lobby.")
|
||||
SSjob.ResetOccupations()
|
||||
return 0
|
||||
else
|
||||
@@ -196,19 +194,24 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
toggle_ooc(0) // Turn it off
|
||||
|
||||
CHECK_TICK
|
||||
start_landmarks_list = shuffle(start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left
|
||||
GLOB.start_landmarks_list = shuffle(GLOB.start_landmarks_list) //Shuffle the order of spawn points so they dont always predictably spawn bottom-up and right-to-left
|
||||
create_characters() //Create player characters
|
||||
collect_minds()
|
||||
equip_characters()
|
||||
|
||||
SSoverlays.Flush() //Flush the majority of the shit
|
||||
|
||||
data_core.manifest()
|
||||
GLOB.data_core.manifest()
|
||||
|
||||
transfer_characters() //transfer keys to the new mobs
|
||||
|
||||
Master.RoundStart() //let the party begin...
|
||||
|
||||
for(var/I in round_start_events)
|
||||
var/datum/callback/cb = I
|
||||
cb.InvokeAsync()
|
||||
LAZYCLEARLIST(round_start_events)
|
||||
|
||||
log_world("Game start took [(world.timeofday - init_start)/10]s")
|
||||
round_start_time = world.time
|
||||
|
||||
@@ -217,10 +220,10 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
|
||||
current_state = GAME_STATE_PLAYING
|
||||
|
||||
if(SSevent.holidays)
|
||||
if(SSevents.holidays)
|
||||
to_chat(world, "<font color='blue'>and...</font>")
|
||||
for(var/holidayname in SSevent.holidays)
|
||||
var/datum/holiday/holiday = SSevent.holidays[holidayname]
|
||||
for(var/holidayname in SSevents.holidays)
|
||||
var/datum/holiday/holiday = SSevents.holidays[holidayname]
|
||||
to_chat(world, "<h4>[holiday.greet()]</h4>")
|
||||
|
||||
PostSetup()
|
||||
@@ -231,7 +234,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
set waitfor = 0
|
||||
mode.post_setup()
|
||||
//Cleanup some stuff
|
||||
for(var/obj/effect/landmark/start/S in landmarks_list)
|
||||
for(var/obj/effect/landmark/start/S in GLOB.landmarks_list)
|
||||
//Deleting Startpoints but we need the ai point to AI-ize people later
|
||||
if(S.name != "AI")
|
||||
qdel(S)
|
||||
@@ -240,6 +243,12 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
var/list/allmins = adm["present"]
|
||||
send2irc("Server", "Round of [hide_mode ? "secret":"[mode.name]"] has started[allmins.len ? ".":" with no active admins online!"]")
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/OnRoundstart(datum/callback/cb)
|
||||
if(current_state < GAME_STATE_PLAYING)
|
||||
LAZYADD(round_start_events, cb)
|
||||
else
|
||||
cb.InvokeAsync()
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/station_explosion_detonation(atom/bomb)
|
||||
if(bomb) //BOOM
|
||||
var/turf/epi = bomb.loc
|
||||
@@ -252,7 +261,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
if( cinematic )
|
||||
return //already a cinematic in progress!
|
||||
|
||||
for (var/datum/html_interface/hi in html_interfaces)
|
||||
for (var/datum/html_interface/hi in GLOB.html_interfaces)
|
||||
hi.closeAll()
|
||||
SStgui.close_all_uis()
|
||||
|
||||
@@ -264,7 +273,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
//initialise our cinematic screen object
|
||||
cinematic = new /obj/screen{icon='icons/effects/station_explosion.dmi';icon_state="station_intact";layer=21;mouse_opacity=0;screen_loc="1,0";}(src)
|
||||
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
M.notransform = TRUE //stop everything moving
|
||||
if(M.client)
|
||||
M.client.screen += cinematic //show every client the cinematic
|
||||
@@ -366,30 +375,30 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
if(cinematic)
|
||||
qdel(cinematic) //end the cinematic
|
||||
cinematic = null
|
||||
for(var/mob/M in mob_list)
|
||||
for(var/mob/M in GLOB.mob_list)
|
||||
M.notransform = FALSE
|
||||
if(actually_blew_up && !isnull(killz) && M.stat != DEAD && M.z == killz)
|
||||
M.gib()
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/create_characters()
|
||||
for(var/mob/dead/new_player/player in player_list)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
if(player.ready && player.mind)
|
||||
joined_player_list += player.ckey
|
||||
GLOB.joined_player_list += player.ckey
|
||||
player.create_character(FALSE)
|
||||
else
|
||||
player.new_player_panel()
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/collect_minds()
|
||||
for(var/mob/dead/new_player/P in player_list)
|
||||
for(var/mob/dead/new_player/P in GLOB.player_list)
|
||||
if(P.new_character && P.new_character.mind)
|
||||
ticker.minds += P.new_character.mind
|
||||
SSticker.minds += P.new_character.mind
|
||||
CHECK_TICK
|
||||
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/equip_characters()
|
||||
var/captainless=1
|
||||
for(var/mob/dead/new_player/N in player_list)
|
||||
for(var/mob/dead/new_player/N in GLOB.player_list)
|
||||
var/mob/living/carbon/human/player = N.new_character
|
||||
if(istype(player) && player.mind && player.mind.assigned_role)
|
||||
if(player.mind.assigned_role == "Captain")
|
||||
@@ -398,14 +407,14 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
SSjob.EquipRank(N, player.mind.assigned_role, 0)
|
||||
CHECK_TICK
|
||||
if(captainless)
|
||||
for(var/mob/dead/new_player/N in player_list)
|
||||
for(var/mob/dead/new_player/N in GLOB.player_list)
|
||||
if(N.new_character)
|
||||
to_chat(N, "Captainship not forced on anyone.")
|
||||
CHECK_TICK
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/transfer_characters()
|
||||
var/list/livings = list()
|
||||
for(var/mob/dead/new_player/player in player_list)
|
||||
for(var/mob/dead/new_player/player in GLOB.player_list)
|
||||
var/mob/living = player.transfer_character()
|
||||
if(living)
|
||||
qdel(player)
|
||||
@@ -432,7 +441,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
to_chat(world, "<BR><BR><BR><FONT size=3><B>The round has ended.</B></FONT>")
|
||||
|
||||
//Player status report
|
||||
for(var/mob/Player in mob_list)
|
||||
for(var/mob/Player in GLOB.mob_list)
|
||||
if(Player.mind && !isnewplayer(Player))
|
||||
if(Player.stat != DEAD && !isbrain(Player))
|
||||
num_survivors++
|
||||
@@ -457,28 +466,28 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
//Round statistics report
|
||||
var/datum/station_state/end_state = new /datum/station_state()
|
||||
end_state.count()
|
||||
var/station_integrity = min(PERCENT(start_state.score(end_state)), 100)
|
||||
var/station_integrity = min(PERCENT(GLOB.start_state.score(end_state)), 100)
|
||||
|
||||
to_chat(world, "<BR>[TAB]Shift Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B>")
|
||||
to_chat(world, "<BR>[TAB]Station Integrity: <B>[mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "[station_integrity]%"]</B>")
|
||||
to_chat(world, "<BR>[GLOB.TAB]Shift Duration: <B>[round(world.time / 36000)]:[add_zero("[world.time / 600 % 60]", 2)]:[world.time / 100 % 6][world.time / 100 % 10]</B>")
|
||||
to_chat(world, "<BR>[GLOB.TAB]Station Integrity: <B>[mode.station_was_nuked ? "<font color='red'>Destroyed</font>" : "[station_integrity]%"]</B>")
|
||||
if(mode.station_was_nuked)
|
||||
ticker.news_report = STATION_DESTROYED_NUKE
|
||||
var/total_players = joined_player_list.len
|
||||
if(joined_player_list.len)
|
||||
to_chat(world, "<BR>[TAB]Total Population: <B>[total_players]</B>")
|
||||
SSticker.news_report = STATION_DESTROYED_NUKE
|
||||
var/total_players = GLOB.joined_player_list.len
|
||||
if(total_players)
|
||||
to_chat(world, "<BR>[GLOB.TAB]Total Population: <B>[total_players]</B>")
|
||||
if(station_evacuated)
|
||||
to_chat(world, "<BR>[TAB]Evacuation Rate: <B>[num_escapees] ([PERCENT(num_escapees/total_players)]%)</B>")
|
||||
to_chat(world, "<BR>[TAB](on emergency shuttle): <B>[num_shuttle_escapees] ([PERCENT(num_shuttle_escapees/total_players)]%)</B>")
|
||||
to_chat(world, "<BR>[GLOB.TAB]Evacuation Rate: <B>[num_escapees] ([PERCENT(num_escapees/total_players)]%)</B>")
|
||||
to_chat(world, "<BR>[GLOB.TAB](on emergency shuttle): <B>[num_shuttle_escapees] ([PERCENT(num_shuttle_escapees/total_players)]%)</B>")
|
||||
news_report = STATION_EVACUATED
|
||||
if(SSshuttle.emergency.is_hijacked())
|
||||
news_report = SHUTTLE_HIJACK
|
||||
to_chat(world, "<BR>[TAB]Survival Rate: <B>[num_survivors] ([PERCENT(num_survivors/total_players)]%)</B>")
|
||||
to_chat(world, "<BR>[GLOB.TAB]Survival Rate: <B>[num_survivors] ([PERCENT(num_survivors/total_players)]%)</B>")
|
||||
to_chat(world, "<BR>")
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
//Silicon laws report
|
||||
for (var/mob/living/silicon/ai/aiPlayer in mob_list)
|
||||
for (var/mob/living/silicon/ai/aiPlayer in GLOB.mob_list)
|
||||
if (aiPlayer.stat != 2 && aiPlayer.mind)
|
||||
to_chat(world, "<b>[aiPlayer.name] (Played by: [aiPlayer.mind.key])'s laws at the end of the round were:</b>")
|
||||
aiPlayer.show_laws(1)
|
||||
@@ -497,7 +506,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
|
||||
CHECK_TICK
|
||||
|
||||
for (var/mob/living/silicon/robot/robo in mob_list)
|
||||
for (var/mob/living/silicon/robot/robo in GLOB.mob_list)
|
||||
if (!robo.connected_ai && robo.mind)
|
||||
if (robo.stat != 2)
|
||||
to_chat(world, "<b>[robo.name] (Played by: [robo.mind.key]) survived as an AI-less borg! Its laws were:</b>")
|
||||
@@ -548,9 +557,9 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
|
||||
//Borers
|
||||
var/borerwin = FALSE
|
||||
if(borers.len)
|
||||
if(GLOB.borers.len)
|
||||
var/borertext = "<br><font size=3><b>The borers were:</b></font>"
|
||||
for(var/mob/living/simple_animal/borer/B in borers)
|
||||
for(var/mob/living/simple_animal/borer/B in GLOB.borers)
|
||||
if((B.key || B.controlling) && B.stat != DEAD)
|
||||
borertext += "<br>[B.controlling ? B.victim.key : B.key] was [B.truename] ("
|
||||
var/turf/location = get_turf(B)
|
||||
@@ -562,20 +571,20 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
to_chat(world, borertext)
|
||||
|
||||
var/total_borers = 0
|
||||
for(var/mob/living/simple_animal/borer/B in borers)
|
||||
for(var/mob/living/simple_animal/borer/B in GLOB.borers)
|
||||
if((B.key || B.victim) && B.stat != DEAD)
|
||||
total_borers++
|
||||
if(total_borers)
|
||||
var/total_borer_hosts = 0
|
||||
for(var/mob/living/carbon/C in mob_list)
|
||||
for(var/mob/living/carbon/C in GLOB.mob_list)
|
||||
var/mob/living/simple_animal/borer/D = C.has_brain_worms()
|
||||
var/turf/location = get_turf(C)
|
||||
if(location.z == ZLEVEL_CENTCOM && D && D.stat != DEAD)
|
||||
total_borer_hosts++
|
||||
if(total_borer_hosts_needed <= total_borer_hosts)
|
||||
if(GLOB.total_borer_hosts_needed <= total_borer_hosts)
|
||||
borerwin = TRUE
|
||||
to_chat(world, "<b>There were [total_borers] borers alive at round end!</b>")
|
||||
to_chat(world, "<b>A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [total_borer_hosts_needed] hosts to escape.</b>")
|
||||
to_chat(world, "<b>A total of [total_borer_hosts] borers with hosts escaped on the shuttle alive. The borers needed [GLOB.total_borer_hosts_needed] hosts to escape.</b>")
|
||||
if(borerwin)
|
||||
to_chat(world, "<b><font color='green'>The borers were successful!</font></b>")
|
||||
else
|
||||
@@ -668,43 +677,50 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
SSvote.initiate_vote("roundtype","server")
|
||||
|
||||
/world/proc/has_round_started()
|
||||
if (ticker && ticker.current_state >= GAME_STATE_PLAYING)
|
||||
if (SSticker && SSticker.current_state >= GAME_STATE_PLAYING)
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/datum/controller/subsystem/ticker/Recover()
|
||||
current_state = ticker.current_state
|
||||
force_ending = ticker.force_ending
|
||||
hide_mode = ticker.hide_mode
|
||||
mode = ticker.mode
|
||||
event_time = ticker.event_time
|
||||
event = ticker.event
|
||||
current_state = SSticker.current_state
|
||||
force_ending = SSticker.force_ending
|
||||
hide_mode = SSticker.hide_mode
|
||||
mode = SSticker.mode
|
||||
event_time = SSticker.event_time
|
||||
event = SSticker.event
|
||||
|
||||
login_music = ticker.login_music
|
||||
round_end_sound = ticker.round_end_sound
|
||||
login_music = SSticker.login_music
|
||||
round_end_sound = SSticker.round_end_sound
|
||||
|
||||
minds = ticker.minds
|
||||
minds = SSticker.minds
|
||||
|
||||
syndicate_coalition = ticker.syndicate_coalition
|
||||
factions = ticker.factions
|
||||
availablefactions = ticker.availablefactions
|
||||
syndicate_coalition = SSticker.syndicate_coalition
|
||||
factions = SSticker.factions
|
||||
availablefactions = SSticker.availablefactions
|
||||
|
||||
delay_end = ticker.delay_end
|
||||
delay_end = SSticker.delay_end
|
||||
|
||||
triai = ticker.triai
|
||||
tipped = ticker.tipped
|
||||
selected_tip = ticker.selected_tip
|
||||
triai = SSticker.triai
|
||||
tipped = SSticker.tipped
|
||||
selected_tip = SSticker.selected_tip
|
||||
|
||||
timeLeft = ticker.timeLeft
|
||||
timeLeft = SSticker.timeLeft
|
||||
|
||||
totalPlayers = ticker.totalPlayers
|
||||
totalPlayersReady = ticker.totalPlayersReady
|
||||
totalPlayers = SSticker.totalPlayers
|
||||
totalPlayersReady = SSticker.totalPlayersReady
|
||||
|
||||
queue_delay = ticker.queue_delay
|
||||
queued_players = ticker.queued_players
|
||||
cinematic = ticker.cinematic
|
||||
maprotatechecked = ticker.maprotatechecked
|
||||
modevoted = ticker.modevoted
|
||||
queue_delay = SSticker.queue_delay
|
||||
queued_players = SSticker.queued_players
|
||||
cinematic = SSticker.cinematic
|
||||
maprotatechecked = SSticker.maprotatechecked
|
||||
round_start_time = SSticker.round_start_time
|
||||
|
||||
queue_delay = SSticker.queue_delay
|
||||
queued_players = SSticker.queued_players
|
||||
cinematic = SSticker.cinematic
|
||||
maprotatechecked = SSticker.maprotatechecked
|
||||
|
||||
modevoted = SSticker.modevoted
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/send_news_report()
|
||||
var/news_message
|
||||
@@ -759,7 +775,7 @@ var/datum/controller/subsystem/ticker/ticker
|
||||
send2otherserver(news_source, news_message,"News_Report")
|
||||
|
||||
/datum/controller/subsystem/ticker/proc/GetTimeLeft()
|
||||
if(isnull(ticker.timeLeft))
|
||||
if(isnull(SSticker.timeLeft))
|
||||
return max(0, start_at - world.time)
|
||||
return timeLeft
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
var/datum/controller/subsystem/time_track/SStime_track
|
||||
|
||||
/datum/controller/subsystem/time_track
|
||||
SUBSYSTEM_DEF(time_track)
|
||||
name = "Time Tracking"
|
||||
wait = 600
|
||||
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY
|
||||
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY|SS_NO_TICK_CHECK
|
||||
|
||||
var/time_dilation_current = 0
|
||||
|
||||
@@ -17,9 +15,6 @@ var/datum/controller/subsystem/time_track/SStime_track
|
||||
var/last_tick_byond_time = 0
|
||||
var/last_tick_tickcount = 0
|
||||
|
||||
/datum/controller/subsystem/time_track/New()
|
||||
NEW_SS_GLOBAL(SStime_track)
|
||||
|
||||
/datum/controller/subsystem/time_track/fire()
|
||||
|
||||
var/current_realtime = REALTIMEOFDAY
|
||||
@@ -1,44 +1,69 @@
|
||||
#define BUCKET_LEN (world.fps*1*60) //how many ticks should we keep in the bucket. (1 minutes worth)
|
||||
#define BUCKET_POS(timer) (round((timer.timeToRun - SStimer.head_offset) / world.tick_lag) + 1)
|
||||
var/datum/controller/subsystem/timer/SStimer
|
||||
|
||||
/datum/controller/subsystem/timer
|
||||
SUBSYSTEM_DEF(timer)
|
||||
name = "Timer"
|
||||
wait = 1 //SS_TICKER subsystem, so wait is in ticks
|
||||
init_order = 1
|
||||
|
||||
flags = SS_FIRE_IN_LOBBY|SS_TICKER|SS_NO_INIT
|
||||
|
||||
var/list/datum/timedevent/processing
|
||||
var/list/hashes
|
||||
var/list/datum/timedevent/processing = list()
|
||||
var/list/hashes = list()
|
||||
|
||||
var/head_offset = 0 //world.time of the first entry in the the bucket.
|
||||
var/practical_offset = 0 //index of the first non-empty item in the bucket.
|
||||
var/bucket_resolution = 0 //world.tick_lag the bucket was designed for
|
||||
var/bucket_count = 0 //how many timers are in the buckets
|
||||
|
||||
var/list/bucket_list //list of buckets, each bucket holds every timer that has to run that byond tick.
|
||||
var/list/bucket_list = list() //list of buckets, each bucket holds every timer that has to run that byond tick.
|
||||
|
||||
var/list/timer_id_dict //list of all active timers assoicated to their timer id (for easy lookup)
|
||||
var/list/timer_id_dict = list() //list of all active timers assoicated to their timer id (for easy lookup)
|
||||
|
||||
var/list/clienttime_timers //special snowflake timers that run on fancy pansy "client time"
|
||||
|
||||
|
||||
/datum/controller/subsystem/timer/New()
|
||||
processing = list()
|
||||
hashes = list()
|
||||
bucket_list = list()
|
||||
timer_id_dict = list()
|
||||
|
||||
clienttime_timers = list()
|
||||
|
||||
NEW_SS_GLOBAL(SStimer)
|
||||
var/list/clienttime_timers = list() //special snowflake timers that run on fancy pansy "client time"
|
||||
|
||||
var/last_invoke_tick = 0
|
||||
var/static/last_invoke_warning = 0
|
||||
var/static/bucket_auto_reset = TRUE
|
||||
|
||||
/datum/controller/subsystem/timer/stat_entry(msg)
|
||||
..("B:[bucket_count] P:[length(processing)] H:[length(hashes)] C:[length(clienttime_timers)]")
|
||||
|
||||
/datum/controller/subsystem/timer/fire(resumed = FALSE)
|
||||
var/lit = last_invoke_tick
|
||||
var/last_check = world.time - TIMER_NO_INVOKE_WARNING
|
||||
|
||||
if(!bucket_count)
|
||||
last_invoke_tick = world.time
|
||||
|
||||
if(lit && lit < last_check && last_invoke_warning < last_check)
|
||||
last_invoke_warning = world.time
|
||||
var/msg = "No regular timers processed in the last [TIMER_NO_INVOKE_WARNING] ticks[bucket_auto_reset ? ", resetting buckets" : ""]!"
|
||||
message_admins(msg)
|
||||
WARNING(msg)
|
||||
if(bucket_auto_reset)
|
||||
bucket_resolution = 0
|
||||
|
||||
log_world("Active timers at tick [world.time]:")
|
||||
for(var/I in processing)
|
||||
var/datum/timedevent/TE = I
|
||||
msg = "Timer: [TE.id]: TTR: [TE.timeToRun], Flags: [TE.flags], "
|
||||
if(TE.spent)
|
||||
msg += "SPENT"
|
||||
else
|
||||
var/datum/callback/CB = TE.callBack
|
||||
msg += "callBack: "
|
||||
if(CB.object == GLOBAL_PROC)
|
||||
msg += "GP: [CB.delegate]"
|
||||
else
|
||||
msg += "[!QDELETED(CB.object) ? CB.object : "SRC DELETED"]: [CB.delegate]("
|
||||
var/first = TRUE
|
||||
for(var/J in CB.arguments)
|
||||
msg += "[first ? "" : ", "][J]"
|
||||
first = FALSE
|
||||
msg += ")"
|
||||
log_world(msg)
|
||||
|
||||
while(length(clienttime_timers))
|
||||
var/datum/timedevent/ctime_timer = clienttime_timers[clienttime_timers.len]
|
||||
if (ctime_timer.timeToRun <= REALTIMEOFDAY)
|
||||
@@ -79,17 +104,15 @@ var/datum/controller/subsystem/timer/SStimer
|
||||
do
|
||||
var/datum/callback/callBack = timer.callBack
|
||||
if (!callBack)
|
||||
message_admins("The timer SS has crashed because a timer did not return a callback. MC restarted automatically. Timer hash: [timer.hash]")
|
||||
qdel(timer)
|
||||
bucket_resolution = null //force bucket recreation
|
||||
Recreate_MC()
|
||||
//I really don't know if I should keep this crash log in; I feel like it might cause problems.
|
||||
// CRASH("Invalid timer: timer.timeToRun=[timer.timeToRun]||QDELETED(timer)=[QDELETED(timer)]||world.time=[world.time]||head_offset=[head_offset]||practical_offset=[practical_offset]||timer.spent=[timer.spent]")
|
||||
CRASH("Invalid timer: timer.timeToRun=[timer.timeToRun]||QDELETED(timer)=[QDELETED(timer)]||world.time=[world.time]||head_offset=[head_offset]||practical_offset=[practical_offset]||timer.spent=[timer.spent]")
|
||||
|
||||
if (!timer.spent)
|
||||
spent += timer
|
||||
timer.spent = TRUE
|
||||
callBack.InvokeAsync()
|
||||
last_invoke_tick = world.time
|
||||
|
||||
timer = timer.next
|
||||
|
||||
@@ -303,7 +326,7 @@ var/datum/controller/subsystem/timer/SStimer
|
||||
prev = null
|
||||
return QDEL_HINT_IWILLGC
|
||||
|
||||
proc/addtimer(datum/callback/callback, wait, flags)
|
||||
/proc/addtimer(datum/callback/callback, wait, flags)
|
||||
if (!callback)
|
||||
return
|
||||
|
||||
|
||||
61
code/controllers/subsystem/title.dm
Normal file
61
code/controllers/subsystem/title.dm
Normal file
@@ -0,0 +1,61 @@
|
||||
SUBSYSTEM_DEF(title)
|
||||
name = "Title Screen"
|
||||
flags = SS_NO_FIRE|SS_NO_INIT
|
||||
|
||||
var/file_path
|
||||
var/icon/icon
|
||||
var/icon/previous_icon
|
||||
var/turf/closed/indestructible/splashscreen/splash_turf
|
||||
|
||||
/datum/controller/subsystem/title/PreInit()
|
||||
if(file_path && icon)
|
||||
return
|
||||
|
||||
if(fexists("data/previous_title.dat"))
|
||||
var/previous_path = file2text("data/previous_title.dat")
|
||||
if(istext(previous_path))
|
||||
previous_icon = new(previous_icon)
|
||||
fdel("data/previous_title.dat")
|
||||
|
||||
var/list/provisional_title_screens = flist("config/title_screens/images/")
|
||||
var/list/title_screens = list()
|
||||
var/use_rare_screens = prob(1)
|
||||
|
||||
for(var/S in provisional_title_screens)
|
||||
var/list/L = splittext(S,"+")
|
||||
if((L.len == 1 && L[1] != "blank.png")|| (L.len > 1 && ((use_rare_screens && lowertext(L[1]) == "rare") || (lowertext(L[1]) == lowertext(SSmapping.config.map_name)))))
|
||||
title_screens += S
|
||||
|
||||
if(!isemptylist(title_screens))
|
||||
if(length(title_screens) > 1)
|
||||
for(var/S in title_screens)
|
||||
var/list/L = splittext(S,".")
|
||||
if(L.len != 2 || L[1] != "default")
|
||||
continue
|
||||
title_screens -= S
|
||||
break
|
||||
|
||||
file_path = "config/title_screens/images/[pick(title_screens)]"
|
||||
icon = new(file_path)
|
||||
|
||||
if(splash_turf)
|
||||
splash_turf.icon = icon
|
||||
|
||||
/datum/controller/subsystem/title/vv_edit_var(var_name, var_value)
|
||||
. = ..()
|
||||
if(.)
|
||||
switch(var_name)
|
||||
if("icon")
|
||||
if(splash_turf)
|
||||
splash_turf.icon = icon
|
||||
|
||||
/datum/controller/subsystem/title/Shutdown()
|
||||
if(file_path)
|
||||
var/F = file("data/previous_title.dat")
|
||||
F << file_path
|
||||
|
||||
/datum/controller/subsystem/title/Recover()
|
||||
icon = SStitle.icon
|
||||
splash_turf = SStitle.splash_turf
|
||||
file_path = SStitle.file_path
|
||||
previous_icon = SStitle.previous_icon
|
||||
@@ -1,39 +0,0 @@
|
||||
var/datum/controller/subsystem/title/SStitle
|
||||
|
||||
/datum/controller/subsystem/title
|
||||
name = "Title Screen"
|
||||
init_order = 15
|
||||
flags = SS_NO_FIRE
|
||||
var/turf/closed/indestructible/splashscreen/title_screen
|
||||
|
||||
/datum/controller/subsystem/title/New()
|
||||
NEW_SS_GLOBAL(SStitle)
|
||||
|
||||
/datum/controller/subsystem/title/Initialize()
|
||||
var/list/provisional_title_screens = flist("config/title_screens/images/")
|
||||
var/list/title_screens = list()
|
||||
var/use_rare_screens = FALSE
|
||||
|
||||
if(title_screen)
|
||||
if(prob(1))
|
||||
use_rare_screens = TRUE
|
||||
|
||||
for(var/S in provisional_title_screens)
|
||||
var/list/L = splittext(S,"+")
|
||||
if((L.len == 1 && L[1] != "blank.png")|| (L.len > 1 && ((use_rare_screens && lowertext(L[1]) == "rare") || (lowertext(L[1]) == lowertext(SSmapping.config.map_name)))))
|
||||
title_screens += S
|
||||
|
||||
if(!isemptylist(title_screens))
|
||||
if(length(title_screens) > 1)
|
||||
for(var/S in title_screens)
|
||||
var/list/L = splittext(S,".")
|
||||
if(L.len != 2 || L[1] != "default")
|
||||
continue
|
||||
title_screens -= S
|
||||
break
|
||||
|
||||
var/path_string = "config/title_screens/images/[pick(title_screens)]"
|
||||
var/icon/screen_to_use = new(path_string)
|
||||
|
||||
title_screen.icon = screen_to_use
|
||||
..()
|
||||
@@ -1,6 +1,4 @@
|
||||
var/datum/controller/subsystem/vote/SSvote
|
||||
|
||||
/datum/controller/subsystem/vote
|
||||
SUBSYSTEM_DEF(vote)
|
||||
name = "Vote"
|
||||
wait = 10
|
||||
|
||||
@@ -16,9 +14,6 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
var/list/voting = list()
|
||||
var/list/generated_actions = list()
|
||||
|
||||
/datum/controller/subsystem/vote/New()
|
||||
NEW_SS_GLOBAL(SSvote)
|
||||
|
||||
/datum/controller/subsystem/vote/fire() //called by master_controller
|
||||
if(mode)
|
||||
time_remaining = round((started_time + config.vote_period - world.time)/10)
|
||||
@@ -58,7 +53,7 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
greatest_votes = votes
|
||||
//default-vote for everyone who didn't vote
|
||||
if(!config.vote_no_default && choices.len)
|
||||
var/list/non_voters = directory.Copy()
|
||||
var/list/non_voters = GLOB.directory.Copy()
|
||||
non_voters -= voted
|
||||
for (var/non_voter_ckey in non_voters)
|
||||
var/client/C = non_voters[non_voter_ckey]
|
||||
@@ -70,10 +65,10 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
if(choices["Continue Playing"] >= greatest_votes)
|
||||
greatest_votes = choices["Continue Playing"]
|
||||
else if(mode == "gamemode")
|
||||
if(master_mode in choices)
|
||||
choices[master_mode] += non_voters.len
|
||||
if(choices[master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[master_mode]
|
||||
if(GLOB.master_mode in choices)
|
||||
choices[GLOB.master_mode] += non_voters.len
|
||||
if(choices[GLOB.master_mode] >= greatest_votes)
|
||||
greatest_votes = choices[GLOB.master_mode]
|
||||
//get all options with that many votes and return them in a list
|
||||
. = list()
|
||||
if(greatest_votes)
|
||||
@@ -103,7 +98,7 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
. = pick(winners)
|
||||
text += "\n<b>Vote Result: [.]</b>"
|
||||
else
|
||||
text += "\n<b>Did not vote:</b> [clients.len-voted.len]"
|
||||
text += "\n<b>Did not vote:</b> [GLOB.clients.len-voted.len]"
|
||||
else
|
||||
text += "<b>Vote Result: Inconclusive - No Votes!</b>"
|
||||
log_vote(text)
|
||||
@@ -120,24 +115,15 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
if(. == "Restart Round")
|
||||
restart = 1
|
||||
if("gamemode")
|
||||
if(master_mode != .)
|
||||
if(GLOB.master_mode != .)
|
||||
world.save_mode(.)
|
||||
if(ticker && ticker.mode)
|
||||
if(SSticker && SSticker.mode)
|
||||
restart = 1
|
||||
else
|
||||
master_mode = .
|
||||
|
||||
if("roundtype")
|
||||
if(ticker && ticker.mode)
|
||||
message_admins("A vote has tried to change the gamemode, but the game has already started. Aborting.")
|
||||
else if(master_mode != .)
|
||||
world.save_mode(.)
|
||||
master_mode = .
|
||||
to_chat(world,"<span class='adminnotice'><b>The mode is now: [master_mode]</b></span>")
|
||||
|
||||
GLOB.master_mode = .
|
||||
if(restart)
|
||||
var/active_admins = 0
|
||||
for(var/client/C in admins)
|
||||
for(var/client/C in GLOB.admins)
|
||||
if(!C.is_afk() && check_rights_for(C, R_SERVER))
|
||||
active_admins = 1
|
||||
break
|
||||
@@ -170,7 +156,7 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
|
||||
var/admin = FALSE
|
||||
var/ckey = ckey(initiator_key)
|
||||
if((admin_datums[ckey]) || (ckey in deadmins))
|
||||
if((GLOB.admin_datums[ckey]) || (ckey in GLOB.deadmins))
|
||||
admin = TRUE
|
||||
|
||||
if(next_allowed_time > world.time && !admin)
|
||||
@@ -183,8 +169,6 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
choices.Add("Restart Round","Continue Playing")
|
||||
if("gamemode")
|
||||
choices.Add(config.votable_modes)
|
||||
if("roundtype")
|
||||
choices.Add("secret","extended")
|
||||
if("custom")
|
||||
question = stripped_input(usr,"What is the vote for?")
|
||||
if(!question)
|
||||
@@ -205,7 +189,7 @@ var/datum/controller/subsystem/vote/SSvote
|
||||
log_vote(text)
|
||||
to_chat(world, "\n<font color='purple'><b>[text]</b>\nType <b>vote</b> or click <a href='?src=\ref[src]'>here</a> to place your votes.\nYou have [config.vote_period/10] seconds to vote.</font>")
|
||||
time_remaining = round(config.vote_period/10)
|
||||
for(var/c in clients)
|
||||
for(var/c in GLOB.clients)
|
||||
var/client/C = c
|
||||
var/datum/action/vote/V = new
|
||||
if(question)
|
||||
@@ -1,7 +1,5 @@
|
||||
//Used for all kinds of weather, ex. lavaland ash storms.
|
||||
|
||||
var/datum/controller/subsystem/weather/SSweather
|
||||
/datum/controller/subsystem/weather
|
||||
SUBSYSTEM_DEF(weather)
|
||||
name = "Weather"
|
||||
flags = SS_BACKGROUND
|
||||
wait = 10
|
||||
@@ -9,15 +7,12 @@ var/datum/controller/subsystem/weather/SSweather
|
||||
var/list/existing_weather = list()
|
||||
var/list/eligible_zlevels = list(ZLEVEL_LAVALAND)
|
||||
|
||||
/datum/controller/subsystem/weather/New()
|
||||
NEW_SS_GLOBAL(SSweather)
|
||||
|
||||
/datum/controller/subsystem/weather/fire()
|
||||
for(var/V in processing)
|
||||
var/datum/weather/W = V
|
||||
if(W.aesthetic)
|
||||
continue
|
||||
for(var/mob/living/L in mob_list)
|
||||
for(var/mob/living/L in GLOB.mob_list)
|
||||
if(W.can_impact(L))
|
||||
W.impact(L)
|
||||
for(var/Z in eligible_zlevels)
|
||||
|
||||
Reference in New Issue
Block a user