mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
@@ -24,39 +24,36 @@
|
|||||||
|
|
||||||
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
|
//SubSystem flags (Please design any new flags so that the default is off, to make adding flags to subsystems easier)
|
||||||
|
|
||||||
//subsystem should fire during pre-game lobby.
|
|
||||||
#define SS_FIRE_IN_LOBBY 1
|
|
||||||
|
|
||||||
//subsystem does not initialize.
|
//subsystem does not initialize.
|
||||||
#define SS_NO_INIT 2
|
#define SS_NO_INIT 1
|
||||||
|
|
||||||
//subsystem does not fire.
|
//subsystem does not fire.
|
||||||
// (like can_fire = 0, but keeps it from getting added to the processing subsystems list)
|
// (like can_fire = 0, but keeps it from getting added to the processing subsystems list)
|
||||||
// (Requires a MC restart to change)
|
// (Requires a MC restart to change)
|
||||||
#define SS_NO_FIRE 4
|
#define SS_NO_FIRE 2
|
||||||
|
|
||||||
//subsystem only runs on spare cpu (after all non-background subsystems have ran that tick)
|
//subsystem only runs on spare cpu (after all non-background subsystems have ran that tick)
|
||||||
// SS_BACKGROUND has its own priority bracket
|
// SS_BACKGROUND has its own priority bracket
|
||||||
#define SS_BACKGROUND 8
|
#define SS_BACKGROUND 4
|
||||||
|
|
||||||
//subsystem does not tick check, and should not run unless there is enough time (or its running behind (unless background))
|
//subsystem does not tick check, and should not run unless there is enough time (or its running behind (unless background))
|
||||||
#define SS_NO_TICK_CHECK 16
|
#define SS_NO_TICK_CHECK 8
|
||||||
|
|
||||||
//Treat wait as a tick count, not DS, run every wait ticks.
|
//Treat wait as a tick count, not DS, run every wait ticks.
|
||||||
// (also forces it to run first in the tick, above even SS_NO_TICK_CHECK subsystems)
|
// (also forces it to run first in the tick, above even SS_NO_TICK_CHECK subsystems)
|
||||||
// (implies SS_FIRE_IN_LOBBY because of how it works)
|
// (implies all runlevels because of how it works)
|
||||||
// (overrides SS_BACKGROUND)
|
// (overrides SS_BACKGROUND)
|
||||||
// This is designed for basically anything that works as a mini-mc (like SStimer)
|
// This is designed for basically anything that works as a mini-mc (like SStimer)
|
||||||
#define SS_TICKER 32
|
#define SS_TICKER 16
|
||||||
|
|
||||||
//keep the subsystem's timing on point by firing early if it fired late last fire because of lag
|
//keep the subsystem's timing on point by firing early if it fired late last fire because of lag
|
||||||
// ie: if a 20ds subsystem fires say 5 ds late due to lag or what not, its next fire would be in 15ds, not 20ds.
|
// ie: if a 20ds subsystem fires say 5 ds late due to lag or what not, its next fire would be in 15ds, not 20ds.
|
||||||
#define SS_KEEP_TIMING 64
|
#define SS_KEEP_TIMING 32
|
||||||
|
|
||||||
//Calculate its next fire after its fired.
|
//Calculate its next fire after its fired.
|
||||||
// (IE: if a 5ds wait SS takes 2ds to run, its next fire should be 5ds away, not 3ds like it normally would be)
|
// (IE: if a 5ds wait SS takes 2ds to run, its next fire should be 5ds away, not 3ds like it normally would be)
|
||||||
// This flag overrides SS_KEEP_TIMING
|
// This flag overrides SS_KEEP_TIMING
|
||||||
#define SS_POST_FIRE_TIMING 128
|
#define SS_POST_FIRE_TIMING 64
|
||||||
|
|
||||||
//SUBSYSTEM STATES
|
//SUBSYSTEM STATES
|
||||||
#define SS_IDLE 0 //aint doing shit.
|
#define SS_IDLE 0 //aint doing shit.
|
||||||
|
|||||||
@@ -4,6 +4,8 @@
|
|||||||
#define ALL ~0 //For convenience.
|
#define ALL ~0 //For convenience.
|
||||||
#define NONE 0
|
#define NONE 0
|
||||||
|
|
||||||
|
GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768))
|
||||||
|
|
||||||
//FLAGS BITMASK
|
//FLAGS BITMASK
|
||||||
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere
|
#define STOPSPRESSUREDMAGE 1 //This flag is used on the flags variable for SUIT and HEAD items which stop pressure damage. Note that the flag 1 was previous used as ONBACK, so it is possible for some code to use (flags & 1) when checking if something can be put on your back. Replace this code with (inv_flags & SLOT_BACK) if you see it anywhere
|
||||||
//To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
|
//To successfully stop you taking all pressure damage you must have both a suit and head item with this flag.
|
||||||
|
|||||||
@@ -60,3 +60,13 @@
|
|||||||
#define INIT_ORDER_LIGHTING -20
|
#define INIT_ORDER_LIGHTING -20
|
||||||
#define INIT_ORDER_SQUEAK -40
|
#define INIT_ORDER_SQUEAK -40
|
||||||
#define INIT_ORDER_PERSISTENCE -100
|
#define INIT_ORDER_PERSISTENCE -100
|
||||||
|
|
||||||
|
// SS runlevels
|
||||||
|
|
||||||
|
#define RUNLEVEL_INIT 0
|
||||||
|
#define RUNLEVEL_LOBBY 1
|
||||||
|
#define RUNLEVEL_SETUP 2
|
||||||
|
#define RUNLEVEL_GAME 4
|
||||||
|
#define RUNLEVEL_POSTGAME 8
|
||||||
|
|
||||||
|
#define RUNLEVELS_DEFAULT (RUNLEVEL_SETUP | RUNLEVEL_GAME | RUNLEVEL_POSTGAME)
|
||||||
@@ -47,8 +47,6 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
var/make_runtime = 0
|
var/make_runtime = 0
|
||||||
|
|
||||||
var/initializations_finished_with_no_players_logged_in //I wonder what this could be?
|
var/initializations_finished_with_no_players_logged_in //I wonder what this could be?
|
||||||
// Has round started? (So we know what subsystems to run)
|
|
||||||
var/local_round_started = FALSE //Don't read this var, use SSticker.HasRoundStarted() instead
|
|
||||||
|
|
||||||
// The type of the last subsystem to be process()'d.
|
// The type of the last subsystem to be process()'d.
|
||||||
var/last_type_processed
|
var/last_type_processed
|
||||||
@@ -59,6 +57,8 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
var/queue_priority_count_bg = 0 //Same, but for background subsystems
|
var/queue_priority_count_bg = 0 //Same, but for background subsystems
|
||||||
var/map_loading = FALSE //Are we loading in a new map?
|
var/map_loading = FALSE //Are we loading in a new map?
|
||||||
|
|
||||||
|
var/current_runlevel //for scheduling different subsystems for different stages of the round
|
||||||
|
|
||||||
/datum/controller/master/New()
|
/datum/controller/master/New()
|
||||||
// Highlander-style: there can only be one! Kill off the old and replace it with the new.
|
// Highlander-style: there can only be one! Kill off the old and replace it with the new.
|
||||||
subsystems = list()
|
subsystems = list()
|
||||||
@@ -176,6 +176,8 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
to_chat(world, "<span class='boldannounce'>[msg]</span>")
|
to_chat(world, "<span class='boldannounce'>[msg]</span>")
|
||||||
log_world(msg)
|
log_world(msg)
|
||||||
|
|
||||||
|
SetRunLevel(1)
|
||||||
|
|
||||||
// Sort subsystems by display setting for easy access.
|
// Sort subsystems by display setting for easy access.
|
||||||
sortTim(subsystems, /proc/cmp_subsystem_display)
|
sortTim(subsystems, /proc/cmp_subsystem_display)
|
||||||
// Set world options.
|
// Set world options.
|
||||||
@@ -187,16 +189,9 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
// Loop.
|
// Loop.
|
||||||
Master.StartProcessing(0)
|
Master.StartProcessing(0)
|
||||||
|
|
||||||
// Notify the MC that the round has started.
|
/datum/controller/master/proc/SetRunLevel(runlevel)
|
||||||
/datum/controller/master/proc/RoundStart()
|
testing("MC: Runlevel changed from [isnull(current_runlevel) ? "NULL" : current_runlevel] to [runlevel]")
|
||||||
local_round_started = TRUE
|
current_runlevel = runlevel
|
||||||
var/timer = world.time
|
|
||||||
for (var/datum/controller/subsystem/SS in subsystems)
|
|
||||||
if (SS.flags & SS_FIRE_IN_LOBBY || SS.flags & SS_TICKER)
|
|
||||||
continue //already firing
|
|
||||||
// Stagger subsystems.
|
|
||||||
timer += world.tick_lag * rand(1, 5)
|
|
||||||
SS.next_fire = timer
|
|
||||||
|
|
||||||
// Starts the mc, and sticks around to restart it if the loop ever ends.
|
// Starts the mc, and sticks around to restart it if the loop ever ends.
|
||||||
/datum/controller/master/proc/StartProcessing(delay)
|
/datum/controller/master/proc/StartProcessing(delay)
|
||||||
@@ -221,12 +216,9 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
//Prep the loop (most of this is because we want MC restarts to reset as much state as we can, and because
|
//Prep the loop (most of this is because we want MC restarts to reset as much state as we can, and because
|
||||||
// local vars rock
|
// local vars rock
|
||||||
|
|
||||||
// Schedule the first run of the Subsystems.
|
|
||||||
local_round_started = world.has_round_started()
|
|
||||||
//all this shit is here so that flag edits can be refreshed by restarting the MC. (and for speed)
|
//all this shit is here so that flag edits can be refreshed by restarting the MC. (and for speed)
|
||||||
var/list/tickersubsystems = list()
|
var/list/tickersubsystems = list()
|
||||||
var/list/normalsubsystems = list()
|
var/list/runlevel_sorted_subsystems = list(list()) //ensure we always have at least one runlevel
|
||||||
var/list/lobbysubsystems = list()
|
|
||||||
var/timer = world.time
|
var/timer = world.time
|
||||||
for (var/thing in subsystems)
|
for (var/thing in subsystems)
|
||||||
var/datum/controller/subsystem/SS = thing
|
var/datum/controller/subsystem/SS = thing
|
||||||
@@ -241,25 +233,29 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
timer += world.tick_lag * rand(1, 5)
|
timer += world.tick_lag * rand(1, 5)
|
||||||
SS.next_fire = timer
|
SS.next_fire = timer
|
||||||
continue
|
continue
|
||||||
if (SS.flags & SS_FIRE_IN_LOBBY)
|
|
||||||
lobbysubsystems += SS
|
var/ss_runlevels = SS.runlevels
|
||||||
timer += world.tick_lag * rand(1, 5)
|
var/added_to_any = FALSE
|
||||||
SS.next_fire = timer
|
for(var/I in 1 to GLOB.bitflags.len)
|
||||||
else if (local_round_started)
|
if(ss_runlevels & GLOB.bitflags[I])
|
||||||
timer += world.tick_lag * rand(1, 5)
|
while(runlevel_sorted_subsystems.len < I)
|
||||||
SS.next_fire = timer
|
runlevel_sorted_subsystems += list(list())
|
||||||
normalsubsystems += SS
|
runlevel_sorted_subsystems[I] += SS
|
||||||
|
added_to_any = TRUE
|
||||||
|
if(!added_to_any)
|
||||||
|
WARNING("[SS.name] subsystem is not SS_NO_FIRE but also does not have any runlevels set!")
|
||||||
|
|
||||||
queue_head = null
|
queue_head = null
|
||||||
queue_tail = null
|
queue_tail = null
|
||||||
//these sort by lower priorities first to reduce the number of loops needed to add subsequent SS's to the queue
|
//these sort by lower priorities first to reduce the number of loops needed to add subsequent SS's to the queue
|
||||||
//(higher subsystems will be sooner in the queue, adding them later in the loop means we don't have to loop thru them next queue add)
|
//(higher subsystems will be sooner in the queue, adding them later in the loop means we don't have to loop thru them next queue add)
|
||||||
sortTim(tickersubsystems, /proc/cmp_subsystem_priority)
|
sortTim(tickersubsystems, /proc/cmp_subsystem_priority)
|
||||||
sortTim(normalsubsystems, /proc/cmp_subsystem_priority)
|
for(var/I in runlevel_sorted_subsystems)
|
||||||
sortTim(lobbysubsystems, /proc/cmp_subsystem_priority)
|
sortTim(runlevel_sorted_subsystems, /proc/cmp_subsystem_priority)
|
||||||
|
I += tickersubsystems
|
||||||
normalsubsystems += tickersubsystems
|
|
||||||
lobbysubsystems += tickersubsystems
|
var/cached_runlevel = current_runlevel
|
||||||
|
var/list/current_runlevel_subsystems = runlevel_sorted_subsystems[cached_runlevel]
|
||||||
|
|
||||||
init_timeofday = REALTIMEOFDAY
|
init_timeofday = REALTIMEOFDAY
|
||||||
init_time = world.time
|
init_time = world.time
|
||||||
@@ -296,14 +292,23 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
if (!Failsafe || (Failsafe.processing_interval > 0 && (Failsafe.lasttick+(Failsafe.processing_interval*5)) < world.time))
|
if (!Failsafe || (Failsafe.processing_interval > 0 && (Failsafe.lasttick+(Failsafe.processing_interval*5)) < world.time))
|
||||||
new/datum/controller/failsafe() // (re)Start the failsafe.
|
new/datum/controller/failsafe() // (re)Start the failsafe.
|
||||||
if (!queue_head || !(iteration % 3))
|
if (!queue_head || !(iteration % 3))
|
||||||
if (local_round_started)
|
var/checking_runlevel = current_runlevel
|
||||||
subsystems_to_check = normalsubsystems
|
if(cached_runlevel != checking_runlevel)
|
||||||
else
|
//resechedule subsystems
|
||||||
subsystems_to_check = lobbysubsystems
|
cached_runlevel = checking_runlevel
|
||||||
|
current_runlevel_subsystems = runlevel_sorted_subsystems[cached_runlevel]
|
||||||
|
var/stagger = world.time
|
||||||
|
for(var/I in current_runlevel_subsystems)
|
||||||
|
var/datum/controller/subsystem/SS = I
|
||||||
|
if(SS.next_fire <= world.time)
|
||||||
|
stagger += world.tick_lag * rand(1, 5)
|
||||||
|
SS.next_fire = stagger
|
||||||
|
|
||||||
|
subsystems_to_check = current_runlevel_subsystems
|
||||||
else
|
else
|
||||||
subsystems_to_check = tickersubsystems
|
subsystems_to_check = tickersubsystems
|
||||||
if (CheckQueue(subsystems_to_check) <= 0)
|
if (CheckQueue(subsystems_to_check) <= 0)
|
||||||
if (!SoftReset(tickersubsystems, normalsubsystems, lobbysubsystems))
|
if (!SoftReset(tickersubsystems, runlevel_sorted_subsystems))
|
||||||
log_world("MC: SoftReset() failed, crashing")
|
log_world("MC: SoftReset() failed, crashing")
|
||||||
return
|
return
|
||||||
if (!error_level)
|
if (!error_level)
|
||||||
@@ -315,7 +320,7 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
|
|
||||||
if (queue_head)
|
if (queue_head)
|
||||||
if (RunQueue() <= 0)
|
if (RunQueue() <= 0)
|
||||||
if (!SoftReset(tickersubsystems, normalsubsystems, lobbysubsystems))
|
if (!SoftReset(tickersubsystems, runlevel_sorted_subsystems))
|
||||||
log_world("MC: SoftReset() failed, crashing")
|
log_world("MC: SoftReset() failed, crashing")
|
||||||
return
|
return
|
||||||
if (!error_level)
|
if (!error_level)
|
||||||
@@ -491,13 +496,15 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
|
|
||||||
//resets the queue, and all subsystems, while filtering out the subsystem lists
|
//resets the queue, and all subsystems, while filtering out the subsystem lists
|
||||||
// called if any mc's queue procs runtime or exit improperly.
|
// called if any mc's queue procs runtime or exit improperly.
|
||||||
/datum/controller/master/proc/SoftReset(list/ticker_SS, list/normal_SS, list/lobby_SS)
|
/datum/controller/master/proc/SoftReset(list/ticker_SS, list/runlevel_SS)
|
||||||
. = 0
|
. = 0
|
||||||
log_world("MC: SoftReset called, resetting MC queue state.")
|
log_world("MC: SoftReset called, resetting MC queue state.")
|
||||||
if (!istype(subsystems) || !istype(ticker_SS) || !istype(normal_SS) || !istype(lobby_SS))
|
if (!istype(subsystems) || !istype(ticker_SS) || !istype(runlevel_SS))
|
||||||
log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[ticker_SS]' '[normal_SS]' '[lobby_SS]' Crashing!")
|
log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[ticker_SS]' '[runlevel_SS]'")
|
||||||
return
|
return
|
||||||
var/subsystemstocheck = subsystems + ticker_SS + normal_SS + lobby_SS
|
var/subsystemstocheck = subsystems + ticker_SS
|
||||||
|
for(var/I in runlevel_SS)
|
||||||
|
subsystemstocheck |= I
|
||||||
|
|
||||||
for (var/thing in subsystemstocheck)
|
for (var/thing in subsystemstocheck)
|
||||||
var/datum/controller/subsystem/SS = thing
|
var/datum/controller/subsystem/SS = thing
|
||||||
@@ -505,8 +512,8 @@ GLOBAL_VAR_INIT(CURRENT_TICKLIMIT, TICK_LIMIT_RUNNING)
|
|||||||
//list(SS) is so if a list makes it in the subsystem list, we remove the list, not the contents
|
//list(SS) is so if a list makes it in the subsystem list, we remove the list, not the contents
|
||||||
subsystems -= list(SS)
|
subsystems -= list(SS)
|
||||||
ticker_SS -= list(SS)
|
ticker_SS -= list(SS)
|
||||||
normal_SS -= list(SS)
|
for(var/I in runlevel_SS)
|
||||||
lobby_SS -= list(SS)
|
I -= list(SS)
|
||||||
log_world("MC: SoftReset: Found bad entry in subsystem list, '[SS]'")
|
log_world("MC: SoftReset: Found bad entry in subsystem list, '[SS]'")
|
||||||
continue
|
continue
|
||||||
if (SS.queue_next && !istype(SS.queue_next))
|
if (SS.queue_next && !istype(SS.queue_next))
|
||||||
|
|||||||
@@ -29,6 +29,8 @@
|
|||||||
var/datum/controller/subsystem/queue_next
|
var/datum/controller/subsystem/queue_next
|
||||||
var/datum/controller/subsystem/queue_prev
|
var/datum/controller/subsystem/queue_prev
|
||||||
|
|
||||||
|
var/runlevels = RUNLEVELS_DEFAULT //points of the game at which the SS can fire
|
||||||
|
|
||||||
var/static/failure_strikes = 0 //How many times we suspect this subsystem has crashed the MC, 3 strikes and you're out!
|
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
|
//Do not override
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(acid)
|
|||||||
name = "Acid"
|
name = "Acid"
|
||||||
priority = 40
|
priority = 40
|
||||||
flags = SS_NO_INIT|SS_BACKGROUND
|
flags = SS_NO_INIT|SS_BACKGROUND
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ SUBSYSTEM_DEF(air)
|
|||||||
priority = 20
|
priority = 20
|
||||||
wait = 5
|
wait = 5
|
||||||
flags = SS_BACKGROUND
|
flags = SS_BACKGROUND
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/cost_turfs = 0
|
var/cost_turfs = 0
|
||||||
var/cost_groups = 0
|
var/cost_groups = 0
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
SUBSYSTEM_DEF(augury)
|
SUBSYSTEM_DEF(augury)
|
||||||
name = "Augury"
|
name = "Augury"
|
||||||
flags = SS_NO_INIT
|
flags = SS_NO_INIT
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/watchers = list()
|
var/list/watchers = list()
|
||||||
var/list/doombringers = list()
|
var/list/doombringers = list()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
SUBSYSTEM_DEF(disease)
|
SUBSYSTEM_DEF(disease)
|
||||||
name = "Disease"
|
name = "Disease"
|
||||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
SUBSYSTEM_DEF(events)
|
SUBSYSTEM_DEF(events)
|
||||||
name = "Events"
|
name = "Events"
|
||||||
init_order = INIT_ORDER_EVENTS
|
init_order = INIT_ORDER_EVENTS
|
||||||
|
runlevels = RUNLEVEL_GAME
|
||||||
|
|
||||||
var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
|
var/list/control = list() //list of all datum/round_event_control. Used for selecting events based on weight and occurrences.
|
||||||
var/list/running = list() //list of all existing /datum/round_event
|
var/list/running = list() //list of all existing /datum/round_event
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(fire_burning)
|
|||||||
name = "Fire Burning"
|
name = "Fire Burning"
|
||||||
priority = 40
|
priority = 40
|
||||||
flags = SS_NO_INIT|SS_BACKGROUND
|
flags = SS_NO_INIT|SS_BACKGROUND
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
|
|||||||
@@ -2,7 +2,8 @@ SUBSYSTEM_DEF(garbage)
|
|||||||
name = "Garbage"
|
name = "Garbage"
|
||||||
priority = 15
|
priority = 15
|
||||||
wait = 5
|
wait = 5
|
||||||
flags = SS_FIRE_IN_LOBBY|SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
|
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
|
||||||
|
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY
|
||||||
|
|
||||||
var/collection_timeout = 3000// deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
|
var/collection_timeout = 3000// deciseconds to wait to let running procs finish before we just say fuck it and force del() the object
|
||||||
var/delslasttick = 0 // number of del()'s we've done this tick
|
var/delslasttick = 0 // number of del()'s we've done this tick
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(inbounds)
|
|||||||
name = "Inbounds"
|
name = "Inbounds"
|
||||||
priority = 40
|
priority = 40
|
||||||
flags = SS_NO_INIT
|
flags = SS_NO_INIT
|
||||||
|
runlevels = RUNLEVEL_GAME
|
||||||
|
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ SUBSYSTEM_DEF(mobs)
|
|||||||
name = "Mobs"
|
name = "Mobs"
|
||||||
priority = 100
|
priority = 100
|
||||||
flags = SS_KEEP_TIMING|SS_NO_INIT
|
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ SUBSYSTEM_DEF(npcpool)
|
|||||||
name = "NPC Pool"
|
name = "NPC Pool"
|
||||||
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
flags = SS_POST_FIRE_TIMING|SS_NO_INIT|SS_BACKGROUND
|
||||||
priority = 20
|
priority = 20
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/canBeUsed = list()
|
var/list/canBeUsed = list()
|
||||||
var/list/needsDelegate = list()
|
var/list/needsDelegate = list()
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
SUBSYSTEM_DEF(parallax)
|
SUBSYSTEM_DEF(parallax)
|
||||||
name = "Parallax"
|
name = "Parallax"
|
||||||
wait = 2
|
wait = 2
|
||||||
flags = SS_POST_FIRE_TIMING | SS_FIRE_IN_LOBBY | SS_BACKGROUND | SS_NO_INIT
|
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT
|
||||||
priority = 65
|
priority = 65
|
||||||
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
var/list/currentrun
|
var/list/currentrun
|
||||||
|
|
||||||
/datum/controller/subsystem/parallax/fire(resumed = 0)
|
/datum/controller/subsystem/parallax/fire(resumed = 0)
|
||||||
|
|||||||
@@ -1,9 +1,10 @@
|
|||||||
PROCESSING_SUBSYSTEM_DEF(overlays)
|
PROCESSING_SUBSYSTEM_DEF(overlays)
|
||||||
name = "Overlay"
|
name = "Overlay"
|
||||||
flags = SS_TICKER|SS_FIRE_IN_LOBBY
|
flags = SS_TICKER
|
||||||
wait = 1
|
wait = 1
|
||||||
priority = 500
|
priority = 500
|
||||||
init_order = INIT_ORDER_OVERLAY
|
init_order = INIT_ORDER_OVERLAY
|
||||||
|
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_SETUP
|
||||||
|
|
||||||
stat_tag = "Ov"
|
stat_tag = "Ov"
|
||||||
currentrun = null
|
currentrun = null
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
SUBSYSTEM_DEF(server_maint)
|
SUBSYSTEM_DEF(server_maint)
|
||||||
name = "Server Tasks"
|
name = "Server Tasks"
|
||||||
wait = 6
|
wait = 6
|
||||||
flags = SS_POST_FIRE_TIMING|SS_FIRE_IN_LOBBY
|
flags = SS_POST_FIRE_TIMING
|
||||||
priority = 10
|
priority = 10
|
||||||
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
var/list/currentrun
|
var/list/currentrun
|
||||||
|
|
||||||
/datum/controller/subsystem/server_maint/Initialize(timeofday)
|
/datum/controller/subsystem/server_maint/Initialize(timeofday)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ SUBSYSTEM_DEF(shuttle)
|
|||||||
wait = 10
|
wait = 10
|
||||||
init_order = INIT_ORDER_SHUTTLE
|
init_order = INIT_ORDER_SHUTTLE
|
||||||
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
|
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
|
||||||
|
runlevels = RUNLEVEL_SETUP | RUNLEVEL_GAME
|
||||||
|
|
||||||
var/list/mobile = list()
|
var/list/mobile = list()
|
||||||
var/list/stationary = list()
|
var/list/stationary = list()
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(spacedrift)
|
|||||||
priority = 30
|
priority = 30
|
||||||
wait = 5
|
wait = 5
|
||||||
flags = SS_NO_INIT|SS_KEEP_TIMING
|
flags = SS_NO_INIT|SS_KEEP_TIMING
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
SUBSYSTEM_DEF(tgui)
|
SUBSYSTEM_DEF(tgui)
|
||||||
name = "tgui"
|
name = "tgui"
|
||||||
wait = 9
|
wait = 9
|
||||||
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY
|
flags = SS_NO_INIT
|
||||||
priority = 110
|
priority = 110
|
||||||
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
|
|
||||||
var/list/currentrun = list()
|
var/list/currentrun = list()
|
||||||
var/list/open_uis = list() // A list of open UIs, grouped by src_object and ui_key.
|
var/list/open_uis = list() // A list of open UIs, grouped by src_object and ui_key.
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ SUBSYSTEM_DEF(throwing)
|
|||||||
priority = 25
|
priority = 25
|
||||||
wait = 1
|
wait = 1
|
||||||
flags = SS_NO_INIT|SS_KEEP_TIMING|SS_TICKER
|
flags = SS_NO_INIT|SS_KEEP_TIMING|SS_TICKER
|
||||||
|
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
|
||||||
|
|
||||||
var/list/currentrun
|
var/list/currentrun
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
init_order = INIT_ORDER_TICKER
|
init_order = INIT_ORDER_TICKER
|
||||||
|
|
||||||
priority = 200
|
priority = 200
|
||||||
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING
|
flags = SS_KEEP_TIMING
|
||||||
|
runlevels = RUNLEVEL_LOBBY | RUNLEVEL_SETUP | RUNLEVEL_GAME
|
||||||
|
|
||||||
var/current_state = GAME_STATE_STARTUP //state of current round (used by process()) Use the defines GAME_STATE_* !
|
var/current_state = GAME_STATE_STARTUP //state of current round (used by process()) Use the defines GAME_STATE_* !
|
||||||
var/force_ending = 0 //Round was ended by admin intervention
|
var/force_ending = 0 //Round was ended by admin intervention
|
||||||
@@ -105,6 +106,7 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
|
|
||||||
if(timeLeft <= 0)
|
if(timeLeft <= 0)
|
||||||
current_state = GAME_STATE_SETTING_UP
|
current_state = GAME_STATE_SETTING_UP
|
||||||
|
Master.SetRunLevel(RUNLEVEL_SETUP)
|
||||||
if(start_immediately)
|
if(start_immediately)
|
||||||
fire()
|
fire()
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
if(!setup())
|
if(!setup())
|
||||||
//setup failed
|
//setup failed
|
||||||
current_state = GAME_STATE_STARTUP
|
current_state = GAME_STATE_STARTUP
|
||||||
|
Master.SetRunLevel(RUNLEVEL_LOBBY)
|
||||||
|
|
||||||
if(GAME_STATE_PLAYING)
|
if(GAME_STATE_PLAYING)
|
||||||
mode.process(wait * 0.1)
|
mode.process(wait * 0.1)
|
||||||
@@ -123,6 +126,7 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
current_state = GAME_STATE_FINISHED
|
current_state = GAME_STATE_FINISHED
|
||||||
toggle_ooc(1) // Turn it on
|
toggle_ooc(1) // Turn it on
|
||||||
declare_completion(force_ending)
|
declare_completion(force_ending)
|
||||||
|
Master.SetRunLevel(RUNLEVEL_POSTGAME)
|
||||||
|
|
||||||
/datum/controller/subsystem/ticker/proc/setup()
|
/datum/controller/subsystem/ticker/proc/setup()
|
||||||
to_chat(world, "<span class='boldannounce'>Starting game...</span>")
|
to_chat(world, "<span class='boldannounce'>Starting game...</span>")
|
||||||
@@ -198,8 +202,6 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
GLOB.data_core.manifest()
|
GLOB.data_core.manifest()
|
||||||
|
|
||||||
transfer_characters() //transfer keys to the new mobs
|
transfer_characters() //transfer keys to the new mobs
|
||||||
|
|
||||||
Master.RoundStart() //let the party begin...
|
|
||||||
|
|
||||||
for(var/I in round_start_events)
|
for(var/I in round_start_events)
|
||||||
var/datum/callback/cb = I
|
var/datum/callback/cb = I
|
||||||
@@ -213,6 +215,7 @@ SUBSYSTEM_DEF(ticker)
|
|||||||
world << sound('sound/AI/welcome.ogg')
|
world << sound('sound/AI/welcome.ogg')
|
||||||
|
|
||||||
current_state = GAME_STATE_PLAYING
|
current_state = GAME_STATE_PLAYING
|
||||||
|
Master.SetRunLevel(RUNLEVEL_GAME)
|
||||||
|
|
||||||
if(SSevents.holidays)
|
if(SSevents.holidays)
|
||||||
to_chat(world, "<font color='blue'>and...</font>")
|
to_chat(world, "<font color='blue'>and...</font>")
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
SUBSYSTEM_DEF(time_track)
|
SUBSYSTEM_DEF(time_track)
|
||||||
name = "Time Tracking"
|
name = "Time Tracking"
|
||||||
wait = 600
|
wait = 600
|
||||||
flags = SS_NO_INIT|SS_FIRE_IN_LOBBY|SS_NO_TICK_CHECK
|
flags = SS_NO_INIT|SS_NO_TICK_CHECK
|
||||||
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
|
|
||||||
var/time_dilation_current = 0
|
var/time_dilation_current = 0
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ SUBSYSTEM_DEF(timer)
|
|||||||
wait = 1 //SS_TICKER subsystem, so wait is in ticks
|
wait = 1 //SS_TICKER subsystem, so wait is in ticks
|
||||||
init_order = INIT_ORDER_TIMER
|
init_order = INIT_ORDER_TIMER
|
||||||
|
|
||||||
flags = SS_FIRE_IN_LOBBY|SS_TICKER|SS_NO_INIT
|
flags = SS_TICKER|SS_NO_INIT
|
||||||
|
|
||||||
var/list/datum/timedevent/processing = list()
|
var/list/datum/timedevent/processing = list()
|
||||||
var/list/hashes = list()
|
var/list/hashes = list()
|
||||||
|
|||||||
@@ -2,7 +2,9 @@ SUBSYSTEM_DEF(vote)
|
|||||||
name = "Vote"
|
name = "Vote"
|
||||||
wait = 10
|
wait = 10
|
||||||
|
|
||||||
flags = SS_FIRE_IN_LOBBY|SS_KEEP_TIMING|SS_NO_INIT
|
flags = SS_KEEP_TIMING|SS_NO_INIT
|
||||||
|
|
||||||
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
|
|
||||||
var/initiator = null
|
var/initiator = null
|
||||||
var/started_time = null
|
var/started_time = null
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ SUBSYSTEM_DEF(weather)
|
|||||||
name = "Weather"
|
name = "Weather"
|
||||||
flags = SS_BACKGROUND
|
flags = SS_BACKGROUND
|
||||||
wait = 10
|
wait = 10
|
||||||
|
runlevels = RUNLEVEL_GAME
|
||||||
var/list/processing = list()
|
var/list/processing = list()
|
||||||
var/list/existing_weather = list()
|
var/list/existing_weather = list()
|
||||||
var/list/eligible_zlevels = list(ZLEVEL_LAVALAND)
|
var/list/eligible_zlevels = list(ZLEVEL_LAVALAND)
|
||||||
|
|||||||
@@ -345,7 +345,3 @@
|
|||||||
s += ": [jointext(features, ", ")]"
|
s += ": [jointext(features, ", ")]"
|
||||||
|
|
||||||
status = s
|
status = s
|
||||||
|
|
||||||
|
|
||||||
/world/proc/has_round_started()
|
|
||||||
return SSticker.HasRoundStarted()
|
|
||||||
|
|||||||
Reference in New Issue
Block a user