diff --git a/auxtools.dll b/auxtools.dll new file mode 100644 index 0000000000..07e5254e2d Binary files /dev/null and b/auxtools.dll differ diff --git a/auxtools.pdb b/auxtools.pdb new file mode 100644 index 0000000000..d6eaa63e47 Binary files /dev/null and b/auxtools.pdb differ diff --git a/byond-extools.dll b/byond-extools.dll deleted file mode 100644 index c404bf1be5..0000000000 Binary files a/byond-extools.dll and /dev/null differ diff --git a/byond-extools.pdb b/byond-extools.pdb deleted file mode 100644 index f89dc06441..0000000000 Binary files a/byond-extools.pdb and /dev/null differ diff --git a/code/__DEFINES/_extools.dm b/code/__DEFINES/_extools.dm index 4513243aae..a381e118bb 100644 --- a/code/__DEFINES/_extools.dm +++ b/code/__DEFINES/_extools.dm @@ -1 +1,2 @@ #define EXTOOLS (world.system_type == MS_WINDOWS ? "byond-extools.dll" : "libbyond-extools.so") +#define AUXTOOLS (world.system_type == MS_WINDOWS ? "auxtools.dll" : "auxtools.so") diff --git a/code/__DEFINES/atmospherics.dm b/code/__DEFINES/atmospherics.dm index dad2a38afd..52928be763 100644 --- a/code/__DEFINES/atmospherics.dm +++ b/code/__DEFINES/atmospherics.dm @@ -281,17 +281,6 @@ GLOBAL_LIST_INIT(atmos_adjacent_savings, list(0,0)) #define CALCULATE_ADJACENT_TURFS(T) SSadjacent_air.queue[T] = 1 #endif -GLOBAL_VAR(atmos_extools_initialized) // this must be an uninitialized (null) one or init_monstermos will be called twice because reasons -#define ATMOS_EXTOOLS_CHECK if(!GLOB.atmos_extools_initialized){\ - GLOB.atmos_extools_initialized=TRUE;\ - if(fexists(EXTOOLS)){\ - var/result = call(EXTOOLS,"init_monstermos")();\ - if(result != "ok") {CRASH(result);}\ - } else {\ - CRASH("[EXTOOLS] does not exist!");\ - }\ -} - //Unomos - So for whatever reason, garbage collection actually drastically decreases the cost of atmos later in the round. Turning this into a define yields massively improved performance. #define GAS_GARBAGE_COLLECT(GASGASGAS)\ var/list/CACHE_GAS = GASGASGAS;\ diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index b405db83b0..7632751daf 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -126,6 +126,7 @@ #define FIRE_PRIORITY_CHAT 400 #define FIRE_PRIORITY_RUNECHAT 410 #define FIRE_PRIORITY_OVERLAYS 500 +#define FIRE_PRIORITY_CALLBACKS 600 #define FIRE_PRIORITY_INPUT 1000 // This must always always be the max highest priority. Player input must never be lost. // SS runlevels diff --git a/code/__HELPERS/_extools_api.dm b/code/__HELPERS/_extools_api.dm index af348dc939..a8044c2203 100644 --- a/code/__HELPERS/_extools_api.dm +++ b/code/__HELPERS/_extools_api.dm @@ -1,4 +1,4 @@ -#define EXTOOLS_LOGGING // rust_g is used as a fallback if this is undefined +//#define EXTOOLS_LOGGING // rust_g is used as a fallback if this is undefined /proc/extools_log_write() diff --git a/code/controllers/subsystem/air.dm b/code/controllers/subsystem/air.dm index f777c967ae..d188f0bf4f 100644 --- a/code/controllers/subsystem/air.dm +++ b/code/controllers/subsystem/air.dm @@ -66,17 +66,15 @@ SUBSYSTEM_DEF(air) return ..() /datum/controller/subsystem/air/Initialize(timeofday) - extools_update_ssair() map_loading = FALSE setup_allturfs() setup_atmos_machinery() setup_pipenets() gas_reactions = init_gas_reactions() - extools_update_reactions() return ..() /datum/controller/subsystem/air/proc/extools_update_ssair() -/datum/controller/subsystem/air/proc/extools_update_reactions() +//datum/controller/subsystem/air/proc/extools_update_reactions() /datum/controller/subsystem/air/fire(resumed = 0) var/timer = TICK_USAGE_REAL @@ -110,7 +108,7 @@ SUBSYSTEM_DEF(air) if(state != SS_RUNNING) return resumed = 0 - currentpart = monstermos_enabled ? SSAIR_EQUALIZE : SSAIR_ACTIVETURFS + currentpart = SSAIR_ACTIVETURFS if(currentpart == SSAIR_EQUALIZE) timer = TICK_USAGE_REAL @@ -123,12 +121,13 @@ SUBSYSTEM_DEF(air) if(currentpart == SSAIR_ACTIVETURFS) timer = TICK_USAGE_REAL - process_active_turfs(resumed) + process_turfs(resumed) cost_turfs = MC_AVERAGE(cost_turfs, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) + MC_TICK_CHECK if(state != SS_RUNNING) return resumed = 0 - currentpart = SSAIR_EXCITEDGROUPS + currentpart = SSAIR_HIGHPRESSURE if(currentpart == SSAIR_EXCITEDGROUPS) timer = TICK_USAGE_REAL @@ -259,8 +258,8 @@ SUBSYSTEM_DEF(air) return */ -/datum/controller/subsystem/air/proc/process_active_turfs(resumed = 0) - return process_active_turfs_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag) +/datum/controller/subsystem/air/proc/process_turfs(resumed = 0) + return process_turfs_extools(resumed, (Master.current_ticklimit - TICK_USAGE) * 0.01 * world.tick_lag) /* //cache for sanic speed var/fire_count = times_fired @@ -297,7 +296,7 @@ SUBSYSTEM_DEF(air) return */ -/datum/controller/subsystem/air/proc/process_active_turfs_extools() +/datum/controller/subsystem/air/proc/process_turfs_extools() /datum/controller/subsystem/air/proc/process_turf_equalize_extools() /datum/controller/subsystem/air/proc/process_excited_groups_extools() /datum/controller/subsystem/air/proc/get_amt_excited_groups() diff --git a/code/controllers/subsystem/callback.dm b/code/controllers/subsystem/callback.dm new file mode 100644 index 0000000000..7e57bf2e75 --- /dev/null +++ b/code/controllers/subsystem/callback.dm @@ -0,0 +1,13 @@ +SUBSYSTEM_DEF(callbacks) + name = "Auxtools Callbacks" + flags = SS_TICKER | SS_NO_INIT + wait = 1 + priority = FIRE_PRIORITY_CALLBACKS + +/proc/_process_callbacks() + SScallbacks.can_fire = 0 + SScallbacks.flags |= SS_NO_FIRE + CRASH("Auxtools not found! Callback subsystem shutting itself off.") + +/datum/controller/subsystem/callbacks/fire() + _process_callbacks() diff --git a/code/game/world.dm b/code/game/world.dm index 42c90d8be1..fd6dcc0572 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -8,15 +8,13 @@ GLOBAL_LIST(topic_status_cache) //This happens after the Master subsystem new(s) (it's a global datum) //So subsystems globals exist, but are not initialised + /world/New() - if (fexists(EXTOOLS)) - call(EXTOOLS, "maptick_initialize")() - #ifdef EXTOOLS_LOGGING - call(EXTOOLS, "init_logging")() - else - CRASH("[EXTOOLS] does not exist!") - #endif - enable_debugger() + if (fexists(AUXTOOLS)) + var/message = call(AUXTOOLS,"auxtools_init")() + if(message != "SUCCESS") + CRASH("Auxtools failed to load with message [message]!") + //enable_debugger() #ifdef REFERENCE_TRACKING enable_reference_tracking() #endif diff --git a/code/modules/admin/view_variables/reference_tracking.dm b/code/modules/admin/view_variables/reference_tracking.dm index 70aac2f107..3eec2a16fe 100644 --- a/code/modules/admin/view_variables/reference_tracking.dm +++ b/code/modules/admin/view_variables/reference_tracking.dm @@ -4,7 +4,7 @@ GLOBAL_LIST_EMPTY(deletion_failures) /world/proc/enable_reference_tracking() if (fexists(EXTOOLS)) - call(EXTOOLS, "ref_tracking_initialize")() + //call(EXTOOLS, "ref_tracking_initialize")() /proc/get_back_references(datum/D) CRASH("/proc/get_back_references not hooked by extools, reference tracking will not function!") diff --git a/code/modules/atmospherics/gasmixtures/gas_mixture.dm b/code/modules/atmospherics/gasmixtures/gas_mixture.dm index 4c71815c9c..a8add73409 100644 --- a/code/modules/atmospherics/gasmixtures/gas_mixture.dm +++ b/code/modules/atmospherics/gasmixtures/gas_mixture.dm @@ -23,10 +23,17 @@ GLOBAL_LIST_INIT(meta_gas_fusions, meta_gas_fusion_list()) var/list/analyzer_results //used for analyzer feedback - not initialized until its used var/_extools_pointer_gasmixture = 0 // Contains the memory address of the shared_ptr object for this gas mixture in c++ land. Don't. Touch. This. Var. +GLOBAL_VAR_INIT(auxmos_initialized,FALSE) + +/proc/auxtools_atmos_init() + CRASH("Auxtools not loaded! Stuff will get messy!") + /datum/gas_mixture/New(volume) if (!isnull(volume)) initial_volume = volume - ATMOS_EXTOOLS_CHECK + if(!GLOB.auxmos_initialized) + auxtools_atmos_init() + GLOB.auxmos_initialized = TRUE __gasmixture_register() reaction_results = new @@ -327,6 +334,10 @@ get_true_breath_pressure(pp) --> gas_pp = pp/breath_pp*total_moles() /datum/gas_mixture/turf +/datum/gas_mixture/turf/__gasmixture_register() + +/datum/gas_mixture/turf/__gasmixture_unregister() + /* /mob/verb/profile_atmos() /world{loop_checks = 0;} diff --git a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm index 2f3372462d..1ca98ac3f3 100644 --- a/code/modules/atmospherics/machinery/components/unary_devices/tank.dm +++ b/code/modules/atmospherics/machinery/components/unary_devices/tank.dm @@ -18,7 +18,7 @@ air_contents.set_volume(volume) air_contents.set_temperature(T20C) if(gas_type) - air_contents.set_moles(AIR_CONTENTS) + air_contents.set_moles(gas_type,AIR_CONTENTS) name = "[name] ([GLOB.meta_gas_names[gas_type]])" /obj/machinery/atmospherics/components/unary/tank/air diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 0eebf22be4..9919d4680e 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -22,7 +22,7 @@ integrity_failure = 0.4 pressure_resistance = 7 * ONE_ATMOSPHERE var/temperature_resistance = 1000 + T0C - var/starter_temp + var/starter_temp = T20C // Prototype vars var/prototype = FALSE var/valve_timer = null @@ -216,13 +216,11 @@ /obj/machinery/portable_atmospherics/canister/proc/create_gas() if(gas_type) - if(starter_temp) - air_contents.set_temperature(starter_temp) + air_contents.set_temperature(starter_temp) air_contents.set_moles(gas_type,(maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature())) - if(starter_temp) - air_contents.set_temperature(starter_temp) /obj/machinery/portable_atmospherics/canister/air/create_gas() + air_contents.set_temperature(starter_temp) air_contents.set_moles(/datum/gas/oxygen, (O2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature())) air_contents.set_moles(/datum/gas/nitrogen, (N2STANDARD * maximum_pressure * filled) * air_contents.return_volume() / (R_IDEAL_GAS_EQUATION * air_contents.return_temperature())) diff --git a/tgstation.dme b/tgstation.dme index 14a6a7cd10..c0b5489bef 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -304,6 +304,7 @@ #include "code\controllers\subsystem\augury.dm" #include "code\controllers\subsystem\autotransfer.dm" #include "code\controllers\subsystem\blackbox.dm" +#include "code\controllers\subsystem\callback.dm" #include "code\controllers\subsystem\chat.dm" #include "code\controllers\subsystem\communications.dm" #include "code\controllers\subsystem\dbcore.dm"