Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rae515 #53

Closed
wants to merge 15 commits into from
6 changes: 3 additions & 3 deletions _build_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
export RUST_G_VERSION=3.1.0

# byond version
export BYOND_MAJOR=514
export BYOND_MINOR=1589
export BYOND_MAJOR=515
export BYOND_MINOR=1630
export MACRO_COUNT=4

# node version
export NODE_VERSION=20
export NODE_VERSION_PRECISE=20.9.0

# SpacemanDMM git tag
export SPACEMAN_DMM_VERSION=suite-1.7
export SPACEMAN_DMM_VERSION=suite-1.8

# Python version for mapmerge and other tools
export PYTHON_VERSION=3.9.0
Expand Down
32 changes: 31 additions & 1 deletion code/ATMOSPHERICS/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pipelines + Other Objects -> Pipe network
power_channel = ENVIRON
var/nodealert = 0
var/power_rating //the maximum amount of power the machine can use to do work, affects how powerful the machine is, in Watts

unacidable = TRUE
layer = ATMOS_LAYER
plane = PLATING_PLANE
Expand Down Expand Up @@ -49,6 +49,12 @@ Pipelines + Other Objects -> Pipe network
pipe_color = null
init_dir()

//ChompEDIT START - fix hard qdels - wow pipes don't give a shit about refs
/obj/machinery/atmospherics/Destroy()
disconnectall()
. = ..()
//ChompEDIT End

/obj/machinery/atmospherics/examine_icon()
return icon(icon=initial(icon),icon_state=initial(icon_state))

Expand Down Expand Up @@ -229,3 +235,27 @@ Pipelines + Other Objects -> Pipe network
// pixel_x = PIPE_PIXEL_OFFSET_X(piping_layer)
// pixel_y = PIPE_PIXEL_OFFSET_Y(piping_layer)
// layer = initial(layer) + PIPE_LAYER_OFFSET(piping_layer)


//ChompEDIT START - fix hard qdels - wow pipes don't give a shit about refs
// Check currently assigned nodes for referencing us. If they do, deref ourselves, force them to rebuild and then deref them
/obj/machinery/atmospherics/proc/disconnectall()
if(node1)
var/obj/machinery/atmospherics/node1thing = node1
if(node1thing.node1 == src)
node1thing.node1 = null
if(node1thing.node2 == src)
node1thing.node2 = null
node1 = null
node1thing.atmos_init()
node1thing.build_network()
if(node2)
var/obj/machinery/atmospherics/node2thing = node2
if(node2thing.node1 == src)
node2thing.node1 = null
if(node2thing.node2 == src)
node2thing.node2 = null
node2 = null
node2thing.atmos_init()
node2thing.build_network()
//ChompEDIT End
4 changes: 0 additions & 4 deletions code/__byond_version_compat.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
#if DM_VERSION >= 515
#error PLEASE MAKE SURE THAT 515 IS PROPERLY TESTED AND WORKS. ESPECIALLY THE SAVE-FILES HAVE TO WORK.
#error Additionally: Make sure that the GitHub Workflow was updated to BYOND 515 as well.
#endif

// These defines are from __513_compatibility.dm -- Please Sort
#define CLAMP(CLVALUE, CLMIN, CLMAX) clamp(CLVALUE, CLMIN, CLMAX)
Expand Down
17 changes: 17 additions & 0 deletions code/__defines/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -779,3 +779,20 @@
#define ELEMENT_CONFLICT_FOUND (1<<0)
//From reagents touch_x.
#define COMSIG_REAGENTS_TOUCH "reagent_touch"


//Moved observer stuff to DCS
#define COMSIG_OBSERVER_MOVED "observer_move"
#define COMSIG_OBSERVER_DESTROYED "observer_destroyed"
#define COMSIG_OBSERVER_SHUTTLE_ADDED "observer_shuttle_added"
#define COMSIG_OBSERVER_SHUTTLE_PRE_MOVE "observer_shuttle_premove"
#define COMSIG_OBSERVER_SHUTTLE_MOVED "observer_shuttle_moved"
#define COMSIG_OBSERVER_TURF_ENTERED "observer_turf_entered"
#define COMSIG_OBSERVER_TURF_EXITED "observer_turf_exited"
#define COMSIG_OBSERVER_Z_MOVED "observer_z_moved"
#define COMSIG_OBSERVER_MOB_EQUIPPED "observer_mob_equipped"
#define COMSIG_OBSERVER_ITEM_EQUIPPED "observer_item_equipped"
#define COMSIG_OBSERVER_MOB_UNEQUIPPED "observer_mob_unequipped"
#define COMSIG_OBSERVER_ITEM_UNEQUIPPED "observer_item_unequipped"
#define COMSIG_OBSERVER_APC "observer_apc"
#define COMSIG_OBSERVER_GLOBALMOVED "observer_global_move"
41 changes: 29 additions & 12 deletions code/__defines/qdel.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
//defines that give qdel hints. these can be given as a return in destory() or by calling
//! Defines that give qdel hints.
//!
//! These can be given as a return in [/atom/proc/Destroy] or by calling [/proc/qdel].

