This commit is contained in:
Cyberboss
2017-03-22 12:11:59 -04:00
parent 7e14ec75fc
commit a801187ede
18 changed files with 21 additions and 47 deletions

View File

@@ -3,7 +3,7 @@
#define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current)) #define MC_AVERAGE_FAST(average, current) (0.7 * (average) + 0.3 * (current))
#define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current)) #define MC_AVERAGE(average, current) (0.8 * (average) + 0.2 * (current))
#define MC_AVERAGE_SLOW(average, current) (0.9 * (average) + 0.1 * (current)) #define MC_AVERAGE_SLOW(average, current) (0.9 * (average) + 0.1 * (current))
#define NEW_SS_GLOBAL2(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;} #define NEW_SS_GLOBAL(varname) if(varname != src){if(istype(varname)){Recover();qdel(varname);}varname = src;}
#define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = 1;Processor.processing += Datum} #define START_PROCESSING(Processor, Datum) if (!Datum.isprocessing) {Datum.isprocessing = 1;Processor.processing += Datum}
#define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = 0;Processor.processing -= Datum #define STOP_PROCESSING(Processor, Datum) Datum.isprocessing = 0;Processor.processing -= Datum
@@ -70,14 +70,14 @@
#define SUBSYSTEM(X) var/datum/controller/subsystem/##X/SS##X;\ #define SUBSYSTEM(X) var/datum/controller/subsystem/##X/SS##X;\
/datum/controller/subsystem/##X/New(){\ /datum/controller/subsystem/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
..();\ ..();\
NEW_SS_GLOBAL2(SS##X);\
}\ }\
/datum/controller/subsystem/##X /datum/controller/subsystem/##X
#define PROCESSING_SUBSYSTEM(X) var/datum/controller/subsystem/processing/##X/SS##X;\ #define PROCESSING_SUBSYSTEM(X) var/datum/controller/subsystem/processing/##X/SS##X;\
/datum/controller/subsystem/processing/##X/New(){\ /datum/controller/subsystem/processing/##X/New(){\
NEW_SS_GLOBAL(SS##X);\
..();\ ..();\
NEW_SS_GLOBAL2(SS##X);\
}\ }\
/datum/controller/subsystem/processing/##X /datum/controller/subsystem/processing/##X

View File

@@ -348,7 +348,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
var/tick_precentage var/tick_precentage
var/tick_remaining var/tick_remaining
var/ran = TRUE //this is right var/ran = TRUE //this is right
var/ran_non_SSticker = FALSE var/ran_non_ticker = FALSE
var/bg_calc //have we swtiched current_tick_budget to background mode yet? var/bg_calc //have we swtiched current_tick_budget to background mode yet?
var/tick_usage var/tick_usage
@@ -372,7 +372,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
//(unless we haven't even ran anything this tick, since its unlikely they will ever be able run //(unless we haven't even ran anything this tick, since its unlikely they will ever be able run
// in those cases, so we just let them run) // in those cases, so we just let them run)
if (queue_node_flags & SS_NO_TICK_CHECK) if (queue_node_flags & SS_NO_TICK_CHECK)
if (queue_node.tick_usage > TICK_LIMIT_RUNNING - world.tick_usage && ran_non_SSticker) if (queue_node.tick_usage > TICK_LIMIT_RUNNING - world.tick_usage && ran_non_ticker)
queue_node.queued_priority += queue_priority_count * 0.10 queue_node.queued_priority += queue_priority_count * 0.10
queue_priority_count -= queue_node_priority queue_priority_count -= queue_node_priority
queue_priority_count += queue_node.queued_priority queue_priority_count += queue_node.queued_priority
@@ -394,7 +394,7 @@ var/CURRENT_TICKLIMIT = TICK_LIMIT_RUNNING
CURRENT_TICKLIMIT = world.tick_usage + tick_precentage CURRENT_TICKLIMIT = world.tick_usage + tick_precentage
if (!(queue_node_flags & SS_TICKER)) if (!(queue_node_flags & SS_TICKER))
ran_non_SSticker = TRUE ran_non_ticker = TRUE
ran = TRUE ran = TRUE
tick_usage = world.tick_usage tick_usage = world.tick_usage
queue_node_paused = (queue_node.state == SS_PAUSED || queue_node.state == SS_PAUSING) queue_node_paused = (queue_node.state == SS_PAUSED || queue_node.state == SS_PAUSING)
@@ -456,20 +456,20 @@ var/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/SSticker_SS, list/normal_SS, list/lobby_SS) /datum/controller/master/proc/SoftReset(list/ticker_SS, list/normal_SS, list/lobby_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(SSticker_SS) || !istype(normal_SS) || !istype(lobby_SS)) if (!istype(subsystems) || !istype(ticker_SS) || !istype(normal_SS) || !istype(lobby_SS))
log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[SSticker_SS]' '[normal_SS]' '[lobby_SS]' Crashing!") log_world("MC: SoftReset: Bad list contents: '[subsystems]' '[ticker_SS]' '[normal_SS]' '[lobby_SS]' Crashing!")
return return
var/subsystemstocheck = subsystems + SSticker_SS + normal_SS + lobby_SS var/subsystemstocheck = subsystems + ticker_SS + normal_SS + lobby_SS
for (var/thing in subsystemstocheck) for (var/thing in subsystemstocheck)
var/datum/controller/subsystem/SS = thing var/datum/controller/subsystem/SS = thing
if (!SS || !istype(SS)) if (!SS || !istype(SS))
//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)
SSticker_SS -= list(SS) ticker_SS -= list(SS)
normal_SS -= list(SS) normal_SS -= list(SS)
lobby_SS -= list(SS) lobby_SS -= list(SS)
log_world("MC: SoftReset: Found bad entry in subsystem list, '[SS]'") log_world("MC: SoftReset: Found bad entry in subsystem list, '[SS]'")

