Skip to content

Commit

Permalink
Major codebase improvements + widescreen (Foundation-19#1745)
Browse files Browse the repository at this point in the history
* debug improvements

* this should not be in git

* Superduper theduper ever ever

* disaster

* We are gaming

* This CI sucks!

* current changes

* current changes

* fix

* fixes

* fixes again

* fix?

* update these

* try this one again

* fixes

* ?

* that would be why

* the fix of all time

* einstein

* fixes and optimizations

* fix this straight up bad code

* wtf

* sure

* lgtm

* changes

* dmapi update

* it works

* ?

* get this garbage test out of here

* port to new tg dmi test, rip out custom items from the game

* fix this test

* fix

* rip out overlay caching - obama edition

* fixes

* HREF exploit fixes

* fix lighting, scps

* current changes

* fixes runtimes

* fix

* fix even more issues

* fix turret controls

* numerous fixes to skyboxes and view

* this is genuinely dumb

* browser fixes, fix scp min players

* fix disconnected wire

* tune negative light station trait, celldoorening

* spacing

* spacing v2

* fix turret interact for admins, fix paper ui

* fix 2427 and 912

* fix robot icons

* fix megaphone, fax access, stuttering

* the worst shit ever imagined all time

* the worst part 2

* fix
  • Loading branch information
checkraisefold authored and MysticalFaceLesS committed Nov 9, 2024
1 parent ed9954c commit 054d1ec
Show file tree
Hide file tree
Showing 3,790 changed files with 2,470 additions and 4,577 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
62 changes: 21 additions & 41 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,22 @@ on:
- dev
env:
BYOND_MAJOR: "515"
BYOND_MINOR: "1623"
BYOND_MINOR: "1641"
SPACEMAN_DMM_VERSION: suite-1.9

jobs:
DreamChecker:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: $HOME/spaceman_dmm/$SPACEMAN_DMM_VERSION
key: ${{ runner.os }}-spacemandmm-${{ env.SPACEMAN_DMM_VERSION }}
- name: Install Dreamchecker
run: scripts/install-spaceman-dmm.sh dreamchecker
- name: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install_node.sh
bash tools/ci/install_spaceman_dmm.sh dreamchecker
tools/bootstrap/python -c ''
- name: Run Dreamchecker
run: ~/dreamchecker > ${GITHUB_WORKSPACE}/output-annotations.txt 2>&1
- name: Annotate Lints
uses: yogstation13/DreamAnnotate@8ef04ef7fbb4ac63ee2daca222af91599e0af5e1
if: always()
with:
outputFile: output-annotations.txt
run: ~/dreamchecker 2>&1 | bash tools/ci/annotate_dm.sh
- name: Run Failure Webhook
env:
JOB_STATUS: ${{ job.status }}
Expand All @@ -43,26 +37,19 @@ jobs:
chmod +x send.sh
./send.sh failure $WEBHOOK_URL
Code:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}
- name: Install Dependencies
run: sudo apt-get install -y uchardet
- name: Install RUST_G Deps
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install libssl1.1:i386
ldd librust_g.so
- name: Run Tests
env:
TEST: CODE
run: test/run-test.sh
run: |
bash tools/ci/install_byond.sh
bash tools/ci/install_rust_g.sh
source $HOME/BYOND/byond/bin/byondsetup
bash test/run-test.sh
- name: Run Failure Webhook
env:
JOB_STATUS: ${{ job.status }}
Expand All @@ -75,28 +62,21 @@ jobs:
chmod +x send.sh
./send.sh failure $WEBHOOK_URL
Maps:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
map_path: [site53]
steps:
- uses: actions/checkout@v4
- name: Setup Cache
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9
with:
path: $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}
key: ${{ runner.os }}-byond-${{ env.BYOND_MAJOR }}-${{ env.BYOND_MINOR }}
- name: Install RUST_G Deps
run: |
sudo dpkg --add-architecture i386
sudo apt update || true
sudo apt install libssl1.1:i386
ldd librust_g.so
- name: Run Tests
env:
TEST: MAP
MAP_PATH: ${{ matrix.map_path }}
run: test/run-test.sh
run: |
bash tools/ci/install_byond.sh
bash tools/ci/install_rust_g.sh
source $HOME/BYOND/byond/bin/byondsetup
bash test/run-test.sh
- name: Run Failure Webhook
env:
JOB_STATUS: ${{ job.status }}
Expand Down
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,20 @@ atupdate
config/*
sql/test_db

# byond-tracy, we intentionally do not ship this and do not want to maintain it
# https://github.com/mafemergency/byond-tracy/
prof.dll
libprof.so

# Tracy can read source files when it is in the root folder, even without absolute paths.
# If you're interested, run this hack:
# https://gist.github.com/Mothblocks/db5462aa84d7d6b1d1b1276b820f62da
Tracy.exe


# Ignore compiled linux libs in the root folder, e.g. librust_g.so
/*.so

# VisualStudioCode
*.code-workspace

Expand Down
27 changes: 27 additions & 0 deletions .tgs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is used by TGS (https://github.com/tgstation/tgstation-server) clients to quickly initialize a server instance for the codebase
# The format isn't documented anywhere but hopefully we never have to change it. If there are questions, contact the TGS maintainer Cyberboss/@Dominion#0444
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: "515.1637"
# Folders to create in "<instance_path>/Configuration/GameStaticFiles/"
static_files:
# Config directory should be static
- name: config
# This implies the folder should be pre-populated with contents from the repo
populate: true
# Populate the folder with the config example_files from the repo
sources: ["config/example"]
# Data directory must be static
- name: data
# String dictionary. The value is the location of the file in the repo to upload to TGS. The key is the name of the file to upload to "<instance_path>/Configuration/EventScripts/"
# This one is for Linux hosted servers
linux_scripts:
PreCompile.sh: tools/tgs_scripts/PreCompile.sh
WatchdogLaunch.sh: tools/tgs_scripts/WatchdogLaunch.sh
InstallDeps.sh: tools/tgs_scripts/InstallDeps.sh
# Same as above for Windows hosted servers
windows_scripts:
PreCompile.bat: tools/tgs_scripts/PreCompile.bat
# The security level the game should be run at
security: Trusted
11 changes: 5 additions & 6 deletions baystation12.dme
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
#define DEBUG
// END_PREFERENCES
// BEGIN_INCLUDE
#include "code\_byond_version_compat.dm"
#include "code\__byond_version_compat.dm"
#include "code\_compile_options.dm"
#include "code\_debugger.dm"
#include "code\_macros.dm"
#include "code\_spaceman_dmm.dm"
Expand All @@ -22,7 +23,6 @@
#include "code\__datastructures\globals.dm"
#include "code\__datastructures\priority_queue.dm"
#include "code\__datastructures\stack.dm"
#include "code\__defines\__compile_options.dm"
#include "code\__defines\_click.dm"
#include "code\__defines\_helpers.dm"
#include "code\__defines\_lists.dm"
Expand Down Expand Up @@ -94,6 +94,7 @@
#include "code\__defines\research.dm"
#include "code\__defines\ruin_tags.dm"
#include "code\__defines\rust_g.dm"
#include "code\__defines\rust_g_overrides.dm"
#include "code\__defines\SCP.dm"
#include "code\__defines\shields.dm"
#include "code\__defines\shuttle.dm"
Expand Down Expand Up @@ -185,6 +186,7 @@
#include "code\_helpers\unsorted.dm"
#include "code\_helpers\vector.dm"
#include "code\_helpers\verbs.dm"
#include "code\_helpers\view.dm"
#include "code\_helpers\washing.dm"
#include "code\_helpers\sorts\__main.dm"
#include "code\_helpers\sorts\TimSort.dm"
Expand Down Expand Up @@ -300,7 +302,6 @@
#include "code\controllers\subsystems\initialization\codex.dm"
#include "code\controllers\subsystems\initialization\cuisine.dm"
#include "code\controllers\subsystems\initialization\culture.dm"
#include "code\controllers\subsystems\initialization\customitems.dm"
#include "code\controllers\subsystems\initialization\fabrication.dm"
#include "code\controllers\subsystems\initialization\materials.dm"
#include "code\controllers\subsystems\initialization\misc.dm"
Expand Down Expand Up @@ -2375,7 +2376,6 @@
#include "code\modules\mob\living\silicon\pai\software_modules.dm"
#include "code\modules\mob\living\silicon\robot\analyzer.dm"
#include "code\modules\mob\living\silicon\robot\component.dm"
#include "code\modules\mob\living\silicon\robot\custom_sprites.dm"
#include "code\modules\mob\living\silicon\robot\death.dm"
#include "code\modules\mob\living\silicon\robot\examine.dm"
#include "code\modules\mob\living\silicon\robot\inventory.dm"
Expand Down Expand Up @@ -3493,7 +3493,6 @@
#include "code\modules\ZAS\Variable Settings.dm"
#include "code\modules\ZAS\Zone.dm"
#include "code\procs\announce.dm"
#include "code\procs\dbcore.dm"
#include "code\procs\hud.dm"
#include "code\procs\radio.dm"
#include "code\unit_tests\_defines.dm"
Expand Down Expand Up @@ -3553,8 +3552,8 @@
#include "maps\site53\items\bullets.dm"
#include "maps\site53\items\clothes.dm"
#include "maps\site53\items\guns.dm"
#include "maps\site53\items\sciprc_server.dm"
#include "maps\site53\items\paperwork_dataserver.dm"
#include "maps\site53\items\sciprc_server.dm"
#include "maps\site53\items\SCP_dataserver.dm"
#include "maps\site53\items\storage.dm"
#include "maps\site53\items\toys.dm"
Expand Down
28 changes: 3 additions & 25 deletions code/_byond_version_compat.dm → code/__byond_version_compat.dm
Original file line number Diff line number Diff line change
@@ -1,29 +1,19 @@
// 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 1584
#define MIN_COMPILER_VERSION 515
#define MIN_COMPILER_BUILD 1609
#if (DM_VERSION < MIN_COMPILER_VERSION || DM_BUILD < MIN_COMPILER_BUILD) && !defined(SPACEMAN_DMM) && !defined(OPENDREAM)
//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/build/514 and update.
#error You need version 514.1584 or higher
#error You need version 515.1609 or higher
#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.
Expand Down Expand Up @@ -59,15 +49,3 @@
#define GLOBAL_PROC_REF(X) (/proc/##X)

#endif

#if (DM_VERSION == 515)
/// 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)

#endif
38 changes: 37 additions & 1 deletion code/__defines/_click.dm
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
//Mouse buttons pressed/held/released
//Defines file for byond click related parameters
//this is mostly for ease of use and for finding all the things that use say RIGHT_CLICK rather then just searching "right"

//Mouse buttons held
#define RIGHT_CLICK "right"
#define MIDDLE_CLICK "middle"
#define LEFT_CLICK "left"

///Mouse button that was just clicked/released
///if(modifiers[BUTTON] == LEFT_CLICK)
#define BUTTON "button"

//Keys held down during the mouse action
#define CTRL_CLICK "ctrl"
#define ALT_CLICK "alt"
#define SHIFT_CLICK "shift"

//Cells involved if using a Grid control
#define DRAG_CELL "drag-cell"
#define DROP_CELL "drop-cell"

//The button used for dragging (only sent for unrelated mouse up/down messages during a drag)
#define DRAG "drag"

//If the mouse is over a link in maptext, or this event is related to clicking such a link
#define LINK "link"

//Pixel coordinates relative to the icon's position on screen
#define VIS_X "vis-x"
#define VIS_Y "vis-y"

//Pixel coordinates within the icon, in the icon's coordinate space
#define ICON_X "icon-x"
#define ICON_Y "icon-y"

//Pixel coordinates in screen_loc format ("[tile_x]:[pixel_x],[tile_y]:[pixel_y]")
#define SCREEN_LOC "screen-loc"

//https://secure.byond.com/docs/ref/info.html#/atom/var/mouse_opacity
/// Objects will ignore being clicked on regardless of their transparency (used in parallax, lighting effects, holograms, lasers, etc.)
#define MOUSE_OPACITY_TRANSPARENT 0
/// Objects will be clicked on if it is the topmost object and the pixel isn't transparent at the position of the mouse (default behavior for 99.99% of game objects)
#define MOUSE_OPACITY_ICON 1
/// Objects will be always be clicked on regardless of pixel transparency or other objects at that location (used in space vines, megafauna, storage containers)
#define MOUSE_OPACITY_OPAQUE 2
2 changes: 1 addition & 1 deletion code/__defines/_planes+layers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ What is the naming convention for planes or layers?

/atom/movable/screen/plane_master
appearance_flags = PLANE_MASTER
screen_loc = "CENTER,CENTER"
screen_loc = "CENTER"
globalscreen = 1

/atom/movable/screen/plane_master/ghost_master
Expand Down
2 changes: 1 addition & 1 deletion code/__defines/client.dm
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define CLIENT_MIN_FPS 0
#define CLIENT_MAX_FPS 1000
#define CLIENT_MAX_FPS 360
5 changes: 5 additions & 0 deletions code/__defines/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@

/// Called on `/mob/living/say` (/mob/living, message, /datum/language)
#define COMSIG_LIVING_TREAT_MESSAGE "living_treat_message"
#define SPEECH_ARG_MESSAGE 1
#define SPEECH_ARG_LANGUAGE 2
#define SPEECH_ARG_VERB 3
#define SPEECH_ARG_ALT_NAME 4
#define SPEECH_ARG_WHISPERING 5

/// Called on `/obj/item/proc/dropped` (/mob, /obj)
#define COMSIG_MOB_DROPPED_ITEM "mob_dropped_item"
Expand Down
23 changes: 0 additions & 23 deletions code/__defines/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@
#define SEE_INVISIBLE_MINIMUM 5
#define INVISIBILITY_MAXIMUM 100

//https://secure.byond.com/docs/ref/info.html#/atom/var/mouse_opacity
#define MOUSE_OPACITY_TRANSPARENT 0
#define MOUSE_OPACITY_ICON 1
#define MOUSE_OPACITY_OPAQUE 2

// Some arbitrary defines to be used by self-pruning global lists. (see master_controller)
#define PROCESS_KILL 26 // Used to trigger removal from a processing list.

Expand Down Expand Up @@ -102,24 +97,6 @@
//Ruin map template flags
#define TEMPLATE_FLAG_RUIN_STARTS_DISALLOWED 32 // Ruin is not available during spawning unless another ruin permits it.

// Convoluted setup so defines can be supplied by Bay12 main server compile script.
// Should still work fine for people jamming the icons into their repo.
#ifndef CUSTOM_ITEM_CONFIG
#define CUSTOM_ITEM_CONFIG "config/custom_items/"
#endif
#ifndef CUSTOM_ITEM_SYNTH_CONFIG
#define CUSTOM_ITEM_SYNTH_CONFIG "config/custom_sprites.txt"
#endif
#ifndef CUSTOM_ITEM_OBJ
#define CUSTOM_ITEM_OBJ 'icons/obj/custom_items_obj.dmi'
#endif
#ifndef CUSTOM_ITEM_MOB
#define CUSTOM_ITEM_MOB 'icons/mob/custom_items_mob.dmi'
#endif
#ifndef CUSTOM_ITEM_SYNTH
#define CUSTOM_ITEM_SYNTH 'icons/mob/custom_synthetic.dmi'
#endif

#define WALL_CAN_OPEN 1
#define WALL_OPENING 2

Expand Down
Loading

0 comments on commit 054d1ec

Please sign in to comment.