/// `qdel` should queue the object for deletion.
#define QDEL_HINT_QUEUE 0
Expand All @@ -11,41 +13,56 @@
// Qdel should assume this object won't gc, and hard delete it posthaste.
#define QDEL_HINT_HARDDEL_NOW 4


#ifdef REFERENCE_TRACKING
/** If REFERENCE_TRACKING is enabled, qdel will call this object's find_references() verb.
*
* Functionally identical to [QDEL_HINT_QUEUE] if [GC_FAILURE_HARD_LOOKUP] is not enabled in _compiler_options.dm.
*/
#warn TG0001 qdel REFERENCE_TRACKING enabled
#define QDEL_HINT_FINDREFERENCE 5
/// Behavior as [QDEL_HINT_FINDREFERENCE], but only if the GC fails and a hard delete is forced.
#define QDEL_HINT_IFFAIL_FINDREFERENCE 6
#endif

#define GC_QUEUE_CHECK 1
#define GC_QUEUE_HARDDELETE 2
#define GC_QUEUE_COUNT 2 //increase this when adding more steps.
// Defines for the ssgarbage queues
#define GC_QUEUE_FILTER 1 //! short queue to filter out quick gc successes so they don't hang around in the main queue for 5 minutes
#define GC_QUEUE_CHECK 2 //! main queue that waits 5 minutes because thats the longest byond can hold a reference to our shit.
#define GC_QUEUE_HARDDELETE 3 //! short queue for things that hard delete instead of going thru the gc subsystem, this is purely so if they *can* softdelete, they will soft delete rather then wasting time with a hard delete.
#define GC_QUEUE_COUNT 3 //! Number of queues, used for allocating the nested lists. Don't forget to increase this if you add a new queue stage


// Defines for the ssgarbage queue items
#define GC_QUEUE_ITEM_QUEUE_TIME 1 //! Time this item entered the queue
#define GC_QUEUE_ITEM_REF 2 //! Ref to the item
#define GC_QUEUE_ITEM_GCD_DESTROYED 3 //! Item's gc_destroyed var value. Used to detect ref reuse.
#define GC_QUEUE_ITEM_INDEX_COUNT 3 //! Number of item indexes, used for allocating the nested lists. Don't forget to increase this if you add a new queue item index

// Defines for the time an item has to get its reference cleaned before it fails the queue and moves to the next.
#define GC_FILTER_QUEUE (1 SECONDS)
#define GC_CHECK_QUEUE (5 MINUTES)
#define GC_DEL_QUEUE (10 SECONDS)


#define QDEL_ITEM_ADMINS_WARNED (1<<0) //! Set when admins are told about lag causing qdels in this type.
#define QDEL_ITEM_SUSPENDED_FOR_LAG (1<<1) //! Set when a type can no longer be hard deleted on failure because of lag it causes while this happens.

// Defines for the [gc_destroyed][/datum/var/gc_destroyed] var.
#define GC_QUEUED_FOR_QUEUING -1
#define GC_CURRENTLY_BEING_QDELETED -2

#define QDELING(X) (X.gc_destroyed)
#define QDELETED(X) (!X || X.gc_destroyed)
#define QDELETED(X) (isnull(X) || QDELING(X))
#define QDESTROYING(X) (!X || X.gc_destroyed == GC_CURRENTLY_BEING_QDELETED)

//Qdel helper macros.
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), item), time, TIMER_STOPPABLE)
// This is a bit hacky, we do it to avoid people relying on a return value for the macro
// If you need that you should use QDEL_IN_STOPPABLE instead
#define QDEL_IN(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time);
#define QDEL_IN_STOPPABLE(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), (time) > GC_FILTER_QUEUE ? WEAKREF(item) : item), time, TIMER_STOPPABLE)
#define QDEL_IN_CLIENT_TIME(item, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(qdel), item), time, TIMER_STOPPABLE | TIMER_CLIENT_TIME)
#define QDEL_NULL(item) if(item) {qdel(item); item = null}
#define QDEL_NULL(item) qdel(item); item = null
#define QDEL_NULL_LIST QDEL_LIST_NULL
#define QDEL_LIST_NULL(x) if(x) { for(var/y in x) { qdel(y) } ; x = null }
#define QDEL_LIST(L) if(L) { for(var/I in L) qdel(I); L.Cut(); }
#define QDEL_LIST_IN(L, time) addtimer(CALLBACK(GLOBAL_PROC, GLOBAL_PROC_REF(______qdel_list_wrapper), L), time, TIMER_STOPPABLE)
#define QDEL_LIST_ASSOC(L) if(L) { for(var/I in L) { qdel(L[I]); qdel(I); } L.Cut(); }
#define QDEL_LIST_ASSOC_VAL(L) if(L) { for(var/I in L) qdel(L[I]); L.Cut(); }