View File

@@ -34,6 +34,7 @@
PreInit() PreInit()
// Used to initialize the subsystem BEFORE the map has loaded // Used to initialize the subsystem BEFORE the map has loaded
// Called AFTER Recover if that is called
// Prefer to use Initialize if possible // Prefer to use Initialize if possible
/datum/controller/subsystem/proc/PreInit() /datum/controller/subsystem/proc/PreInit()
return return

View File

@@ -7,9 +7,6 @@ SUBSYSTEM(augury)
var/list/observers_given_action = list() var/list/observers_given_action = list()
/datum/controller/subsystem/augury/New()
NEW_SS_GLOBAL(SSaugury)
/datum/controller/subsystem/augury/stat_entry(msg) /datum/controller/subsystem/augury/stat_entry(msg)
..("W:[watchers.len]|D:[doombringers.len]") ..("W:[watchers.len]|D:[doombringers.len]")

View File

@@ -8,9 +8,6 @@ SUBSYSTEM(communications)
var/silicon_message_cooldown var/silicon_message_cooldown
var/nonsilicon_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) /datum/controller/subsystem/communications/proc/can_announce(mob/living/user, is_silicon)
if(is_silicon && silicon_message_cooldown > world.time) if(is_silicon && silicon_message_cooldown > world.time)
. = FALSE . = FALSE

View File

@@ -6,10 +6,6 @@ SUBSYSTEM(fire_burning)
var/list/currentrun = list() var/list/currentrun = list()
var/list/processing = list() var/list/processing = list()
/datum/controller/subsystem/fire_burning/New()
NEW_SS_GLOBAL(SSfire_burning)
/datum/controller/subsystem/fire_burning/stat_entry() /datum/controller/subsystem/fire_burning/stat_entry()
..("P:[processing.len]") ..("P:[processing.len]")

View File

@@ -32,9 +32,6 @@ SUBSYSTEM(garbage)
var/list/qdel_list = list() // list of all types that have been qdel()eted var/list/qdel_list = list() // list of all types that have been qdel()eted
#endif #endif
/datum/controller/subsystem/garbage/New()
NEW_SS_GLOBAL(SSgarbage)
/datum/controller/subsystem/garbage/stat_entry(msg) /datum/controller/subsystem/garbage/stat_entry(msg)
msg += "Q:[queue.len]|D:[delslasttick]|G:[gcedlasttick]|" msg += "Q:[queue.len]|D:[delslasttick]|G:[gcedlasttick]|"
msg += "GR:" msg += "GR:"

View File

@@ -7,9 +7,6 @@ SUBSYSTEM(icon_smooth)
var/list/smooth_queue = list() var/list/smooth_queue = list()
/datum/controller/subsystem/icon_smooth/New()
NEW_SS_GLOBAL(SSicon_smooth)
/datum/controller/subsystem/icon_smooth/fire() /datum/controller/subsystem/icon_smooth/fire()
while(smooth_queue.len) while(smooth_queue.len)
var/atom/A = smooth_queue[smooth_queue.len] var/atom/A = smooth_queue[smooth_queue.len]

View File

@@ -6,8 +6,6 @@ SUBSYSTEM(inbounds)
var/list/processing = list() var/list/processing = list()
var/list/currentrun = list() var/list/currentrun = list()
/datum/controller/subsystem/inbounds/New()
NEW_SS_GLOBAL(SSinbounds)
/datum/controller/subsystem/inbounds/stat_entry() /datum/controller/subsystem/inbounds/stat_entry()
..("P:[processing.len]") ..("P:[processing.len]")

View File

@@ -8,9 +8,6 @@ SUBSYSTEM(ipintel)
var/list/cache = list() var/list/cache = list()
/datum/controller/subsystem/ipintel/New()
NEW_SS_GLOBAL(SSipintel)
/datum/controller/subsystem/ipintel/Initialize(timeofday, zlevel) /datum/controller/subsystem/ipintel/Initialize(timeofday, zlevel)
enabled = 1 enabled = 1
. = ..() . = ..()

View File

@@ -1,6 +1,6 @@
//Fires five times every second. //Fires five times every second.
PROCESSING_SUBSYTEM(fastprocess) PROCESSING_SUBSYSTEM(fastprocess)
name = "Fast Processing" name = "Fast Processing"
wait = 2 wait = 2
stat_tag = "FP" stat_tag = "FP"

