diff --git a/auxmos.dll b/auxmos.dll index 2836acdcf0..d972d96a3c 100644 Binary files a/auxmos.dll and b/auxmos.dll differ diff --git a/auxmos.pdb b/auxmos.pdb index a04c133c01..5bd46395bb 100644 Binary files a/auxmos.pdb and b/auxmos.pdb differ diff --git a/code/__DEFINES/_auxtools.dm b/code/__DEFINES/_auxtools.dm deleted file mode 100644 index fc5dfd4378..0000000000 --- a/code/__DEFINES/_auxtools.dm +++ /dev/null @@ -1,12 +0,0 @@ -#define AUXMOS (world.system_type == MS_WINDOWS ? "auxmos.dll" : __detect_auxmos()) - -/proc/__detect_auxmos() - var/static/known_auxmos_var - if(!known_auxmos_var) - if (fexists("./libauxmos.so")) - known_auxmos_var = "./libauxmos.so" - else if (fexists("[world.GetConfig("env", "HOME")]/.byond/bin/libauxmos.so")) - known_auxmos_var = "[world.GetConfig("env", "HOME")]/.byond/bin/libauxmos.so" - else - CRASH("Could not find libauxmos.so") - return known_auxmos_var diff --git a/code/__DEFINES/bindings.dm b/code/__DEFINES/bindings.dm new file mode 100644 index 0000000000..d1c406c072 --- /dev/null +++ b/code/__DEFINES/bindings.dm @@ -0,0 +1,185 @@ +//THIS FILE IS AUTOMATICALLY GENERATED BY AUXMOS, PLEASE DO NOT TOUCH IT +//PROC DEFINITIONS MAY MOVE AROUND, THIS IS NORMAL + +/* This comment bypasses grep checks */ /var/__auxmos + +/proc/__detect_auxmos() + if (world.system_type == UNIX) + return __auxmos = "libauxmos" + else + return __auxmos = "auxmos" + +#define AUXMOS (__auxmos || __detect_auxmos()) + +/datum/controller/subsystem/air/proc/process_turf_equalize_auxtools(remaining) + return call_ext(AUXMOS, "byond:equalize_hook_ffi")(src, remaining) + +/datum/controller/subsystem/air/proc/process_excited_groups_auxtools(remaining) + return call_ext(AUXMOS, "byond:groups_hook_ffi")(src, remaining) + +/datum/controller/subsystem/air/proc/process_turfs_auxtools(remaining) + return call_ext(AUXMOS, "byond:process_turf_hook_ffi")(src, remaining) + +/datum/controller/subsystem/air/proc/finish_turf_processing_auxtools(time_remaining) + return call_ext(AUXMOS, "byond:finish_process_turfs_ffi")(time_remaining) + +/datum/controller/subsystem/air/proc/thread_running() + return call_ext(AUXMOS, "byond:thread_running_hook_ffi")() + +/turf/proc/__update_auxtools_turf_adjacency_info() + return call_ext(AUXMOS, "byond:hook_infos_ffi")(src) + +/turf/proc/update_air_ref(flag) + return call_ext(AUXMOS, "byond:hook_register_turf_ffi")(src, flag) + +/proc/finalize_gas_refs() + return call_ext(AUXMOS, "byond:finalize_gas_refs_ffi")() + +/datum/controller/subsystem/air/proc/auxtools_update_reactions() + return call_ext(AUXMOS, "byond:update_reactions_ffi")() + +/proc/auxtools_atmos_init(gas_data) + return call_ext(AUXMOS, "byond:hook_init_ffi")(gas_data) + +/proc/_auxtools_register_gas(gas) + return call_ext(AUXMOS, "byond:hook_register_gas_ffi")(gas) + +/datum/gas_mixture/proc/__auxtools_parse_gas_string(string) + return call_ext(AUXMOS, "byond:parse_gas_string_ffi")(src, string) + +/datum/controller/subsystem/air/proc/get_max_gas_mixes() + return call_ext(AUXMOS, "byond:hook_max_gas_mixes_ffi")() + +/datum/controller/subsystem/air/proc/get_amt_gas_mixes() + return call_ext(AUXMOS, "byond:hook_amt_gas_mixes_ffi")() + +/proc/equalize_all_gases_in_list(gas_list) + return call_ext(AUXMOS, "byond:equalize_all_hook_ffi")(gas_list) + +/datum/gas_mixture/proc/get_oxidation_power(temp) + return call_ext(AUXMOS, "byond:oxidation_power_hook_ffi")(src, temp) + +/datum/gas_mixture/proc/get_fuel_amount(temp) + return call_ext(AUXMOS, "byond:fuel_amount_hook_ffi")(src, temp) + +/datum/gas_mixture/proc/equalize_with(total) + return call_ext(AUXMOS, "byond:equalize_with_hook_ffi")(src, total) + +/datum/gas_mixture/proc/transfer_ratio_to(other, ratio) + return call_ext(AUXMOS, "byond:transfer_ratio_hook_ffi")(src, other, ratio) + +/datum/gas_mixture/proc/transfer_to(other, moles) + return call_ext(AUXMOS, "byond:transfer_hook_ffi")(src, other, moles) + +/datum/gas_mixture/proc/adjust_heat(temp) + return call_ext(AUXMOS, "byond:adjust_heat_hook_ffi")(src, temp) + +/datum/gas_mixture/proc/react(holder) + return call_ext(AUXMOS, "byond:react_hook_ffi")(src, holder) + +/datum/gas_mixture/proc/compare(other) + return call_ext(AUXMOS, "byond:compare_hook_ffi")(src, other) + +/datum/gas_mixture/proc/clear() + return call_ext(AUXMOS, "byond:clear_hook_ffi")(src) + +/datum/gas_mixture/proc/mark_immutable() + return call_ext(AUXMOS, "byond:mark_immutable_hook_ffi")(src) + +/datum/gas_mixture/proc/scrub_into(into, ratio_v, gas_list) + return call_ext(AUXMOS, "byond:scrub_into_hook_ffi")(src, into, ratio_v, gas_list) + +/datum/gas_mixture/proc/get_by_flag(flag_val) + return call_ext(AUXMOS, "byond:get_by_flag_hook_ffi")(src, flag_val) + +/datum/gas_mixture/proc/__remove_by_flag(into, flag_val, amount_val) + return call_ext(AUXMOS, "byond:remove_by_flag_hook_ffi")(src, into, flag_val, amount_val) + +/datum/gas_mixture/proc/divide(num_val) + return call_ext(AUXMOS, "byond:divide_hook_ffi")(src, num_val) + +/datum/gas_mixture/proc/multiply(num_val) + return call_ext(AUXMOS, "byond:multiply_hook_ffi")(src, num_val) + +/datum/gas_mixture/proc/subtract(num_val) + return call_ext(AUXMOS, "byond:subtract_hook_ffi")(src, num_val) + +/datum/gas_mixture/proc/add(num_val) + return call_ext(AUXMOS, "byond:add_hook_ffi")(src, num_val) + +/datum/gas_mixture/proc/adjust_multi(...) + var/list/args_copy = args.Copy() + args_copy.Insert(1, src) + return call_ext(AUXMOS, "byond:adjust_multi_hook_ffi")(arglist(args_copy)) + +/datum/gas_mixture/proc/adjust_moles_temp(id_val, num_val, temp_val) + return call_ext(AUXMOS, "byond:adjust_moles_temp_hook_ffi")(src, id_val, num_val, temp_val) + +/datum/gas_mixture/proc/adjust_moles(id_val, num_val) + return call_ext(AUXMOS, "byond:adjust_moles_hook_ffi")(src, id_val, num_val) + +/datum/gas_mixture/proc/set_moles(gas_id, amt_val) + return call_ext(AUXMOS, "byond:set_moles_hook_ffi")(src, gas_id, amt_val) + +/datum/gas_mixture/proc/get_moles(gas_id) + return call_ext(AUXMOS, "byond:get_moles_hook_ffi")(src, gas_id) + +/datum/gas_mixture/proc/set_volume(vol_arg) + return call_ext(AUXMOS, "byond:set_volume_hook_ffi")(src, vol_arg) + +/datum/gas_mixture/proc/partial_heat_capacity(gas_id) + return call_ext(AUXMOS, "byond:partial_heat_capacity_ffi")(src, gas_id) + +/datum/gas_mixture/proc/set_temperature(arg_temp) + return call_ext(AUXMOS, "byond:set_temperature_hook_ffi")(src, arg_temp) + +/datum/gas_mixture/proc/get_gases() + return call_ext(AUXMOS, "byond:get_gases_hook_ffi")(src) + +/datum/gas_mixture/proc/temperature_share(...) + var/list/args_copy = args.Copy() + args_copy.Insert(1, src) + return call_ext(AUXMOS, "byond:temperature_share_hook_ffi")(arglist(args_copy)) + +/datum/gas_mixture/proc/copy_from(giver) + return call_ext(AUXMOS, "byond:copy_from_hook_ffi")(src, giver) + +/datum/gas_mixture/proc/__remove(into, amount_arg) + return call_ext(AUXMOS, "byond:remove_hook_ffi")(src, into, amount_arg) + +/datum/gas_mixture/proc/__remove_ratio(into, ratio_arg) + return call_ext(AUXMOS, "byond:remove_ratio_hook_ffi")(src, into, ratio_arg) + +/datum/gas_mixture/proc/merge(giver) + return call_ext(AUXMOS, "byond:merge_hook_ffi")(src, giver) + +/datum/gas_mixture/proc/thermal_energy() + return call_ext(AUXMOS, "byond:thermal_energy_hook_ffi")(src) + +/datum/gas_mixture/proc/return_volume() + return call_ext(AUXMOS, "byond:return_volume_hook_ffi")(src) + +/datum/gas_mixture/proc/return_temperature() + return call_ext(AUXMOS, "byond:return_temperature_hook_ffi")(src) + +/datum/gas_mixture/proc/return_pressure() + return call_ext(AUXMOS, "byond:return_pressure_hook_ffi")(src) + +/datum/gas_mixture/proc/total_moles() + return call_ext(AUXMOS, "byond:total_moles_hook_ffi")(src) + +/datum/gas_mixture/proc/set_min_heat_capacity(arg_min) + return call_ext(AUXMOS, "byond:min_heat_cap_hook_ffi")(src, arg_min) + +/datum/gas_mixture/proc/heat_capacity() + return call_ext(AUXMOS, "byond:heat_cap_hook_ffi")(src) + +/datum/gas_mixture/proc/__gasmixture_unregister() + return call_ext(AUXMOS, "byond:unregister_gasmixture_hook_ffi")(src) + +/datum/gas_mixture/proc/__gasmixture_register() + return call_ext(AUXMOS, "byond:register_gasmixture_hook_ffi")(src) + +/proc/process_atmos_callbacks(remaining) + return call_ext(AUXMOS, "byond:atmos_callback_handle_ffi")(remaining) + diff --git a/code/__HELPERS/_extools_api.dm b/code/__HELPERS/_extools_api.dm index 18866d571a..a8044c2203 100644 --- a/code/__HELPERS/_extools_api.dm +++ b/code/__HELPERS/_extools_api.dm @@ -3,29 +3,3 @@ /proc/extools_log_write() /proc/extools_finalize_logging() - -/proc/auxtools_stack_trace(msg) - CRASH(msg) - -//glob doesn't exist yet at some gas new calls, imma use it anyways -GLOBAL_REAL_VAR(list/__auxtools_initialized) = list() - -#define AUXTOOLS_CHECK(LIB)\ - if (!__auxtools_initialized[LIB]) {\ - if (fexists(LIB)) {\ - var/string = LIBCALL(LIB,"auxtools_init")();\ - if(findtext(string, "SUCCESS")) {\ - __auxtools_initialized[LIB] = TRUE;\ - } else {\ - CRASH(string);\ - }\ - } else {\ - CRASH("No file named [LIB] found!")\ - }\ - }\ - -#define AUXTOOLS_SHUTDOWN(LIB)\ - if (__auxtools_initialized[LIB] && fexists(LIB)){\ - LIBCALL(LIB,"auxtools_shutdown")();\ - __auxtools_initialized[LIB] = FALSE;\ - }\ diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index 26a51ec2c1..035f5e7453 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -6,6 +6,8 @@ SUBSYSTEM_DEF(air) flags = SS_BACKGROUND runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME + var/cached_cost = 0 + var/cost_turfs = 0 var/cost_groups = 0 var/cost_highpressure = 0 @@ -26,6 +28,9 @@ SUBSYSTEM_DEF(air) var/num_group_turfs_processed = 0 var/num_equalize_processed = 0 + var/gas_mixes_count = 0 + var/gas_mixes_allocated = 0 + var/list/hotspots = list() var/list/networks = list() var/list/pipenets_needing_rebuilt = list() @@ -53,8 +58,6 @@ SUBSYSTEM_DEF(air) var/equalize_hard_turf_limit = 2000 // Whether equalization is enabled. Can be disabled for performance reasons. var/equalize_enabled = FALSE - // When above 0, won't equalize; performance handling - var/eq_cooldown = 0 // Whether turf-to-turf heat exchanging should be enabled. var/heat_enabled = FALSE // Max number of times process_turfs will share in a tick. @@ -65,8 +68,6 @@ SUBSYSTEM_DEF(air) var/excited_group_pressure_goal = 1 // Target for excited_group_pressure_goal; can go below this, if it determines the thread is taking too long. var/excited_group_pressure_goal_target = 1 - // If this is set to 0, monstermos won't process planet atmos - var/planet_equalize_enabled = 0 /datum/controller/subsystem/air/stat_entry(msg) msg += "C:{" @@ -91,8 +92,8 @@ SUBSYSTEM_DEF(air) msg += "LT:[low_pressure_turfs]|" msg += "ET:[num_equalize_processed]|" msg += "GT:[num_group_turfs_processed]|" - msg += "GA:[get_amt_gas_mixes()]|" - msg += "MG:[get_max_gas_mixes()]" + msg += "GA:[gas_mixes_count]|" + msg += "MG:[gas_mixes_allocated]" return ..() /datum/controller/subsystem/air/Initialize(timeofday) @@ -107,7 +108,6 @@ SUBSYSTEM_DEF(air) /datum/controller/subsystem/air/proc/extools_update_ssair() -/datum/controller/subsystem/air/proc/auxtools_update_reactions() /datum/controller/subsystem/air/proc/add_reaction(datum/gas_reaction/r) gas_reactions += r @@ -123,9 +123,6 @@ SUBSYSTEM_DEF(air) message_admins("Air reset done.") SSair.can_fire = 1 -/datum/controller/subsystem/air/proc/thread_running() - return FALSE - /proc/fix_corrupted_atmos() /datum/admins/proc/fixcorruption() @@ -137,6 +134,12 @@ SUBSYSTEM_DEF(air) /datum/controller/subsystem/air/fire(resumed = 0) var/timer = TICK_USAGE_REAL + thread_wait_ticks = MC_AVERAGE(thread_wait_ticks, cur_thread_wait_ticks) + cur_thread_wait_ticks = 0 + + gas_mixes_count = get_amt_gas_mixes() + gas_mixes_allocated = get_max_gas_mixes() + if(currentpart == SSAIR_REBUILD_PIPENETS) timer = TICK_USAGE_REAL var/list/pipenet_rebuilds = pipenets_needing_rebuilt @@ -150,6 +153,30 @@ SUBSYSTEM_DEF(air) if(state != SS_RUNNING) return resumed = FALSE + currentpart = SSAIR_PIPENETS + + if(currentpart == SSAIR_PIPENETS || !resumed) + timer = TICK_USAGE_REAL + if(!resumed) + cached_cost = 0 + process_pipenets(resumed) + cached_cost += TICK_USAGE_REAL - timer + if(state != SS_RUNNING) + return + cost_pipenets = MC_AVERAGE(cost_pipenets, TICK_DELTA_TO_MS(cached_cost)) + resumed = 0 + currentpart = SSAIR_ATMOSMACHINERY + + if(currentpart == SSAIR_ATMOSMACHINERY) + timer = TICK_USAGE_REAL + if(!resumed) + cached_cost = 0 + process_atmos_machinery(resumed) + cached_cost += TICK_USAGE_REAL - timer + if(state != SS_RUNNING) + return + resumed = 0 + cost_atmos_machinery = MC_AVERAGE(cost_atmos_machinery, TICK_DELTA_TO_MS(cached_cost)) currentpart = SSAIR_ACTIVETURFS if(currentpart == SSAIR_ACTIVETURFS) @@ -158,6 +185,13 @@ SUBSYSTEM_DEF(air) if(state != SS_RUNNING) return resumed = 0 + currentpart = equalize_enabled ? SSAIR_EQUALIZE : SSAIR_EXCITEDGROUPS + + if(currentpart == SSAIR_EQUALIZE) + process_turf_equalize(resumed) + if(state != SS_RUNNING) + return + resumed = 0 currentpart = SSAIR_EXCITEDGROUPS if(currentpart == SSAIR_EXCITEDGROUPS) @@ -165,34 +199,10 @@ SUBSYSTEM_DEF(air) if(state != SS_RUNNING) return resumed = 0 - currentpart = equalize_enabled ? SSAIR_EQUALIZE : SSAIR_FINALIZE_TURFS - - if(currentpart == SSAIR_EQUALIZE) - equalize_turfs(resumed) - if(state != SS_RUNNING) - return - resumed = 0 currentpart = SSAIR_FINALIZE_TURFS if(currentpart == SSAIR_FINALIZE_TURFS) finish_turf_processing(resumed) - if(state != SS_RUNNING) - return - resumed = FALSE - currentpart = SSAIR_PIPENETS - - if(currentpart == SSAIR_PIPENETS || !resumed) - timer = TICK_USAGE_REAL - process_pipenets(resumed) - cost_pipenets = MC_AVERAGE(cost_pipenets, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) - if(state != SS_RUNNING) - return - resumed = 0 - currentpart = SSAIR_ATMOSMACHINERY - if(currentpart == SSAIR_ATMOSMACHINERY) - timer = TICK_USAGE_REAL - process_atmos_machinery(resumed) - cost_atmos_machinery = MC_AVERAGE(cost_atmos_machinery, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) if(state != SS_RUNNING) return resumed = 0 @@ -200,21 +210,28 @@ SUBSYSTEM_DEF(air) if(currentpart == SSAIR_HIGHPRESSURE) timer = TICK_USAGE_REAL + if(!resumed) + cached_cost = 0 process_high_pressure_delta(resumed) - cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) + cached_cost += TICK_USAGE_REAL - timer if(state != SS_RUNNING) return + cost_highpressure = MC_AVERAGE(cost_highpressure, TICK_DELTA_TO_MS(cached_cost)) resumed = 0 currentpart = SSAIR_HOTSPOTS if(currentpart == SSAIR_HOTSPOTS) timer = TICK_USAGE_REAL + if(!resumed) + cached_cost = 0 process_hotspots(resumed) - cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) + cached_cost += TICK_USAGE_REAL - timer if(state != SS_RUNNING) return + cost_hotspots = MC_AVERAGE(cost_hotspots, TICK_DELTA_TO_MS(cached_cost)) resumed = 0 currentpart = heat_enabled ? SSAIR_TURF_CONDUCTION : SSAIR_REBUILD_PIPENETS + // Heat -- slow and of questionable usefulness. Off by default for this reason. Pretty cool, though. if(currentpart == SSAIR_TURF_CONDUCTION) timer = TICK_USAGE_REAL @@ -309,14 +326,8 @@ SUBSYSTEM_DEF(air) if(post_process_turfs_auxtools(TICK_REMAINING_MS)) pause() -/datum/controller/subsystem/air/proc/finish_turf_processing_auxtools() /datum/controller/subsystem/air/proc/equalize_turfs_auxtools() -/datum/controller/subsystem/air/proc/process_turfs_auxtools() /datum/controller/subsystem/air/proc/post_process_turfs_auxtools() -/datum/controller/subsystem/air/proc/process_turf_equalize_auxtools() -/datum/controller/subsystem/air/proc/process_excited_groups_auxtools() -/datum/controller/subsystem/air/proc/get_amt_gas_mixes() -/datum/controller/subsystem/air/proc/get_max_gas_mixes() /datum/controller/subsystem/air/proc/turf_process_time() /datum/controller/subsystem/air/proc/heat_process_time() /datum/controller/subsystem/air/proc/process_turf_heat() @@ -392,6 +403,19 @@ SUBSYSTEM_DEF(air) var/datum/atmosphere/mix = atmos_gen[gas_string] return mix.gas_string +/datum/controller/subsystem/air/proc/start_processing_machine(obj/machinery/machine) + if(machine.atmos_processing) + return + machine.atmos_processing = TRUE + atmos_machinery += machine + +/datum/controller/subsystem/air/proc/stop_processing_machine(obj/machinery/machine) + if(!machine.atmos_processing) + return + machine.atmos_processing = FALSE + atmos_machinery -= machine + currentrun -= machine + #undef SSAIR_PIPENETS #undef SSAIR_ATMOSMACHINERY #undef SSAIR_EXCITEDGROUPS diff --git a/code/controllers/subsystem/callback.dm b/code/controllers/subsystem/callback.dm index 21c43f3e6c..dc33f6f3c8 100644 --- a/code/controllers/subsystem/callback.dm +++ b/code/controllers/subsystem/callback.dm @@ -4,11 +4,6 @@ SUBSYSTEM_DEF(callbacks) wait = 1 priority = FIRE_PRIORITY_CALLBACKS -/proc/process_atmos_callbacks() - SScallbacks.can_fire = 0 - SScallbacks.flags |= SS_NO_FIRE - CRASH("Auxtools not found! Callback subsystem shutting itself off.") - /datum/controller/subsystem/callbacks/fire() if(process_atmos_callbacks(TICK_REMAINING_MS)) pause() diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index d01889f9fc..035f18f2d4 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -139,6 +139,9 @@ Class Procs: var/market_verb = "Customer" var/payment_department = ACCOUNT_ENG + ///Boolean on whether this machines interact with atmos + var/atmos_processing = FALSE + /obj/machinery/Initialize(mapload) if(!armor) armor = list(MELEE = 25, BULLET = 10, LASER = 10, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 70) diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm index c8add9e690..81c3ad8118 100644 --- a/code/game/machinery/computer/atmos_control.dm +++ b/code/game/machinery/computer/atmos_control.dm @@ -73,11 +73,11 @@ /obj/machinery/air_sensor/Initialize(mapload) . = ..() - SSair.atmos_machinery += src + SSair.start_processing_machine(src) set_frequency(frequency) /obj/machinery/air_sensor/Destroy() - SSair.atmos_machinery -= src + SSair.stop_processing_machine(src) SSradio.remove_object(src, frequency) return ..() diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm index 93b85bb45b..d90f4f8bc9 100644 --- a/code/game/machinery/spaceheater.dm +++ b/code/game/machinery/spaceheater.dm @@ -222,7 +222,7 @@ usr.visible_message("[usr] switches [on ? "on" : "off"] \the [src].", "You switch [on ? "on" : "off"] \the [src].") update_icon() if (on) - SSair.atmos_machinery += src + SSair.start_processing_machine(src) . = TRUE if("mode") setMode = params["mode"] diff --git a/code/game/world.dm b/code/game/world.dm index eeb8b33f01..918382696f 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -9,14 +9,6 @@ GLOBAL_LIST(topic_status_cache) //So subsystems globals exist, but are not initialised /world/New() - var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") - if (debug_server) - call(debug_server, "auxtools_init")() - enable_debugging() - AUXTOOLS_CHECK(AUXMOS) -#ifdef EXTOOLS_REFERENCE_TRACKING - enable_reference_tracking() -#endif world.Profile(PROFILE_START) log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!") @@ -274,15 +266,10 @@ GLOBAL_LIST(topic_status_cache) log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]") shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss. - AUXTOOLS_SHUTDOWN(AUXMOS) ..() /world/Del() shutdown_logging() // makes sure the thread is closed before end, else we terminate - AUXTOOLS_SHUTDOWN(AUXMOS) - var/debug_server = world.GetConfig("env", "AUXTOOLS_DEBUG_DLL") - if (debug_server) - call(debug_server, "auxtools_shutdown")() ..() /world/proc/update_status() diff --git a/code/modules/atmospherics/environmental/LINDA_system.dm b/code/modules/atmospherics/environmental/LINDA_system.dm index 83eb5d8ef3..aa3d49e3b7 100644 --- a/code/modules/atmospherics/environmental/LINDA_system.dm +++ b/code/modules/atmospherics/environmental/LINDA_system.dm @@ -71,8 +71,6 @@ /turf/proc/set_sleeping(should_sleep) -/turf/proc/__update_auxtools_turf_adjacency_info() - //returns a list of adjacent turfs that can share air with this one. //alldir includes adjacent diagonal tiles that can share // air with both of the related adjacent cardinal tiles diff --git a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm index 8914537748..92dc86efba 100644 --- a/code/modules/atmospherics/environmental/LINDA_turf_tile.dm +++ b/code/modules/atmospherics/environmental/LINDA_turf_tile.dm @@ -45,9 +45,6 @@ QDEL_NULL(active_hotspot) return ..() -/// Function for Extools Atmos -/turf/proc/update_air_ref() - /////////////////GAS MIXTURE PROCS/////////////////// /turf/open/assume_air(datum/gas_mixture/giver) //use this for machines to adjust air diff --git a/code/modules/atmospherics/gasmixtures/auxgm.dm b/code/modules/atmospherics/gasmixtures/auxgm.dm index 0c36457ea2..0318e06abe 100644 --- a/code/modules/atmospherics/gasmixtures/auxgm.dm +++ b/code/modules/atmospherics/gasmixtures/auxgm.dm @@ -12,8 +12,6 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA // Also allows you to add new gases at runtime -/proc/_auxtools_register_gas(datum/gas/gas) // makes sure auxtools knows stuff about this gas - /datum/auxgm var/done_initializing = FALSE var/list/datums = list() @@ -148,8 +146,6 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(GAS_O2, GAS_N2, GAS_CO2, GA SSair.auxtools_update_reactions() SEND_GLOBAL_SIGNAL(COMSIG_GLOB_NEW_GAS, g) -/proc/finalize_gas_refs() - /datum/auxgm/New() src.supermatter[HEAT_PENALTY] = list() src.supermatter[TRANSMIT_MODIFIER] = list() diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 8b00fc49d0..34487da244 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -16,13 +16,10 @@ What are the archived variables for? GLOBAL_LIST_INIT(auxtools_atmos_initialized,FALSE) -/proc/auxtools_atmos_init() - /datum/gas_mixture/New(volume) if (!isnull(volume)) initial_volume = volume - AUXTOOLS_CHECK(AUXMOS) - if(!GLOB.auxtools_atmos_initialized && auxtools_atmos_init()) + if(!GLOB.auxtools_atmos_initialized && auxtools_atmos_init(GLOB.gas_data)) GLOB.auxtools_atmos_initialized = TRUE __gasmixture_register() reaction_results = new @@ -111,9 +108,6 @@ we use a hook instead . = ..() */ -/datum/gas_mixture/proc/__gasmixture_unregister() -/datum/gas_mixture/proc/__gasmixture_register() - /proc/gas_types() var/list/L = subtypesof(/datum/gas) for(var/gt in L) @@ -121,22 +115,6 @@ we use a hook instead L[gt] = initial(G.specific_heat) return L -/datum/gas_mixture/proc/heat_capacity() //joules per kelvin - -/datum/gas_mixture/proc/partial_heat_capacity(gas_type) - -/datum/gas_mixture/proc/total_moles() - -/datum/gas_mixture/proc/return_pressure() //kilopascals - -/datum/gas_mixture/proc/return_temperature() //kelvins - -/datum/gas_mixture/proc/set_min_heat_capacity(n) -/datum/gas_mixture/proc/set_temperature(new_temp) -/datum/gas_mixture/proc/set_volume(new_volume) -/datum/gas_mixture/proc/get_moles(gas_type) -/datum/gas_mixture/proc/get_by_flag(flag) -/datum/gas_mixture/proc/set_moles(gas_type, moles) // VV WRAPPERS - EXTOOLS HOOKED PROCS DO NOT TAKE ARGUMENTS FROM CALL() FOR SOME REASON. /datum/gas_mixture/proc/vv_set_moles(gas_type, moles) @@ -150,34 +128,12 @@ we use a hook instead /datum/gas_mixture/proc/vv_react(datum/holder) return react(holder) -/datum/gas_mixture/proc/scrub_into(datum/gas_mixture/target, ratio, list/gases) -/datum/gas_mixture/proc/mark_immutable() -/datum/gas_mixture/proc/get_gases() -/datum/gas_mixture/proc/add(amt) -/datum/gas_mixture/proc/subtract(amt) -/datum/gas_mixture/proc/multiply(factor) -/datum/gas_mixture/proc/divide(factor) /datum/gas_mixture/proc/get_last_share() -/datum/gas_mixture/proc/clear() - -/datum/gas_mixture/proc/adjust_moles(gas_type, amt = 0) - set_moles(gas_type, clamp(get_moles(gas_type) + amt,0,INFINITY)) - -/datum/gas_mixture/proc/adjust_moles_temp(gas_type, amt, temperature) - -/datum/gas_mixture/proc/adjust_multi() - -/datum/gas_mixture/proc/return_volume() //liters - -/datum/gas_mixture/proc/thermal_energy() //joules /datum/gas_mixture/proc/archive() //Update archived versions of variables //Returns: 1 in all cases -/datum/gas_mixture/proc/merge(datum/gas_mixture/giver) - //Merges all air from giver into self. giver is untouched. - //Returns: 1 if we are mutable, 0 otherwise /datum/gas_mixture/proc/remove(amount) //Removes amount of gas from the gas_mixture @@ -187,12 +143,6 @@ we use a hook instead //Removes amount of gas from the gas mixture by flag //Returns: gas_mixture with gases that match the flag removed -/datum/gas_mixture/proc/transfer_to(datum/gas_mixture/target, amount) - //Transfers amount of gas to target. Equivalent to target.merge(remove(amount)) but faster. - -/datum/gas_mixture/proc/transfer_ratio_to(datum/gas_mixture/target, ratio) - //Transfers ratio of gas to target. Equivalent to target.merge(remove_ratio(amount)) but faster. - /datum/gas_mixture/proc/remove_ratio(ratio) //Proportionally removes amount of gas from the gas_mixture //Returns: gas_mixture with the gases removed @@ -201,10 +151,6 @@ we use a hook instead //Creates new, identical gas mixture //Returns: duplicate gas mixture -/datum/gas_mixture/proc/copy_from(datum/gas_mixture/sample) - //Copies variables from sample - //Returns: 1 if we are mutable, 0 otherwise - /datum/gas_mixture/proc/copy_from_turf(turf/model) //Copies all gas info from the turf into the gas list along with temperature //Returns: 1 if we are mutable, 0 otherwise @@ -217,52 +163,18 @@ we use a hook instead //Performs air sharing calculations between two gas_mixtures assuming only 1 boundary length //Returns: amount of gas exchanged (+ if sharer received) -/datum/gas_mixture/proc/temperature_share(datum/gas_mixture/sharer, conduction_coefficient,temperature=null,heat_capacity=null) - //Performs temperature sharing calculations (via conduction) between two gas_mixtures assuming only 1 boundary length - //Returns: new temperature of the sharer - -/datum/gas_mixture/proc/compare(datum/gas_mixture/sample) - //Compares sample to self to see if within acceptable ranges that group processing may be enabled - //Returns: a string indicating what check failed, or "" if check passes - -/datum/gas_mixture/proc/react(datum/holder) - //Performs various reactions such as combustion or fusion (LOL) - //Returns: 1 if any reaction took place; 0 otherwise - -/datum/gas_mixture/proc/adjust_heat(amt) - //Adjusts the thermal energy of the gas mixture, rather than having to do the full calculation. - //Returns: null - -/datum/gas_mixture/proc/equalize_with(datum/gas_mixture/giver) - //Makes this mix have the same temperature and gas ratios as the giver, but with the same pressure, accounting for volume. - //Returns: null - -/datum/gas_mixture/proc/get_oxidation_power(temp) - //Gets how much oxidation this gas can do, optionally at a given temperature. - -/datum/gas_mixture/proc/get_fuel_amount(temp) - //Gets how much fuel for fires (not counting trit/plasma!) this gas has, optionally at a given temperature. - -/proc/equalize_all_gases_in_list(list/L) - //Makes every gas in the given list have the same pressure, temperature and gas proportions. - //Returns: null - -/datum/gas_mixture/proc/__remove_by_flag() - /datum/gas_mixture/remove_by_flag(flag, amount) var/datum/gas_mixture/removed = new type __remove_by_flag(removed, flag, amount) return removed -/datum/gas_mixture/proc/__remove() /datum/gas_mixture/remove(amount) var/datum/gas_mixture/removed = new type __remove(removed, amount) return removed -/datum/gas_mixture/proc/__remove_ratio() /datum/gas_mixture/remove_ratio(ratio) var/datum/gas_mixture/removed = new type __remove_ratio(removed, ratio) @@ -280,8 +192,6 @@ we use a hook instead parse_gas_string(model.initial_gas_mix) return TRUE -/datum/gas_mixture/proc/__auxtools_parse_gas_string(gas_string) - /datum/gas_mixture/parse_gas_string(gas_string) gas_string = SSair.preprocess_gas_string(gas_string) return __auxtools_parse_gas_string(gas_string) diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm index 40b2515353..171412f0d8 100644 --- a/code/modules/atmospherics/machinery/atmosmachinery.dm +++ b/code/modules/atmospherics/machinery/atmosmachinery.dm @@ -72,14 +72,15 @@ armor = list(MELEE = 25, BULLET = 10, LASER = 10, ENERGY = 100, BOMB = 0, BIO = 100, RAD = 100, FIRE = 100, ACID = 70) ..() if(process) - SSair.atmos_machinery += src + SSair.start_processing_machine(src) SetInitDirections() /obj/machinery/atmospherics/Destroy() for(var/i in 1 to device_type) nullifyNode(i) - SSair.atmos_machinery -= src + + SSair.stop_processing_machine(src) SSair.pipenets_needing_rebuilt -= src dropContents() diff --git a/code/modules/atmospherics/machinery/other/meter.dm b/code/modules/atmospherics/machinery/other/meter.dm index 48d69567af..26f16d329d 100644 --- a/code/modules/atmospherics/machinery/other/meter.dm +++ b/code/modules/atmospherics/machinery/other/meter.dm @@ -27,14 +27,14 @@ id_tag = ATMOS_GAS_MONITOR_LOOP_DISTRIBUTION /obj/machinery/meter/Destroy() - SSair.atmos_machinery -= src + SSair.stop_processing_machine(src) target = null return ..() /obj/machinery/meter/Initialize(mapload, new_piping_layer) if(!isnull(new_piping_layer)) target_layer = new_piping_layer - SSair.atmos_machinery += src + SSair.start_processing_machine(src) if(!target) reattach_to_layer() return ..() diff --git a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm index 3613a59e0a..56ad873f85 100644 --- a/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm +++ b/code/modules/atmospherics/machinery/portable/portable_atmospherics.dm @@ -16,7 +16,7 @@ /obj/machinery/portable_atmospherics/New() ..() - SSair.atmos_machinery += src + SSair.start_processing_machine(src) air_contents = new(volume) air_contents.set_temperature(T20C) @@ -24,8 +24,7 @@ return TRUE /obj/machinery/portable_atmospherics/Destroy() - SSair.atmos_machinery -= src - + SSair.stop_processing_machine(src) disconnect() qdel(air_contents) air_contents = null diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm index f1beecacb9..af427f1c40 100644 --- a/code/modules/power/generator.dm +++ b/code/modules/power/generator.dm @@ -19,7 +19,7 @@ . = ..() find_circs() connect_to_network() - SSair.atmos_machinery += src + SSair.start_processing_machine(src) update_icon() component_parts = list(new /obj/item/circuitboard/machine/generator) @@ -29,7 +29,7 @@ /obj/machinery/power/generator/Destroy() kill_circs() - SSair.atmos_machinery -= src + SSair.stop_processing_machine(src) return ..() /obj/machinery/power/generator/update_overlays() diff --git a/code/modules/power/reactor/rbmk.dm b/code/modules/power/reactor/rbmk.dm index 24b562a8cf..f49148faad 100644 --- a/code/modules/power/reactor/rbmk.dm +++ b/code/modules/power/reactor/rbmk.dm @@ -444,7 +444,7 @@ The reactor CHEWS through moderator. It does not do this slowly. Be very careful //Results: Engineering becomes unusable and your engine irreparable /obj/machinery/atmospherics/components/trinary/nuclear_reactor/proc/meltdown() set waitfor = FALSE - SSair.atmos_machinery -= src //Annd we're now just a useless brick. + SSair.stop_processing_machine(src) slagged = TRUE color = null update_icon() diff --git a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm index c456887460..157ad6a627 100644 --- a/code/modules/power/supermatter/supermatter.dm +++ b/code/modules/power/supermatter/supermatter.dm @@ -195,7 +195,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /obj/machinery/power/supermatter_crystal/Initialize(mapload) . = ..() uid = gl_uid++ - SSair.atmos_machinery += src + SSair.start_processing_machine(src) countdown = new(src) countdown.start() GLOB.poi_list |= src @@ -214,7 +214,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal) /obj/machinery/power/supermatter_crystal/Destroy() investigate_log("has been destroyed.", INVESTIGATE_SUPERMATTER) - SSair.atmos_machinery -= src + SSair.stop_processing_machine(src) QDEL_NULL(radio) GLOB.poi_list -= src QDEL_NULL(countdown) diff --git a/tgstation.dme b/tgstation.dme index 1768cba677..043969c663 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -19,7 +19,6 @@ #include "code\__byond_version_compat.dm" #include "code\_compile_options.dm" #include "code\world.dm" -#include "code\__DEFINES\_auxtools.dm" #include "code\__DEFINES\_click.dm" #include "code\__DEFINES\_globals.dm" #include "code\__DEFINES\_protect.dm" @@ -30,6 +29,7 @@ #include "code\__DEFINES\admin.dm" #include "code\__DEFINES\antagonists.dm" #include "code\__DEFINES\atmospherics.dm" +#include "code\__DEFINES\bindings.dm" #include "code\__DEFINES\bitfields.dm" #include "code\__DEFINES\blackmarket.dm" #include "code\__DEFINES\botany.dm"