Merge pull request #8353 from Glloyd/goonschedu

Goon Process Scheduler for BS12
This commit is contained in:
Chinsky
2015-03-17 10:04:21 +03:00
54 changed files with 2185 additions and 325 deletions

View File

@@ -164,14 +164,14 @@
html += "<div class='block'>"
html += "<h2>Running Events</h2>"
html += "Estimated times, affected by master controller delays."
html += "Estimated times, affected by process scheduler delays."
html += "<table[table_options]>"
html += "<tr><td[row_options1]>Severity</td><td[row_options2]>Name</td><td[row_options1]>Ends At</td><td[row_options1]>Ends In</td><td[row_options3]>Stop</td></tr>"
for(var/datum/event/E in active_events)
if(!E.event_meta)
continue
var/datum/event_meta/EM = E.event_meta
var/ends_at = E.startedAt + (E.lastProcessAt() * master_controller.minimum_ticks) // A best estimate
var/ends_at = E.startedAt + (E.lastProcessAt() * 20) // A best estimate, based on how often the alarm manager processes
var/ends_in = max(0, round((ends_at - world.time) / 600, 0.1))
html += "<tr>"
html += "<td>[severity_to_string[EM.severity]]</td>"

View File

@@ -2,7 +2,7 @@
//NOTE: Breathing happens once per FOUR TICKS, unless the last breath fails. In which case it happens once per ONE TICK! So oxyloss healing is done once per 4 ticks while oxyloss damage is applied once per tick!
#define HUMAN_MAX_OXYLOSS 1 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it.
#define HUMAN_CRIT_MAX_OXYLOSS ( (last_tick_duration) /6) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 50HP to get through, so (1/6)*last_tick_duration per second. Breaths however only happen every 4 ticks.
#define HUMAN_CRIT_MAX_OXYLOSS ( (tickerProcess.getLastTickerTimeDuration()) / 6) //The amount of damage you'll get when in critical condition. We want this to be a 5 minute deal = 300s. There are 50HP to get through, so (1/6)*last_tick_duration per second. Breaths however only happen every 4 ticks.
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 4 //Amount of damage applied when your body temperature passes the 400K point

View File

@@ -792,7 +792,8 @@ note dizziness decrements automatically in the mob's Life() proc.
//reset the pixel offsets to zero
is_floating = 0
/proc/getStatName(var/datum/controller/process/process)
return uppertext(copytext(process.name, 1, 4))
/mob/Stat()
..()
@@ -802,20 +803,49 @@ note dizziness decrements automatically in the mob's Life() proc.
stat(null,"Location:\t([x], [y], [z])")
stat(null,"CPU:\t[world.cpu]")
stat(null,"Instances:\t[world.contents.len]")
if(statpanel("Status") && master_controller)
stat(null,"MasterController-[last_tick_duration] ([master_controller.processing?"On":"Off"]-[controller_iteration])")
stat(null,"Air-[master_controller.air_cost]\tSun-[master_controller.sun_cost]")
stat(null,"Mob-[master_controller.mobs_cost]\t#[mob_list.len]")
stat(null,"Dis-[master_controller.diseases_cost]\t#[active_diseases.len]")
stat(null,"Mch-[master_controller.machines_cost]\t#[machines.len]")
stat(null,"Obj-[master_controller.objects_cost]\t#[processing_objects.len]")
stat(null,"Net-[master_controller.networks_cost]\tPnet-[master_controller.powernets_cost]")
stat(null,"NanoUI-[master_controller.nano_cost]\t#[nanomanager.processing_uis.len]")
stat(null,"Event-[master_controller.events_cost]\t#[event_manager.active_events.len]")
alarm_manager.stat_entry()
stat(null,"Tick-[master_controller.ticker_cost]\tALL-[master_controller.total_cost]")
if(statpanel("Status") && processScheduler.getIsRunning())
var/datum/controller/process/process
process = processScheduler.getProcess("ticker")
stat(null, "[getStatName(process)]\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("air")
stat(null, "[getStatName(process)]\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("lighting")
stat(null, "[getStatName(process)]\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("alarm")
var/list/alarms = alarm_manager.active_alarms()
stat(null, "[getStatName(process)]([alarms.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("mob")
stat(null, "[getStatName(process)]([mob_list.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("machinery")
stat(null, "[getStatName(process)]([machines.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("obj")
stat(null, "[getStatName(process)]([processing_objects.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("pipenet")
stat(null, "[getStatName(process)]([pipe_networks.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("powernet")
stat(null, "[getStatName(process)]([powernets.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("nanoui")
stat(null, "[getStatName(process)]([nanomanager.processing_uis.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("disease")
stat(null, "[getStatName(process)]([active_diseases.len])\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
process = processScheduler.getProcess("sun")
stat(null, "[getStatName(process)]\t - #[process.getTicks()]\t - [process.getLastRunTime()]")
else
stat(null,"MasterController-ERROR")
stat(null, "processScheduler is not running.")
if(listed_turf && client)
if(!TurfAdjacent(listed_turf))