Hopefully fixes conflicts.

This commit is contained in:
Neerti
2020-04-05 17:07:37 -04:00
188 changed files with 2624 additions and 1761 deletions
-42
View File
@@ -1,42 +0,0 @@
// We manually initialize the alarm handlers instead of looping over all existing types
// to make it possible to write: camera.triggerAlarm() rather than alarm_manager.managers[datum/alarm_handler/camera].triggerAlarm() or a variant thereof.
/var/global/datum/alarm_handler/atmosphere/atmosphere_alarm = new()
/var/global/datum/alarm_handler/camera/camera_alarm = new()
/var/global/datum/alarm_handler/fire/fire_alarm = new()
/var/global/datum/alarm_handler/motion/motion_alarm = new()
/var/global/datum/alarm_handler/power/power_alarm = new()
// Alarm Manager, the manager for alarms.
var/datum/controller/process/alarm/alarm_manager
/datum/controller/process/alarm
var/list/datum/alarm/all_handlers = list()
/datum/controller/process/alarm/setup()
name = "alarm"
schedule_interval = 20 // every 2 seconds
all_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm)
alarm_manager = src
/datum/controller/process/alarm/doWork()
for(last_object in all_handlers)
var/datum/alarm_handler/AH = last_object
AH.process()
SCHECK
/datum/controller/process/alarm/proc/active_alarms()
var/list/all_alarms = new
for(var/datum/alarm_handler/AH in all_handlers)
var/list/alarms = AH.alarms
all_alarms += alarms
return all_alarms
/datum/controller/process/alarm/proc/number_of_active_alarms()
var/list/alarms = active_alarms()
return alarms.len
/datum/controller/process/alarm/statProcess()
..()
stat(null, "[number_of_active_alarms()] alarm\s")
-29
View File
@@ -1,29 +0,0 @@
/datum/controller/process/mob
var/tmp/datum/updateQueue/updateQueueInstance
/datum/controller/process/mob/setup()
name = "mob"
schedule_interval = 20 // every 2 seconds
start_delay = 16
/datum/controller/process/mob/started()
..()
if(!mob_list)
mob_list = list()
/datum/controller/process/mob/doWork()
for(last_object in mob_list)
var/mob/M = last_object
if(M && !QDELETED(M))
try
M.Life()
catch(var/exception/e)
catchException(e, M)
SCHECK
else
catchBadType(M)
mob_list -= M
/datum/controller/process/mob/statProcess()
..()
stat(null, "[mob_list.len] mobs")
+2 -2
View File
@@ -5,10 +5,10 @@ datum/controller/transfer_controller
var/currenttick = 0
datum/controller/transfer_controller/New()
timerbuffer = config.vote_autotransfer_initial
START_PROCESSING(SSobj, src)
START_PROCESSING(SSprocessing, src)
datum/controller/transfer_controller/Destroy()
STOP_PROCESSING(SSobj, src)
STOP_PROCESSING(SSprocessing, src)
datum/controller/transfer_controller/process()
currenttick = currenttick + 1
+6 -1
View File
@@ -264,6 +264,10 @@ var/list/gamemode_cache = list()
var/sqlite_feedback_cooldown = 0 // How long one must wait, in days, to submit another feedback form. Used to help prevent spam, especially with privacy active. 0 = No limit.
var/sqlite_feedback_min_age = 0 // Used to block new people from giving feedback. This metric is very bad but it can help slow down spammers.
// disables the annoying "You have already logged in this round, disconnect or be banned" popup for multikeying, because it annoys the shit out of me when testing.
var/disable_cid_warn_popup = FALSE
/datum/configuration/New()
var/list/L = typesof(/datum/game_mode) - /datum/game_mode
for (var/T in L)
@@ -873,7 +877,8 @@ var/list/gamemode_cache = list()
if("sqlite_feedback_cooldown")
config.sqlite_feedback_cooldown = text2num(value)
if("disable_cid_warn_popup")
config.disable_cid_warn_popup = TRUE
else
log_misc("Unknown setting in configuration: '[name]'")
+1 -1
View File
@@ -38,7 +38,7 @@ SUBSYSTEM_DEF(air)
current_cycle = 0
var/simulated_turf_count = 0
for(var/turf/simulated/S in turfs)
for(var/turf/simulated/S in world)
simulated_turf_count++
S.update_air_properties()
CHECK_TICK
+45
View File
@@ -0,0 +1,45 @@
// We manually initialize the alarm handlers instead of looping over all existing types
// to make it possible to write: camera_alarm.triggerAlarm() rather than SSalarm.managers[datum/alarm_handler/camera].triggerAlarm() or a variant thereof.
/var/global/datum/alarm_handler/atmosphere/atmosphere_alarm = new()
/var/global/datum/alarm_handler/camera/camera_alarm = new()
/var/global/datum/alarm_handler/fire/fire_alarm = new()
/var/global/datum/alarm_handler/motion/motion_alarm = new()
/var/global/datum/alarm_handler/power/power_alarm = new()
SUBSYSTEM_DEF(alarm)
name = "Alarm"
wait = 2 SECONDS
priority = FIRE_PRIORITY_ALARM
init_order = INIT_ORDER_ALARM
var/list/datum/alarm/all_handlers
var/tmp/list/currentrun = null
var/static/list/active_alarm_cache = list()
/datum/controller/subsystem/alarm/Initialize()
all_handlers = list(atmosphere_alarm, camera_alarm, fire_alarm, motion_alarm, power_alarm)
. = ..()
/datum/controller/subsystem/alarm/fire(resumed = FALSE)
if(!resumed)
src.currentrun = all_handlers.Copy()
active_alarm_cache.Cut()
var/list/currentrun = src.currentrun // Cache for sanic speed
while (currentrun.len)
var/datum/alarm_handler/AH = currentrun[currentrun.len]
currentrun.len--
AH.process()
active_alarm_cache += AH.alarms
if (MC_TICK_CHECK)
return
/datum/controller/subsystem/alarm/proc/active_alarms()
return active_alarm_cache.Copy()
/datum/controller/subsystem/alarm/proc/number_of_active_alarms()
return active_alarm_cache.len
/datum/controller/subsystem/alarm/stat_entry()
..("[number_of_active_alarms()] alarm\s")
+2 -2
View File
@@ -8,9 +8,9 @@ SUBSYSTEM_DEF(atoms)
init_order = INIT_ORDER_ATOMS
flags = SS_NO_FIRE
var/initialized = INITIALIZATION_INSSATOMS
var/static/initialized = INITIALIZATION_INSSATOMS
// var/list/created_atoms // This is never used, so don't bother. ~Leshana
var/old_initialized
var/static/old_initialized
var/list/late_loaders
var/list/created_atoms
+8 -3
View File
@@ -15,8 +15,7 @@ SUBSYSTEM_DEF(inactivity)
while(client_list.len)
var/client/C = client_list[client_list.len]
client_list.len--
if(!C.holder && C.is_afk(config.kick_inactive MINUTES) && !isobserver(C.mob))
if(C.is_afk(config.kick_inactive MINUTES) && can_kick(C))
to_chat(C, "<span class='warning'>You have been inactive for more than [config.kick_inactive] minute\s and have been disconnected.</span>")
var/information
@@ -34,6 +33,9 @@ SUBSYSTEM_DEF(inactivity)
if(job)
information = " while [job]."
else if(isobserver(C.mob))
information = " while a ghost."
else if(issilicon(C.mob))
information = " while a silicon."
if(isAI(C.mob))
@@ -55,4 +57,7 @@ SUBSYSTEM_DEF(inactivity)
return
/datum/controller/subsystem/inactivity/stat_entry()
..("Kicked: [number_kicked]")
..("Kicked: [number_kicked]")
/datum/controller/subsystem/inactivity/proc/can_kick(var/client/C)
return TRUE
+1 -2
View File
@@ -16,8 +16,7 @@ SUBSYSTEM_DEF(mapping)
if(config.generate_map)
// Map-gen is still very specific to the map, however putting it here should ensure it loads in the correct order.
if(using_map.perform_map_generation())
using_map.refresh_mining_turfs()
using_map.perform_map_generation()
/datum/controller/subsystem/mapping/proc/load_map_templates()
+55
View File
@@ -0,0 +1,55 @@
//
// Mobs Subsystem - Process mob.Life()
//
SUBSYSTEM_DEF(mobs)
name = "Mobs"
priority = 100
wait = 2 SECONDS
flags = SS_KEEP_TIMING|SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
var/list/currentrun = list()
var/log_extensively = FALSE
var/list/timelog = list()
var/list/busy_z_levels = list()
var/slept_mobs = 0
/datum/controller/subsystem/mobs/stat_entry()
..("P: [global.mob_list.len] | S: [slept_mobs]")
/datum/controller/subsystem/mobs/fire(resumed = 0)
var/list/busy_z_levels = src.busy_z_levels
if (!resumed)
slept_mobs = 0
src.currentrun = mob_list.Copy()
busy_z_levels.Cut()
for(var/played_mob in player_list)
if(!played_mob || isobserver(played_mob))
continue
var/mob/pm = played_mob
busy_z_levels |= pm.z
//cache for sanic speed (lists are references anyways)
var/list/currentrun = src.currentrun
var/times_fired = src.times_fired
while(currentrun.len)
var/mob/M = currentrun[currentrun.len]
currentrun.len--
if(QDELETED(M))
mob_list -= M
else
// Right now mob.Life() is unstable enough I think we need to use a try catch.
// Obviously we should try and get rid of this for performance reasons when we can.
try
if(M.low_priority && !(M.z in busy_z_levels))
slept_mobs++
continue
M.Life(times_fired)
catch(var/exception/e)
log_runtime(e, M, "Caught by [name] subsystem")
if (MC_TICK_CHECK)
return
@@ -8,6 +8,14 @@ PROCESSING_SUBSYSTEM_DEF(chemistry)
var/list/chemical_reagents = list()
/datum/controller/subsystem/processing/chemistry/Recover()
log_debug("[name] subsystem Recover().")
if(SSchemistry.current_thing)
log_debug("current_thing was: (\ref[SSchemistry.current_thing])[SSchemistry.current_thing]([SSchemistry.current_thing.type]) - currentrun: [SSchemistry.currentrun.len] vs total: [SSchemistry.processing.len]")
var/list/old_processing = SSchemistry.processing.Copy()
for(var/datum/D in old_processing)
if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING))
processing |= D
chemical_reactions = SSchemistry.chemical_reactions
chemical_reagents = SSchemistry.chemical_reagents
@@ -4,3 +4,12 @@ PROCESSING_SUBSYSTEM_DEF(fastprocess)
name = "Fast Processing"
wait = 2
stat_tag = "FP"
/datum/controller/subsystem/processing/fastprocess/Recover()
log_debug("[name] subsystem Recover().")
if(SSfastprocess.current_thing)
log_debug("current_thing was: (\ref[SSfastprocess.current_thing])[SSfastprocess.current_thing]([SSfastprocess.current_thing.type]) - currentrun: [SSfastprocess.currentrun.len] vs total: [SSfastprocess.processing.len]")
var/list/old_processing = SSfastprocess.processing.Copy()
for(var/datum/D in old_processing)
if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING))
processing |= D
@@ -3,3 +3,14 @@ PROCESSING_SUBSYSTEM_DEF(obj)
priority = FIRE_PRIORITY_OBJ
flags = SS_NO_INIT
wait = 20
/datum/controller/subsystem/processing/obj/Recover()
log_debug("[name] subsystem Recover().")
if(SSobj.current_thing)
log_debug("current_thing was: (\ref[SSobj.current_thing])[SSobj.current_thing]([SSobj.current_thing.type]) - currentrun: [SSobj.currentrun.len] vs total: [SSobj.processing.len]")
var/list/old_processing = SSobj.processing.Copy()
for(var/datum/D in old_processing)
if(!isobj(D))
log_debug("[name] subsystem Recover() found inappropriate item in list: [D.type]")
if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING))
processing |= D
@@ -13,6 +13,16 @@ SUBSYSTEM_DEF(processing)
var/debug_last_thing
var/debug_original_process_proc // initial() does not work with procs
var/datum/current_thing
/datum/controller/subsystem/processing/Recover()
log_debug("[name] subsystem Recover().")
if(SSprocessing.current_thing)
log_debug("current_thing was: (\ref[SSprocessing.current_thing])[SSprocessing.current_thing]([SSprocessing.current_thing.type]) - currentrun: [SSprocessing.currentrun.len] vs total: [SSprocessing.processing.len]")
var/list/old_processing = SSprocessing.processing.Copy()
for(var/datum/D in old_processing)
if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING))
processing |= D
/datum/controller/subsystem/processing/stat_entry()
..("[stat_tag]:[processing.len]")
@@ -24,16 +34,19 @@ SUBSYSTEM_DEF(processing)
var/list/current_run = currentrun
while(current_run.len)
var/datum/thing = current_run[current_run.len]
current_thing = current_run[current_run.len]
current_run.len--
if(QDELETED(thing))
processing -= thing
else if(thing.process(wait) == PROCESS_KILL)
if(QDELETED(current_thing))
processing -= current_thing
else if(current_thing.process(wait) == PROCESS_KILL)
// fully stop so that a future START_PROCESSING will work
STOP_PROCESSING(src, thing)
STOP_PROCESSING(src, current_thing)
if (MC_TICK_CHECK)
current_thing = null
return
current_thing = null
/datum/controller/subsystem/processing/proc/toggle_debug()
if(!check_rights(R_DEBUG))
return
@@ -8,6 +8,15 @@ PROCESSING_SUBSYSTEM_DEF(projectiles)
var/global_pixel_speed = 2
var/global_iterations_per_move = 16
/datum/controller/subsystem/processing/projectiles/Recover()
log_debug("[name] subsystem Recover().")
if(SSprojectiles.current_thing)
log_debug("current_thing was: (\ref[SSprojectiles.current_thing])[SSprojectiles.current_thing]([SSprojectiles.current_thing.type]) - currentrun: [SSprojectiles.currentrun.len] vs total: [SSprojectiles.processing.len]")
var/list/old_processing = SSprojectiles.processing.Copy()
for(var/datum/D in old_processing)
if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING))
processing |= D
/datum/controller/subsystem/processing/projectiles/proc/set_pixel_speed(new_speed)
global_pixel_speed = new_speed
for(var/i in processing)
@@ -1,3 +1,14 @@
PROCESSING_SUBSYSTEM_DEF(turfs)
name = "Turf Processing"
wait = 20
/datum/controller/subsystem/processing/turfs/Recover()
log_debug("[name] subsystem Recover().")
if(SSturfs.current_thing)
log_debug("current_thing was: (\ref[SSturfs.current_thing])[SSturfs.current_thing]([SSturfs.current_thing.type]) - currentrun: [SSturfs.currentrun.len] vs total: [SSturfs.processing.len]")
var/list/old_processing = SSturfs.processing.Copy()
for(var/datum/D in old_processing)
if(!isturf(D))
log_debug("[name] subsystem Recover() found inappropriate item in list: [D.type]")
if(CHECK_BITFIELD(D.datum_flags, DF_ISPROCESSING))
processing |= D
+32
View File
@@ -6,6 +6,38 @@ SUBSYSTEM_DEF(skybox)
flags = SS_NO_FIRE
var/list/skybox_cache = list()
var/list/dust_cache = list()
var/list/speedspace_cache = list()
var/list/phase_shift_by_x = list()
var/list/phase_shift_by_y = list()
/datum/controller/subsystem/skybox/PreInit()
//Static
for (var/i in 0 to 25)
var/image/im = image('icons/turf/space_dust.dmi', "[i]")
im.plane = DUST_PLANE
im.alpha = 128 //80
im.blend_mode = BLEND_ADD
dust_cache["[i]"] = im
//Moving
for (var/i in 0 to 14)
// NORTH/SOUTH
var/image/im = image('icons/turf/space_dust_transit.dmi', "speedspace_ns_[i]")
im.plane = DUST_PLANE
im.blend_mode = BLEND_ADD
speedspace_cache["NS_[i]"] = im
// EAST/WEST
im = image('icons/turf/space_dust_transit.dmi', "speedspace_ew_[i]")
im.plane = DUST_PLANE
im.blend_mode = BLEND_ADD
speedspace_cache["EW_[i]"] = im
//Shuffle some lists
phase_shift_by_x = get_cross_shift_list(15)
phase_shift_by_y = get_cross_shift_list(15)
. = ..()
/datum/controller/subsystem/skybox/Initialize()
. = ..()
+2 -1
View File
@@ -350,7 +350,8 @@ SUBSYSTEM_DEF(vote)
if("cancel")
if(usr.client.holder)
reset()
if("Yes" == alert(usr, "You are about to cancel this vote. Are you sure?", "Cancel Vote", "No", "Yes"))
reset()
if("toggle_restart")
if(usr.client.holder)
config.allow_vote_restart = !config.allow_vote_restart
+1 -1
View File
@@ -30,7 +30,7 @@ SUBSYSTEM_DEF(xenoarch)
. = ..()
/datum/controller/subsystem/xenoarch/proc/SetupXenoarch()
for(var/turf/simulated/mineral/M in turfs)
for(var/turf/simulated/mineral/M in world)
if(!M.density || M.z in using_map.xenoarch_exempt_levels)
continue
-1
View File
@@ -100,7 +100,6 @@
options["LEGACY: transfer_controller"] = transfer_controller
options["LEGACY: gas_data"] = gas_data
options["LEGACY: plant_controller"] = plant_controller
options["LEGACY: alarm_manager"] = alarm_manager
var/pick = input(mob, "Choose a controller to debug/view variables of.", "VV controller:") as null|anything in options
if(!pick)