View File

@@ -1,5 +1,5 @@
PROCESSING_SUBSYTEM(flightpacks) PROCESSING_SUBSYSTEM(flightpacks)
name = "Flightpack Movement" name = "Flightpack Movement"
priority = 30 priority = 30
wait = 2 wait = 2

View File

@@ -1,4 +1,4 @@
PROCESSING_SUBSYTEM(obj) SUBSYSTEM(obj)
name = "Objects" name = "Objects"
priority = 40 priority = 40
flags = SS_NO_INIT flags = SS_NO_INIT

View File

@@ -3,9 +3,6 @@ SUBSYSTEM(server_maint)
wait = 6000 wait = 6000
flags = SS_NO_TICK_CHECK flags = SS_NO_TICK_CHECK
/datum/controller/subsystem/server_maint/New()
NEW_SS_GLOBAL(SSserver)
/datum/controller/subsystem/server_maint/Initialize(timeofday) /datum/controller/subsystem/server_maint/Initialize(timeofday)
if (config.hub) if (config.hub)
world.visibility = 1 world.visibility = 1

View File

@@ -1,4 +1,4 @@
SUBSYTEM(sun) SUBSYSTEM(sun)
name = "Sun" name = "Sun"
wait = 600 wait = 600
init_order = 2 init_order = 2

View File

@@ -14,9 +14,6 @@ SUBSYSTEM(vote)
var/list/voting = list() var/list/voting = list()
var/list/generated_actions = list() var/list/generated_actions = list()
/datum/controller/subsystem/vote/New()
NEW_SS_GLOBAL(SSvote)
/datum/controller/subsystem/vote/fire() //called by master_controller /datum/controller/subsystem/vote/fire() //called by master_controller
if(mode) if(mode)
time_remaining = round((started_time + config.vote_period - world.time)/10) time_remaining = round((started_time + config.vote_period - world.time)/10)

View File

@@ -8,4 +8,4 @@
/datum/round_event/wizard/fake_explosion/start() /datum/round_event/wizard/fake_explosion/start()
for(var/mob/M in player_list) for(var/mob/M in player_list)
M << 'sound/machines/Alarm.ogg' M << 'sound/machines/Alarm.ogg'
addtimer(CALLBACK(SSticker, /datum/controller/subsystem/SSticker/.proc/station_explosion_cinematic, 1, "fake"), 100) //:o) addtimer(CALLBACK(SSticker, /datum/controller/subsystem/ticker/.proc/station_explosion_cinematic, 1, "fake"), 100) //:o)

View File

@@ -32,7 +32,7 @@
var/powerlevel = 0 //Tracks our general strength level gained from eating other shrooms var/powerlevel = 0 //Tracks our general strength level gained from eating other shrooms
var/bruised = 0 //If someone tries to cheat the system by attacking a shroom to lower its health, punish them so that it wont award levels to shrooms that eat it var/bruised = 0 //If someone tries to cheat the system by attacking a shroom to lower its health, punish them so that it wont award levels to shrooms that eat it
var/recovery_cooldown = 0 //So you can't repeatedly revive it during a fight var/recovery_cooldown = 0 //So you can't repeatedly revive it during a fight
var/faint_SSticker = 0 //If we hit three, another mushroom's gonna eat us var/faint_ticker = 0 //If we hit three, another mushroom's gonna eat us
var/image/cap_living = null //Where we store our cap icons so we dont generate them constantly to update our icon var/image/cap_living = null //Where we store our cap icons so we dont generate them constantly to update our icon
var/image/cap_dead = null var/image/cap_dead = null
@@ -74,9 +74,9 @@
/mob/living/simple_animal/hostile/mushroom/attack_animal(mob/living/L) /mob/living/simple_animal/hostile/mushroom/attack_animal(mob/living/L)
if(istype(L, /mob/living/simple_animal/hostile/mushroom) && stat == DEAD) if(istype(L, /mob/living/simple_animal/hostile/mushroom) && stat == DEAD)
var/mob/living/simple_animal/hostile/mushroom/M = L var/mob/living/simple_animal/hostile/mushroom/M = L
if(faint_SSticker < 2) if(faint_ticker < 2)
M.visible_message("[M] chews a bit on [src].") M.visible_message("[M] chews a bit on [src].")
faint_SSticker++ faint_ticker++
return return
M.visible_message("<span class='warning'>[M] devours [src]!</span>") M.visible_message("<span class='warning'>[M] devours [src]!</span>")
var/level_gain = (powerlevel - M.powerlevel) var/level_gain = (powerlevel - M.powerlevel)
@@ -107,7 +107,7 @@
/mob/living/simple_animal/hostile/mushroom/proc/Recover() /mob/living/simple_animal/hostile/mushroom/proc/Recover()
visible_message("[src] slowly begins to recover.") visible_message("[src] slowly begins to recover.")
faint_SSticker = 0 faint_ticker = 0
revive(full_heal = 1) revive(full_heal = 1)
UpdateMushroomCap() UpdateMushroomCap()
recovery_cooldown = 1 recovery_cooldown = 1