Skip to content

Commit

Permalink
Merge pull request #1002 from dwasint/various-things
Browse files Browse the repository at this point in the history
new server new me
  • Loading branch information
dwasint authored Feb 10, 2024
2 parents bd88aea + dae4960 commit b0ef3cf
Show file tree
Hide file tree
Showing 171 changed files with 2,711 additions and 459 deletions.
2 changes: 1 addition & 1 deletion .github/alternate_byond_versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Example:
# 500.1337: runtimestation

515.1603: runtimestation
515.1620: runtimestation
5 changes: 1 addition & 4 deletions .github/workflows/autowiki.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
autowiki:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- name: "Check for AUTOWIKI_USERNAME"
id: secrets_set
Expand All @@ -30,9 +30,6 @@ jobs:
- name: Install rust-g
if: steps.secrets_set.outputs.SECRETS_ENABLED
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
bash tools/ci/install_rust_g.sh
- name: Compile and generate Autowiki files
if: steps.secrets_set.outputs.SECRETS_ENABLED
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ on:
type: string
jobs:
run_integration_tests:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
services:
mysql:
image: mysql:latest
Expand All @@ -43,9 +43,6 @@ jobs:
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
- name: Install rust-g
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install -o APT::Immediate-Configure=false libssl1.1:i386
bash tools/ci/install_rust_g.sh
- name: Install auxlua
run: |
Expand Down
2 changes: 1 addition & 1 deletion .tgs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: 1
# The BYOND version to use (kept in sync with dependencies.sh by the "TGS Test Suite" CI job)
# Must be interpreted as a string, keep quoted
byond: "514.1588"
byond: "515.1610"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static
Expand Down
9 changes: 0 additions & 9 deletions code/__DEFINES/_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,5 @@
} \
sleep(time);

#ifdef EXPERIMENT_515_DONT_CACHE_REF
/// Takes a datum as input, returns its ref string
#define text_ref(datum) ref(datum)
#else
/// Takes a datum as input, returns its ref string, or a cached version of it
/// This allows us to cache \ref creation, which ensures it'll only ever happen once per datum, saving string tree time
/// It is slightly less optimal then a []'d datum, but the cost is massively outweighed by the potential savings
/// It will only work for datums mind, for datum reasons
/// : because of the embedded typecheck
#define text_ref(datum) (isdatum(datum) ? (datum:cached_ref ||= "\ref[datum]") : ("\ref[datum]"))
#endif
4 changes: 4 additions & 0 deletions code/__DEFINES/_protect.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
///Protects a datum from being VV'd or spawned through admin manipulation
#ifndef TESTING
#define GENERAL_PROTECT_DATUM(Path)\
##Path/can_vv_get(var_name){\
return FALSE;\
Expand All @@ -15,3 +16,6 @@
##Path/Write(savefile/savefile){\
return;\
}
#else
#define GENERAL_PROTECT_DATUM(Path)
#endif
3 changes: 2 additions & 1 deletion code/__DEFINES/blackmarket.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@
#define SHIPPING_METHOD_TELEPORT "Teleport"
// Throws the item from somewhere at the station.
#define SHIPPING_METHOD_LAUNCH "Launch"

