diff --git a/byond-extools.dll b/byond-extools.dll deleted file mode 100644 index 4d030a79f90..00000000000 Binary files a/byond-extools.dll and /dev/null differ diff --git a/code/__DEFINES/_tick.dm b/code/__DEFINES/_tick.dm index 16a07be3bdb..5c5b7d192d9 100644 --- a/code/__DEFINES/_tick.dm +++ b/code/__DEFINES/_tick.dm @@ -1,19 +1,14 @@ /// Percentage of tick to leave for master controller to run -#define MAPTICK_MC_MIN_RESERVE 58 //SKYRAT EDIT ORIGINAL: 70 -/// internal_tick_usage is updated every tick by extools -#if defined(USE_EXTOOLS) || DM_VERSION < 514 -#define MAPTICK_LAST_INTERNAL_TICK_USAGE ((GLOB.internal_tick_usage / world.tick_lag) * 100) -#else +#define MAPTICK_MC_MIN_RESERVE 70 #define MAPTICK_LAST_INTERNAL_TICK_USAGE (world.map_cpu) -#endif /// Tick limit while running normally -#define TICK_BYOND_RESERVE 16 //SKYRAT EDIT +#define TICK_BYOND_RESERVE 2 #define TICK_LIMIT_RUNNING (max(100 - TICK_BYOND_RESERVE - MAPTICK_LAST_INTERNAL_TICK_USAGE, MAPTICK_MC_MIN_RESERVE)) /// Tick limit used to resume things in stoplag -#define TICK_LIMIT_TO_RUN 58 //SKYRAT EDIT ORIGINAL: 70 +#define TICK_LIMIT_TO_RUN 70 /// Tick limit for MC while running -#define TICK_LIMIT_MC 58 //SKYRAT EDIT ORIGINAL: 70 +#define TICK_LIMIT_MC 70 /// Tick limit while initializing #define TICK_LIMIT_MC_INIT_DEFAULT (100 - TICK_BYOND_RESERVE) diff --git a/code/_compile_options.dm b/code/_compile_options.dm index 4119a202f17..cbe2de054fb 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -52,21 +52,12 @@ #endif //Update this whenever you need to take advantage of more recent byond features -#define MIN_COMPILER_VERSION 513 -#define MIN_COMPILER_BUILD 1514 -#if DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD +#define MIN_COMPILER_VERSION 514 +#define MIN_COMPILER_BUILD 1557 //SKYRAT EDIT CHANGE - Compiler failure due to insufficent memory when running previous builds. +#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM) //Don't forget to update this part #error Your version of BYOND is too out-of-date to compile this project. Go to https://secure.byond.com/download and update. -#error You need version 513.1514 or higher -#endif - -//Don't load extools on 514 and 513.1539+ -#if DM_VERSION < 514 && DM_BUILD < 1540 -#define USE_EXTOOLS -#endif -//Log the full sendmaps profile on 514.1556+, any earlier and we get bugs or it not existing -#if DM_VERSION >= 514 && DM_BUILD >= 1556 -#define SENDMAPS_PROFILE +#error You need version 514.1556 or higher #endif //Additional code for the above flags. diff --git a/code/controllers/subsystem/profiler.dm b/code/controllers/subsystem/profiler.dm index 337d606ed4e..089131d0966 100644 --- a/code/controllers/subsystem/profiler.dm +++ b/code/controllers/subsystem/profiler.dm @@ -1,9 +1,7 @@ #define PROFILER_FILENAME "profiler.json" - -#ifdef SENDMAPS_PROFILE #define SENDMAPS_FILENAME "sendmaps.json" GLOBAL_REAL_VAR(world_init_maptick_profiler) = world.Profile(PROFILE_RESTART, type = "sendmaps") -#endif + SUBSYSTEM_DEF(profiler) name = "Profiler" @@ -32,41 +30,22 @@ SUBSYSTEM_DEF(profiler) /datum/controller/subsystem/profiler/Shutdown() if(CONFIG_GET(flag/auto_profile)) DumpFile() -#ifdef SENDMAPS_PROFILE world.Profile(PROFILE_CLEAR, type = "sendmaps") -#endif return ..() /datum/controller/subsystem/profiler/proc/StartProfiling() -#if DM_BUILD < 1506 - stack_trace("Auto profiling unsupported on this byond version") - CONFIG_SET(flag/auto_profile, FALSE) -#else world.Profile(PROFILE_START) -#ifdef SENDMAPS_PROFILE world.Profile(PROFILE_START, type = "sendmaps") -#endif - -#endif /datum/controller/subsystem/profiler/proc/StopProfiling() -#if DM_BUILD >= 1506 world.Profile(PROFILE_STOP) -#ifdef SENDMAPS_PROFILE world.Profile(PROFILE_STOP, type = "sendmaps") -#endif -#endif + /datum/controller/subsystem/profiler/proc/DumpFile() -#if DM_BUILD < 1506 - stack_trace("Auto profiling unsupported on this byond version") - CONFIG_SET(flag/auto_profile, FALSE) -#else var/timer = TICK_USAGE_REAL var/current_profile_data = world.Profile(PROFILE_REFRESH, format = "json") -#ifdef SENDMAPS_PROFILE var/current_sendmaps_data = world.Profile(PROFILE_REFRESH, type = "sendmaps", format="json") -#endif fetch_cost = MC_AVERAGE(fetch_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) CHECK_TICK @@ -75,18 +54,13 @@ SUBSYSTEM_DEF(profiler) var/prof_file = file("[GLOB.log_directory]/[PROFILER_FILENAME]") if(fexists(prof_file)) fdel(prof_file) -#ifdef SENDMAPS_PROFILE if(!length(current_sendmaps_data)) //Would be nice to have explicit proc to check this stack_trace("Warning, sendmaps profiling stopped manually before dump.") var/sendmaps_file = file("[GLOB.log_directory]/[SENDMAPS_FILENAME]") if(fexists(sendmaps_file)) fdel(sendmaps_file) -#endif timer = TICK_USAGE_REAL WRITE_FILE(prof_file, current_profile_data) -#ifdef SENDMAPS_PROFILE WRITE_FILE(sendmaps_file, current_sendmaps_data) -#endif write_cost = MC_AVERAGE(write_cost, TICK_DELTA_TO_MS(TICK_USAGE_REAL - timer)) -#endif diff --git a/code/controllers/subsystem/time_track.dm b/code/controllers/subsystem/time_track.dm index 0c069596f2a..c2a0ff0f195 100644 --- a/code/controllers/subsystem/time_track.dm +++ b/code/controllers/subsystem/time_track.dm @@ -15,7 +15,6 @@ SUBSYSTEM_DEF(time_track) var/last_tick_realtime = 0 var/last_tick_byond_time = 0 var/last_tick_tickcount = 0 -#ifdef SENDMAPS_PROFILE var/list/sendmaps_names_map = list( "SendMaps" = "send_maps", "SendMaps: Initial housekeeping" = "initial_house", @@ -41,19 +40,16 @@ SUBSYSTEM_DEF(time_track) "SendMaps: Per client: Map data: Look for movable changes: Loop through turfs in range" = "turfs_in_range", "SendMaps: Per client: Map data: Look for movable changes: Movables examined" = "movables_examined", ) -#endif /datum/controller/subsystem/time_track/Initialize(start_timeofday) . = ..() GLOB.perf_log = "[GLOB.log_directory]/perf-[GLOB.round_id ? GLOB.round_id : "NULL"]-[SSmapping.config?.map_name].csv" -#ifdef SENDMAPS_PROFILE world.Profile(PROFILE_RESTART, type = "sendmaps") //Need to do the sendmaps stuff in its own file, since it works different then everything else - var/list/sendmaps_shorthands = list() + var/list/sendmaps_headers = list() for(var/proper_name in sendmaps_names_map) - sendmaps_shorthands += sendmaps_names_map[proper_name] - sendmaps_shorthands += "[sendmaps_names_map[proper_name]]_count" -#endif + sendmaps_headers += sendmaps_names_map[proper_name] + sendmaps_headers += "[sendmaps_names_map[proper_name]]_count" log_perf( list( "time", @@ -80,13 +76,10 @@ SUBSYSTEM_DEF(time_track) "all_queries", "queries_active", "queries_standby" -#ifdef SENDMAPS_PROFILE - ) + sendmaps_shorthands -#else - ) -#endif + ) + sendmaps_headers ) + /datum/controller/subsystem/time_track/fire() var/current_realtime = REALTIMEOFDAY @@ -108,7 +101,6 @@ SUBSYSTEM_DEF(time_track) last_tick_byond_time = current_byondtime last_tick_tickcount = current_tickcount -#ifdef SENDMAPS_PROFILE var/sendmaps_json = world.Profile(PROFILE_REFRESH, type = "sendmaps", format="json") var/list/send_maps_data = json_decode(sendmaps_json) var/send_maps_sort = send_maps_data.Copy() //Doing it like this guarentees us a properly sorted list @@ -117,10 +109,14 @@ SUBSYSTEM_DEF(time_track) send_maps_sort[packet["name"]] = packet var/list/send_maps_values = list() - for(var/list/packet in send_maps_sort) + for(var/entry_name in sendmaps_names_map) + var/list/packet = send_maps_sort[entry_name] + if(!packet) //If the entry does not have a value for us, just put in 0 for both + send_maps_values += 0 + send_maps_values += 0 + continue send_maps_values += packet["value"] send_maps_values += packet["calls"] -#endif SSblackbox.record_feedback("associative", "time_dilation_current", 1, list("[SQLtime()]" = list("current" = "[time_dilation_current]", "avg_fast" = "[time_dilation_avg_fast]", "avg" = "[time_dilation_avg]", "avg_slow" = "[time_dilation_avg_slow]"))) log_perf( @@ -149,23 +145,7 @@ SUBSYSTEM_DEF(time_track) SSdbcore.all_queries_num, SSdbcore.queries_active_num, SSdbcore.queries_standby_num -#ifdef SENDMAPS_PROFILE ) + send_maps_values -#else - ) -#endif ) SSdbcore.reset_tracking() - -#ifdef SENDMAPS_PROFILE -/datum/controller/subsystem/time_track/proc/scream_maptick_data() - var/current_profile_data = world.Profile(PROFILE_REFRESH, type = "sendmaps", format="json") - log_world(current_profile_data) - current_profile_data = json_decode(current_profile_data) - var/output = "" - for(var/list/entry in current_profile_data) - output += "[entry["name"]],[entry["value"]],[entry["calls"]]\n" - log_world(output) - return output -#endif diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index db5eed3fb5c..44507d4d70a 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -307,11 +307,7 @@ GLOBAL_LIST_EMPTY(cryopod_computers) visible_message(span_notice("[src] hums and hisses as it moves [mob_occupant.real_name] into storage.")) -#if MIN_COMPILER_VERSION >= 514 - #warn Please replace the loop below this warning with an `as anything` loop. -#endif - for(var/mob_content in mob_occupant) - var/obj/item/item_content = mob_content + for(var/obj/item/item_content as anything in mob_occupant) if(!istype(item_content) || HAS_TRAIT(item_content, TRAIT_NODROP)) continue diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index a33edea27d2..0882cb5959b 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -287,14 +287,8 @@ GLOBAL_VAR_INIT(icon_holographic_window, init_holographic_window()) var/skip_to_next_turf = FALSE - #if MIN_COMPILER_VERSION >= 514 - #warn Please replace the loop below this warning with an `as anything` loop. - #endif - for (var/_content_of_turf in surrounding_turf.contents) - // `as anything` doesn't play well on 513 with special lists such as contents. - // When the minimum version is raised to 514, upgrade this to `as anything`. - var/atom/content_of_turf = _content_of_turf + for (var/atom/content_of_turf as anything in surrounding_turf.contents) if (content_of_turf.density) skip_to_next_turf = TRUE break diff --git a/code/game/world.dm b/code/game/world.dm index 2369e6e07fa..f32bb198071 100644 --- a/code/game/world.dm +++ b/code/game/world.dm @@ -29,11 +29,6 @@ GLOBAL_VAR(restart_counter) * All atoms in both compiled and uncompiled maps are initialized() */ /world/New() -#ifdef USE_EXTOOLS - var/extools = world.GetConfig("env", "EXTOOLS_DLL") || (world.system_type == MS_WINDOWS ? "./byond-extools.dll" : "./libbyond-extools.so") - if (fexists(extools)) - call(extools, "maptick_initialize")() -#endif enable_debugger() log_world("World loaded at [time_stamp()]!") @@ -49,7 +44,7 @@ GLOBAL_VAR(restart_counter) config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER]) load_admins() - load_mentors() //SKYRAT EDIT + //SetupLogs depends on the RoundID, so lets check //DB schema and set RoundID if we can SSdbcore.CheckSchemaVersion() @@ -323,8 +318,7 @@ GLOBAL_VAR(restart_counter) s += ": [jointext(features, ", ")]" status = s -*/ //SKYRAT EDIT END - +*/ /world/proc/update_hub_visibility(new_visibility) if(new_visibility == GLOB.hub_visibility) return diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 4ed8381bd01..e2a5de369b3 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -198,9 +198,7 @@ GLOBAL_PROTECT(admin_verbs_debug) /client/proc/export_dynamic_json, /client/proc/run_dynamic_simulations, #endif - #ifdef SENDMAPS_PROFILE /client/proc/display_sendmaps, - #endif /datum/admins/proc/create_or_modify_area, /client/proc/check_timer_sources, /client/proc/toggle_cdn, @@ -830,10 +828,8 @@ GLOBAL_PROTECT(admin_verbs_hideable) var/datum/admins/admin = GLOB.admin_datums[ckey] admin?.associate(src) -#ifdef SENDMAPS_PROFILE /client/proc/display_sendmaps() set name = "Send Maps Profile" set category = "Debug" src << link("?debug=profile&type=sendmaps&window=test") -#endif diff --git a/code/modules/vehicles/motorized_wheelchair.dm b/code/modules/vehicles/motorized_wheelchair.dm index 32dd8e2de0a..0030e616ae5 100644 --- a/code/modules/vehicles/motorized_wheelchair.dm +++ b/code/modules/vehicles/motorized_wheelchair.dm @@ -39,11 +39,7 @@ /obj/vehicle/ridden/wheelchair/motorized/obj_destruction(damage_flag) var/turf/T = get_turf(src) -#if MIN_COMPILER_VERSION >= 514 - #warn Please replace the loop below this warning with an `as anything` loop. -#endif - for(var/wheelchair_content in contents) - var/atom/movable/atom_content = wheelchair_content + for(var/atom/movable/atom_content as anything in contents) atom_content.forceMove(T) return ..() @@ -120,11 +116,7 @@ new /obj/item/stack/rods(drop_location(), 8) new /obj/item/stack/sheet/iron(drop_location(), 10) var/turf/T = get_turf(src) -#if MIN_COMPILER_VERSION >= 514 - #warn Please replace the loop below this warning with an `as anything` loop. -#endif - for(var/wheelchair_content in contents) - var/atom/movable/atom_content = wheelchair_content + for(var/atom/movable/atom_content as anything in contents) atom_content.forceMove(T) qdel(src) return TRUE diff --git a/dependencies.sh b/dependencies.sh index 88109ad5e5c..c9b91b88116 100755 --- a/dependencies.sh +++ b/dependencies.sh @@ -5,7 +5,7 @@ # byond version export BYOND_MAJOR=514 -export BYOND_MINOR=1557 +export BYOND_MINOR=1557 #SKYRAT EDIT CHANGE - Compiler failure due to insufficent memory when running previous builds. #rust_g git tag export RUST_G_VERSION=0.4.8 @@ -17,8 +17,5 @@ export NODE_VERSION_PRECISE=12.20.0 # SpacemanDMM git tag export SPACEMAN_DMM_VERSION=suite-1.7 -# Extools git tag -export EXTOOLS_VERSION=v0.0.7 - # Python version for mapmerge and other tools export PYTHON_VERSION=3.6.8 diff --git a/tools/tgs4_scripts/PreCompile.sh b/tools/tgs4_scripts/PreCompile.sh index f21036ab191..69a6f35cf64 100755 --- a/tools/tgs4_scripts/PreCompile.sh +++ b/tools/tgs4_scripts/PreCompile.sh @@ -66,32 +66,6 @@ env PKG_CONFIG_ALLOW_CROSS=1 ~/.cargo/bin/cargo build --release --target=i686-un mv target/i686-unknown-linux-gnu/release/librust_g.so "$1/librust_g.so" cd .. -# get dependencies for extools -apt-get install -y cmake build-essential gcc-multilib g++-multilib cmake wget - -# update extools -if [ ! -d "extools" ]; then - echo "Cloning extools..." - git clone https://github.com/MCHSL/extools - cd extools/byond-extools -else - echo "Fetching extools..." - cd extools/byond-extools - git fetch -fi - -echo "Deploying extools..." -git checkout "$EXTOOLS_VERSION" -if [ -d "build" ]; then - rm -R build -fi -mkdir build -cd build -cmake .. -make -mv libbyond-extools.so "$1/libbyond-extools.so" -cd ../../.. - # install or update youtube-dl when not present, or if it is present with pip3, # which we assume was used to install it if ! [ -x "$has_youtubedl" ]; then