mirror of
https://github.com/fulpstation/fulpstation.git
synced 2025-12-10 10:01:40 +00:00
Misc: +Fixes unreported issue with initializing lighting on a specific zlevel +Fixes two similar issues with moveElement and moveRange. Where fromIndex or toIndex could be adjusted incorrectly in certain conditions. Potentially causing bad-sorts, or out of bound errors. +Rewrites listclearnulls(list/L) to no longer iterate through L.len elements for every null in the list (plus 1). i.e. went from L.len*(number_of_nulls+1) list-element reads (best-case), to L.len list-element reads (worst-case) +New proc/getElementByVar(list/L, varname, value) which finds the first datum in a list, with a variable named varname, which equals value. You can also feed it atoms instead of lists due to the way the in operator functions. +Fixes an unreported issue with Yota's list2text rewrite. Under certain conditions, the first element would not be converted into a string. Causing type-mismatch runtimes. +New global map_ready variable. This is not fully implemented yet, but will be used to avoid duplicate calls to initialize() for map objects. +All turfs now maintain references to all lights currently illuminating them. This will mean higher memory use unfortunately, due to the huge number of turfs. However, it will speed up updateAffectingLights significantly. I've used list husbandry to reduce baseline memory usage, so it shouldn't be any worse than some past atmos modifications memory-wise. -Removed 'quadratic lighting', can add this back at some point. Sorry. +modified the way lum() works slightly, to allow turfs to have overridden delta-lumen. i.e. space cannot be illuminated more than its default ambiance. This allowed removal of some iffy special-snowflake lighting areas implemented by somebody else. +Lighting images in the dmi can now use arbitrary naming schemes. It is reliant on order now. This allows the dmi to be replaced by simply dropping in a new dmi. -Removed all subtypes of /area/shuttle. Shuttles now create duplicate 'rooms' of /area/shuttle. (More on this later). This will conflict with most maps. Guide on how to fix to follow. +All verbs/tools relating to world.tick_lag were refactored to use world.fps. However old config text for setting tick_lag will still work (it converts the value to fps for you) +MC stats improved using smoothing. They now have their own tab so they dont get in the way when you're playing as an admin. -removed the push_mob_back stuff due to conflicting changes. Sorry Giacom. _OK, NOW THE ACTUAL INTERESTING STUFF_ Following systems moved over to subsystem datums: air_master garbage_manager lighting_controller process_mobs (aka Life()) nanomanager power sun pipenets AFK kick loops shuttle_controller (aka emergency shuttle/pods), supply_shuttle and other shuttles voting bots radio diseases events jobs objects ticker Subsystems hooks and variables should be commented fairly in-depth. If anything isn't particularly clear, please make an issue. Many system-specific global variables have been refactored into All tickers which previously used world.timeofday now use world.time some subsystems can iterate before round start. this resolves the issue with votes not working pregame
43 lines
2.1 KiB
Plaintext
43 lines
2.1 KiB
Plaintext
var/datum/controller/failsafe/Failsafe
|
|
|
|
/datum/controller/failsafe // This thing pretty much just keeps poking the master controller
|
|
var/processing_interval = 100 //poke the MC every 10 seconds - set to 0 to disable
|
|
|
|
var/MC_iteration = 0
|
|
var/MC_defcon = 0 //alert level. For every poke that fails this is raised by 1. When it reaches 5 the MC is replaced with a new one. (effectively killing any master_controller.process() and starting a new one)
|
|
|
|
/datum/controller/failsafe/New()
|
|
//There can be only one failsafe. Out with the old in with the new (that way we can restart the Failsafe by spawning a new one)
|
|
if(Failsafe != src)
|
|
if(istype(Failsafe))
|
|
qdel(Failsafe)
|
|
Failsafe = src
|
|
Failsafe.process()
|
|
|
|
|
|
/datum/controller/failsafe/proc/process()
|
|
spawn(0)
|
|
while(1) //more efficient than recursivly calling ourself over and over. background = 1 ensures we do not trigger an infinite loop
|
|
if(!master_controller) new /datum/controller/game_controller() //replace the missing master_controller! This should never happen.
|
|
|
|
if(processing_interval > 0)
|
|
if(master_controller.processing_interval > 0) //only poke if these overrides aren't in effect
|
|
if(MC_iteration == master_controller.iteration) //master_controller hasn't finished processing in the defined interval
|
|
switch(MC_defcon)
|
|
if(0 to 3)
|
|
++MC_defcon
|
|
if(4)
|
|
admins << "<font color='red' size='2'><b>Warning. The Master Controller has not fired in the last [MC_defcon*processing_interval] ticks. Automatic restart in [processing_interval] ticks.</b></font>"
|
|
MC_defcon = 5
|
|
if(5)
|
|
admins << "<font color='red' size='2'><b>Warning. The Master Controller has still not fired within the last [MC_defcon*processing_interval] ticks. Killing and restarting...</b></font>"
|
|
new /datum/controller/game_controller() //replace the old master_controller (hence killing the old one's process)
|
|
master_controller.process() //Start it rolling again
|
|
MC_defcon = 0
|
|
else
|
|
MC_defcon = 0
|
|
MC_iteration = master_controller.iteration
|
|
sleep(processing_interval)
|
|
else
|
|
MC_defcon = 0
|
|
sleep(100) |