/// item appears at your feet used by auctions
#define SHIPPING_METHOD_AT_FEET "Feet"
2 changes: 2 additions & 0 deletions code/__DEFINES/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ GLOBAL_LIST_INIT(crafting_category_food, list(
#define CAT_ENTERTAINMENT "Entertainment"
#define CAT_TOOLS "Tools"
#define CAT_CULT "Blood Cult"
#define CAT_GUNPARTS "Gun Parts"

GLOBAL_LIST_INIT(crafting_category, list(
CAT_WEAPON_RANGED,
Expand All @@ -166,6 +167,7 @@ GLOBAL_LIST_INIT(crafting_category, list(
CAT_ENTERTAINMENT,
CAT_TOOLS,
CAT_CULT,
CAT_GUNPARTS,
))

//rcd modes
Expand Down
9 changes: 6 additions & 3 deletions code/__DEFINES/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
#define LOG_RADIO_EMOTE (1 << 20)
#define LOG_SPEECH_INDICATORS (1 << 21)
#define LOG_CLONING (1 << 22)
#define LOG_MECHCOMP (1 <<23)
#define LOG_MECHCOMP (1 << 23)
#define LOG_BLACKMARKET (1 << 24)

//Individual logging panel pages
#define INDIVIDUAL_GAME_LOG (LOG_GAME)
Expand Down Expand Up @@ -86,8 +87,9 @@
#define LOG_ENTRY_KEY_ID "id"
#define LOG_ENTRY_KEY_SCHEMA_VERSION "s-ver"

// Category for invalid/missing categories
#define LOG_CATEGORY_NOT_FOUND "invalid-category"
// Internal categories
#define LOG_CATEGORY_INTERNAL_CATEGORY_NOT_FOUND "internal-category-not-found"
#define LOG_CATEGORY_INTERNAL_ERROR "internal-error"

// Misc categories
#define LOG_CATEGORY_ATTACK "attack"
Expand All @@ -114,6 +116,7 @@
#define LOG_CATEGORY_MUSIC "music"
#define LOG_CATEGORY_META "currency"
#define LOG_CATEGORY_ARTIFACT "artifact"
#define LOG_CATEGORY_BLACKMARKET "blackmarket"

// Admin categories
#define LOG_CATEGORY_ADMIN "admin"
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/overlays.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// A reasonable number of maximum overlays an object needs
// If you think you need more, rethink it
#define MAX_ATOM_OVERLAYS 100
#define MAX_ATOM_OVERLAYS 250

/// Checks if an atom has reached the overlay limit, and make a loud error if it does.
#define VALIDATE_OVERLAY_LIMIT(changed_on) \
Expand Down
22 changes: 16 additions & 6 deletions code/__DEFINES/rust_g.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@
#endif

// Handle 515 call() -> call_ext() changes
#if DM_VERSION >= 515
#define RUSTG_CALL call_ext
#else
#define RUSTG_CALL call
#endif


/// Gets the version of rust_g
/proc/rustg_get_version() return RUSTG_CALL(RUST_G, "get_version")()
Expand Down Expand Up @@ -110,9 +107,15 @@
#define rustg_dmi_strip_metadata(fname) RUSTG_CALL(RUST_G, "dmi_strip_metadata")(fname)
#define rustg_dmi_create_png(path, width, height, data) RUSTG_CALL(RUST_G, "dmi_create_png")(path, width, height, data)
#define rustg_dmi_resize_png(path, width, height, resizetype) RUSTG_CALL(RUST_G, "dmi_resize_png")(path, width, height, resizetype)
/**
* input: must be a path, not an /icon; you have to do your own handling if it is one, as icon objects can't be directly passed to rustg.
*
* output: json_encode'd list. json_decode to get a flat list with icon states in the order they're in inside the .dmi
*/
#define rustg_dmi_icon_states(fname) RUSTG_CALL(RUST_G, "dmi_icon_states")(fname)

#define rustg_file_read(fname) RUSTG_CALL(RUST_G, "file_read")(fname)
#define rustg_file_exists(fname) RUSTG_CALL(RUST_G, "file_exists")(fname)
#define rustg_file_exists(fname) (RUSTG_CALL(RUST_G, "file_exists")(fname) == "true")
#define rustg_file_write(text, fname) RUSTG_CALL(RUST_G, "file_write")(text, fname)
#define rustg_file_append(text, fname) RUSTG_CALL(RUST_G, "file_append")(text, fname)
#define rustg_file_get_line_count(fname) text2num(RUSTG_CALL(RUST_G, "file_get_line_count")(fname))
Expand All @@ -123,7 +126,13 @@
#define text2file(text, fname) rustg_file_append(text, "[fname]")
#endif

/// Returns the git hash of the given revision, ex. "HEAD".
#define rustg_git_revparse(rev) RUSTG_CALL(RUST_G, "rg_git_revparse")(rev)

/**
* Returns the date of the given revision in the format YYYY-MM-DD.
* Returns null if the revision is invalid.
*/
#define rustg_git_commit_date(rev) RUSTG_CALL(RUST_G, "rg_git_commit_date")(rev)

#define RUSTG_HTTP_METHOD_GET "get"
Expand Down Expand Up @@ -158,8 +167,9 @@
#define rustg_time_milliseconds(id) text2num(RUSTG_CALL(RUST_G, "time_milliseconds")(id))
#define rustg_time_reset(id) RUSTG_CALL(RUST_G, "time_reset")(id)

/// Returns the timestamp as a string
/proc/rustg_unix_timestamp()
return text2num(RUSTG_CALL(RUST_G, "unix_timestamp")())
return RUSTG_CALL(RUST_G, "unix_timestamp")()

#define rustg_raw_read_toml_file(path) json_decode(RUSTG_CALL(RUST_G, "toml_file_to_json")(path) || "null")

Expand Down
3 changes: 2 additions & 1 deletion code/__DEFINES/sound.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#define CHANNEL_Z 1008
#define CHANNEL_WALKMAN 1007 //monkestation edit
#define CHANNEL_MASTER_VOLUME 1006
#define CHANNEL_PRUDE 1007

///Default range of a sound.
#define SOUND_RANGE 17
Expand All @@ -34,7 +35,7 @@
//THIS SHOULD ALWAYS BE THE LOWEST ONE!
//KEEP IT UPDATED

#define CHANNEL_HIGHEST_AVAILABLE 1006 //monkestation edit
#define CHANNEL_HIGHEST_AVAILABLE 1007 //monkestation edit

#define MAX_INSTRUMENT_CHANNELS (128 * 6)

Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/stamina.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
///The amount of stamina at which point swinging is free.
#define STAMINA_MAXIMUM_TO_SWING 100
///The time a mob is stunned when stamina stunned
#define STAMINA_STUN_TIME 5 SECONDS
#define STAMINA_STUN_TIME 9 SECONDS
///The base value of a stamina stun chance
#define STAMINA_SCALING_STUN_BASE 20
///The maximum additional stun chance based on missing stamina
Expand Down
2 changes: 1 addition & 1 deletion code/__DEFINES/~monkestation/_patreon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#define ASSISTANT_RANK "9641458"
#define COMMAND_RANK "9641523"
#define TRAITOR_RANK "9641531" //muh defines
#define NUKIE_RANK "9641543"
#define NUKIE_RANK "10901851"

#define ACCESS_THANKS_RANK 1
#define ACCESS_ASSISTANT_RANK 2
Expand Down
5 changes: 5 additions & 0 deletions code/__DEFINES/~monkestation/dcs/signals/signals_guns.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#define COMSIG_ATTACHMENT_ATTACHED "comsig_attachment_attached"
#define COMSIG_ATTACHMENT_DETACHED "comsig_attachment_detached"
#define COMSIG_ATTACHMENT_ATTACH_ATTEMPT "comsig_attachment_attach_attempt"
#define COMSIG_GUN_RACKED "gun_racked"
#define COMSIG_ATTACHMENT_STAT_RESET "gun_stat_reset"
16 changes: 16 additions & 0 deletions code/__DEFINES/~monkestation/guns.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#define GUN_ATTACH_AK "ak"
#define GUN_ATTACH_AK_ST "ak_st"
#define GUN_ATTACH_MK_58 "mk58"
#define GUN_ATTACH_WINTERMUTE "wintermute"

#define ATTACHMENT_TYPE_MAG "attach_mag"
#define ATTACHMENT_TYPE_STOCK "attach_stock"
#define ATTACHMENT_TYPE_GRIP "attach_grip"
#define ATTACHMENT_TYPE_BARREL "attach_barrel"
#define ATTACHMENT_TYPE_SIGHT "attach_sight"
#define ATTACHMENT_TYPE_UNDERBARREL "attach_underbarrel"
#define ATTACHMENT_TYPE_WELROD "attach_welrod"
#define ATTACHMENT_TYPE_FRAME "attach_frame"
#define ATTACHMENT_TYPE_KEYCHAIN "attach_keychain?"

#define ATTACHMENT_COLORABLE (1<<0)
2 changes: 2 additions & 0 deletions code/__DEFINES/~monkestation/market.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#define MARKET_PROCESS (1<<0)
#define MARKET_AUCTION (1<<1)
5 changes: 5 additions & 0 deletions code/__DEFINES/~monkestation/projectiles.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
//Calibers for guns
///used in mk58
#define CALIBER_435 "4.35"
///used in mk58
#define CALIBER_235 "2.35"
6 changes: 3 additions & 3 deletions code/__HELPERS/_auxtools_api.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GLOBAL_PROTECT(auxtools_initialized)
}\
if (GLOB.auxtools_initialized[LIB] != AUXTOOLS_FULL_INIT) {\
if (fexists(LIB)) {\
var/string = LIBCALL(LIB,"auxtools_init")();\
var/string = call_ext(LIB,"auxtools_init")();\
if(findtext(string, "SUCCESS")) {\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_FULL_INIT;\
} else {\
Expand All @@ -23,13 +23,13 @@ GLOBAL_PROTECT(auxtools_initialized)

#define AUXTOOLS_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] == AUXTOOLS_FULL_INIT && fexists(LIB)){\
LIBCALL(LIB,"auxtools_shutdown")();\
call_ext(LIB,"auxtools_shutdown")();\
GLOB.auxtools_initialized[LIB] = AUXTOOLS_PARTIAL_INIT;\
}\

#define AUXTOOLS_FULL_SHUTDOWN(LIB)\
if (GLOB.auxtools_initialized[LIB] && fexists(LIB)){\
LIBCALL(LIB,"auxtools_full_shutdown")();\
call_ext(LIB,"auxtools_full_shutdown")();\
GLOB.auxtools_initialized[LIB] = FALSE;\
}

Expand Down
5 changes: 5 additions & 0 deletions code/__HELPERS/logging/_logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))
log_shuttle(log_text)
if(LOG_MECHCOMP)
log_mechcomp(log_text)
if(LOG_BLACKMARKET)
log_blackmarket(log_text)
if(LOG_SPEECH_INDICATORS)
log_speech_indicators(log_text)
else
Expand Down Expand Up @@ -263,3 +265,6 @@ GLOBAL_LIST_INIT(testing_global_profiler, list("_PROFILE_NAME" = "Global"))

/proc/log_mechcomp(text, list/data)
logger.Log(LOG_CATEGORY_MECHCOMP, text, data)

/proc/log_blackmarket(text, list/data)
logger.Log(LOG_CATEGORY_BLACKMARKET, text, data)
4 changes: 0 additions & 4 deletions code/__HELPERS/nameof.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,4 @@
/**
* NAMEOF that actually works in static definitions because src::type requires src to be defined
*/
#if DM_VERSION >= 515
#define NAMEOF_STATIC(datum, X) (nameof(type::##X))
#else
#define NAMEOF_STATIC(datum, X) (#X || ##datum.##X)
#endif
46 changes: 11 additions & 35 deletions code/__byond_version_compat.dm
Original file line number Diff line number Diff line change
@@ -1,52 +1,21 @@
// This file contains defines allowing targeting byond versions newer than the supported

//Update this whenever you need to take advantage of more recent byond features
#define MIN_COMPILER_VERSION 514
#define MIN_COMPILER_BUILD 1556
#define MIN_COMPILER_VERSION 515
#define MIN_COMPILER_BUILD 1609
#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 514.1556 or higher
#error You need version 515.1609 or higher
#endif

#if (DM_VERSION == 514 && DM_BUILD > 1575 && DM_BUILD <= 1577)
#error Your version of BYOND currently has a crashing issue that will prevent you from running Dream Daemon test servers.
#error We require developers to test their content, so an inability to test means we cannot allow the compile.
#error Please consider downgrading to 514.1575 or lower.
#endif

// Keep savefile compatibilty at minimum supported level
#if DM_VERSION >= 515
/savefile/byond_version = MIN_COMPILER_VERSION
#endif

// 515 split call for external libraries into call_ext
#if DM_VERSION < 515
#define LIBCALL call
#else
#define LIBCALL call_ext
#endif

// So we want to have compile time guarantees these methods exist on local type, unfortunately 515 killed the .proc/procname and .verb/verbname syntax so we have to use nameof()
// For the record: GLOBAL_VERB_REF would be useless as verbs can't be global.

#if DM_VERSION < 515

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (.proc/##X)
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
#define VERB_REF(X) (.verb/##X)

/// Call by name proc reference, checks if the proc exists on either the given type or as a global proc
#define TYPE_PROC_REF(TYPE, X) (##TYPE.proc/##X)
/// Call by name verb reference, checks if the verb exists on either the given type or as a global verb
#define TYPE_VERB_REF(TYPE, X) (##TYPE.verb/##X)

/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#else

/// Call by name proc references, checks if the proc exists on either this type or as a global proc.
#define PROC_REF(X) (nameof(.proc/##X))
/// Call by name verb references, checks if the verb exists on either this type or as a global verb.
Expand All @@ -60,4 +29,11 @@
/// Call by name proc reference, checks if the proc is an existing global proc
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif
/// fcopy will crash on 515 linux if given a non-existant file, instead of returning 0 like on 514 linux or 515 windows
/// var case matches documentation for fcopy.
/world/proc/__fcopy(Src, Dst)
if (istext(Src) && !fexists(Src))
return 0
return fcopy(Src, Dst)

#define fcopy(Src, Dst) world.__fcopy(Src, Dst)
Loading

0 comments on commit b0ef3cf

Please sign in to comment.