/proc/______qdel_list_wrapper(list/L) //the underscores are to encourage people not to use this directly.
QDEL_LIST(L)
1 change: 1 addition & 0 deletions code/__defines/subsystems.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ var/global/list/runlevel_flags = list(RUNLEVEL_LOBBY, RUNLEVEL_SETUP, RUNLEVEL_G
#define FIRE_PRIORITY_PING 10
#define FIRE_PRIORITY_AI 10
#define FIRE_PRIORITY_GARBAGE 15
#define FIRE_PRIORITY_ASSETS 20
#define FIRE_PRIORITY_ALARM 20
#define FIRE_PRIORITY_CHARSETUP 25
#define FIRE_PRIORITY_AIRFLOW 30
Expand Down
6 changes: 3 additions & 3 deletions code/_global_vars/misc.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
GLOBAL_LIST_EMPTY(error_last_seen)
GLOBAL_LIST_EMPTY(error_cooldown)

GLOBAL_DATUM_INIT(all_observable_events, /datum/all_observable_events, new) // This is a datum. It is not a list.
GLOBAL_DATUM_INIT(destroyed_event, /decl/observ/destroyed, new())
//GLOBAL_DATUM_INIT(all_observable_events, /datum/all_observable_events, new) // This is a datum. It is not a list.
//GLOBAL_DATUM_INIT(destroyed_event, /decl/observ/destroyed, new())

GLOBAL_VAR_INIT(timezoneOffset, 0) // The difference betwen midnight (of the host computer) and 0 world.ticks.

GLOBAL_VAR_INIT(TAB, "&nbsp;&nbsp;&nbsp;&nbsp;")
GLOBAL_VAR_INIT(TAB, "&nbsp;&nbsp;&nbsp;&nbsp;")
2 changes: 1 addition & 1 deletion code/_helpers/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
// atoms/items/objects can be pretty and whatnot
var/atom/A = item
if(output_icons && isicon(A.icon) && !ismob(A)) // mobs tend to have unusable icons
item_str += "\icon[A][bicon(A)]&nbsp;"
item_str += "[bicon(A)]&nbsp;"
switch(determiners)
if(DET_NONE) item_str += A.name
if(DET_DEFINITE) item_str += "\the [A]"
Expand Down
22 changes: 14 additions & 8 deletions code/_helpers/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -534,6 +534,12 @@ GLOBAL_LIST_EMPTY(cached_examine_icons)
CRASH("get_dummy_savefile failed to create a dummy savefile: '[error]'")
return get_dummy_savefile(from_failure = TRUE)

/// Generate a filename for this asset
/// The same asset will always lead to the same asset name
/// (Generated names do not include file extention.)
/proc/generate_asset_name(file)
return "asset.[md5(fcopy_rsc(file))]"

/**
* Converts an icon to base64. Operates by putting the icon in the iconCache savefile,
* exporting it as text, and then parsing the base64 from that.
Expand Down Expand Up @@ -653,12 +659,12 @@ GLOBAL_LIST_EMPTY(cached_examine_icons)
//var/name = SANITIZE_FILENAME("[generate_asset_name(thing)].png")
var/name = "[generate_asset_name(thing)].png"
if (!SSassets.cache[name])
register_asset(name, thing)
SSassets.transport.register_asset(name, thing)
for (var/thing2 in targets)
send_asset(thing2, name)
SSassets.transport.send_assets(thing2, name)
if(sourceonly)
return get_asset_url(name)
return "<img class='[extra_classes] icon icon-misc' src='[get_asset_url(name)]'>"
return SSassets.transport.get_asset_url(name)
return "<img class='[extra_classes] icon icon-misc' src='[SSassets.transport.get_asset_url(name)]'>"

//its either an atom, image, or mutable_appearance, we want its icon var
icon2collapse = thing.icon
Expand Down Expand Up @@ -695,12 +701,12 @@ GLOBAL_LIST_EMPTY(cached_examine_icons)
key = "[name_and_ref[3]].png"

if(!SSassets.cache[key])
register_asset(key, rsc_ref, file_hash, icon_path)
SSassets.transport.register_asset(key, rsc_ref, file_hash, icon_path)
for (var/client_target in targets)
send_asset(client_target, key)
SSassets.transport.send_assets(client_target, key)
if(sourceonly)
return get_asset_url(key)
return "<img class='[extra_classes] icon icon-[icon_state]' src='[get_asset_url(key)]'>"
return SSassets.transport.get_asset_url(key)
return "<img class='[extra_classes] icon icon-[icon_state]' src='[SSassets.transport.get_asset_url(key)]'>"

/proc/icon2base64html(target, var/custom_classes = "")
if (!target)
Expand Down
12 changes: 8 additions & 4 deletions code/_helpers/sorts/TimSort.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
if(toIndex <= 0)
toIndex += L.len + 1

sortInstance.L = L
sortInstance.cmp = cmp
sortInstance.associative = associative
var/datum/sort_instance/SI = GLOB.sortInstance
if(!SI)
SI = new

sortInstance.timSort(fromIndex, toIndex)
SI.L = L
SI.cmp = cmp
SI.associative = associative

SI.timSort(fromIndex, toIndex)

return L
Loading
Loading