Skip to content

Commit

Permalink
Merge branch 'Huz2e:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruh-24 authored Feb 27, 2025
2 parents 5ddfd6f + 5ff5802 commit c7aeaae
Show file tree
Hide file tree
Showing 846 changed files with 41,858 additions and 31,207 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
GPLv3.txt
LICENSE
README.md
TGS3.json
.github
.gitignore
.gitattributes
Expand Down
4 changes: 4 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
0f435d5dff0a7957e8cba60a41a7fc10439064c3
# Remove one errant disposals pipe
cc78227c693a3246e8d4d2930ee97242f6546246
# Reorganized the sound folder
58501dce77aba5811fa92a6d7de7d0cc0a1e56ac
# Compress all sounds using optivorbis
436ba869ebcd0b60b63973fb7562f447ee655205
2 changes: 1 addition & 1 deletion .github/actions/restore_or_install_byond/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This is a reusable workflow to restore BYOND from a cache, or to install it otherwise.
# This action attempts to restore BYOND from a cache, or to install it otherwise.
name: Restore or Install BYOND
description: Attempts to restore a specified BYOND version from cache; if it can't, it installs it.

Expand Down
26 changes: 26 additions & 0 deletions .github/actions/setup_node/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# This action is a wrapper around `actions/setup-node`, to use the version specified in
# `dependencies.sh`.
name: Setup Node
description: Install Node using the version specified in `dependencies.sh`; additionally, restores the Yarn cache if one exists

inputs:
restore-yarn-cache:
description: 'If `true`, restores the Yarn cache alongside installing node.'
required: false
type: boolean
default: false

runs:
using: composite
steps:
- name: Configure Node version
shell: bash
run: |
source dependencies.sh
echo "NODE_VERSION_REQUIRED=$NODE_VERSION_LTS" >> $GITHUB_ENV
- name: Install Node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION_REQUIRED }}
cache: ${{ fromJSON(inputs.restore-yarn-cache) && 'yarn' || '' }}
cache-dependency-path: ${{ fromJSON(inputs.restore-yarn-cache) && 'tgui/yarn.lock' || '' }}
11 changes: 8 additions & 3 deletions .github/guides/STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,18 @@ You can avoid hacky code by using object-oriented methodologies, such as overrid

### Develop Secure Code

* Player input must always be escaped safely, we recommend you use stripped_input in all cases where you would use input. Essentially, just always treat input from players as inherently malicious and design with that use case in mind
* Player input must always be escaped safely, we recommend you use stripped_input in all cases where you would use input. Essentially, just always treat input from players as inherently malicious and design with that use case in mind.
* This extends to much further than just numbers or strings. You should always sanity check that an input is valid, especially when it comes to datums or references!
* Input stalling is a very common exploit / bug that involves opening an input window when in a valid state, and triggering the input after exiting the valid state. These can be very serious, and allow players to teleport across the map or remove someone's brain at any given moment. If you check the player must be in a specific context before an input, you should generally check that they are still in the context AFTER the input resolves.
* For example, if you have an item which can be used (in hand) by a player to make it explode, but you want them to confirm (via prompt) that they want it to explode, you should check that the item is still in the player's hands after confirming. Otherwise, they could drop it and explode it at any moment they want.
* Another less common exploit involves allowing a player to open multiple of an input at once. This may allow the player to stack effects, such as triggering 10 explosions when only 1 should be allowed. While a lot of code is generally built in a way making this infeasible (usually due to runtime errors), it is noteworthy regardless.
* You should also consider if it would make sense to apply a timeout to your input, to prevent players from opening it and keeping it on their screen until convenient.

* Calls to the database must be escaped properly - use sanitizeSQL to escape text based database entries from players or admins, and isnum() for number based database entries from players or admins.

* All calls to topics must be checked for correctness. Topic href calls can be easily faked by clients, so you should ensure that the call is valid for the state the item is in. Do not rely on the UI code to provide only valid topic calls, because it won't.
* Don't expose a topic call to more than what you need it to. If you are only looking for an item inside an atom, don't look for every item in the world - just look in the atom's contents.
* You rarely should call `locate(ref)` without specifying a list! This is a serious exploit vector which can be used to spawn Nar'sie or delete players across the map. Try narrowing it down via a list - such as `locate(ref) in contents`, to find an item in an atom's contents.

* Information that players could use to metagame (that is, to identify round information and/or antagonist type via information that would not be available to them in character) should be kept as administrator only.

Expand Down Expand Up @@ -74,8 +81,6 @@ var/path_type = "/obj/item/baseball_bat"

* Changes to the `/config` tree must be made in a way that allows for updating server deployments while preserving previous behaviour. This is due to the fact that the config tree is to be considered owned by the user and not necessarily updated alongside the remainder of the code. The code to preserve previous behaviour may be removed at some point in the future given the OK by maintainers.

* The dlls section of tgs3.json is not designed for dlls that are purely `call()()`ed since those handles are closed between world reboots. Only put in dlls that may have to exist between world reboots.

## Structural
### No duplicated code (Don't repeat yourself)
Copying code from one place to another may be suitable for small, short-time projects, but /tg/station is a long-term project and highly discourages this.
Expand Down
28 changes: 8 additions & 20 deletions .github/workflows/ci_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,10 @@ jobs:
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }}
restore-keys: |
${{ runner.os }}-spacemandmm-
- name: Restore Yarn cache
uses: actions/cache@v4
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Restore Node cache
uses: actions/cache@v4
- name: Setup Node
uses: ./.github/actions/setup_node
with:
path: ~/.nvm
key: ${{ runner.os }}-node-${{ hashFiles('dependencies.sh') }}
restore-keys: |
${{ runner.os }}-node-
restore-yarn-cache: true
- name: Restore Bootstrap cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -89,7 +79,6 @@ jobs:
- name: Install Tools
run: |
pip3 install setuptools
bash tools/ci/install_node.sh
bash tools/ci/install_spaceman_dmm.sh dreamchecker
bash tools/ci/install_ripgrep.sh
tools/bootstrap/python -c ''
Expand Down Expand Up @@ -154,6 +143,8 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup_node
- name: Restore BYOND from Cache
uses: ./.github/actions/restore_or_install_byond
- name: Compile All Maps
Expand Down Expand Up @@ -263,13 +254,10 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Restore Yarn cache
uses: actions/cache@v4
- name: Setup Node
uses: ./.github/actions/setup_node
with:
path: tgui/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
restore-yarn-cache: true
- name: Compile
run: pwsh tools/ci/build.ps1
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker_publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
publish:
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4

Expand Down
26 changes: 26 additions & 0 deletions .github/workflows/run_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ jobs:
mysql -u root -proot tg_ci < SQL/tgstation_schema.sql
mysql -u root -proot -e 'CREATE DATABASE tg_ci_prefixed;'
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
- name: Setup Node
uses: ./.github/actions/setup_node
- name: Install rust-g
run: |
bash tools/ci/install_rust_g.sh
Expand All @@ -61,6 +63,7 @@ jobs:
source $HOME/BYOND/byond/bin/byondsetup
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS -Werror -ITG0001 -I"loop_checks"
- name: Run Tests
id: run_tests
run: |
source $HOME/BYOND/byond/bin/byondsetup
bash tools/ci/run_server.sh ${{ inputs.map }}
Expand All @@ -71,6 +74,29 @@ jobs:
name: test_artifacts_${{ inputs.map }}_${{ inputs.major }}_${{ inputs.minor }}
path: data/screenshots_new/
retention-days: 1
- name: On test fail, write a step summary
if: always() && steps.run_tests.outcome == 'failure'
run: |
# Get a JSON array of failed unit tests
FAILED_UNIT_TESTS=$(jq 'to_entries | map(.value | select(.status == 1))' data/unit_tests.json)
FAIL_COUNT=$(echo $FAILED_UNIT_TESTS | jq 'length')
echo "# Test failures" >> $GITHUB_STEP_SUMMARY
echo "$FAIL_COUNT tests failed." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
for i in $( seq $FAIL_COUNT ); do
CURRENT_FAIL=$(echo $FAILED_UNIT_TESTS | jq --arg i $i '.[($i | tonumber) - 1]')
TEST=$(echo $CURRENT_FAIL | jq --raw-output '.name')
echo "### $TEST" >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo $CURRENT_FAIL | jq --raw-output '.message' >> $GITHUB_STEP_SUMMARY
echo '```' >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
done
- name: Check client Compatibility
if: always() && steps.compile_tests.outcome == 'success'
uses: tgstation/byond-client-compatibility-check@v3
Expand Down
14 changes: 12 additions & 2 deletions SQL/database_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,25 @@ Make sure to also update `DB_MAJOR_VERSION` and `DB_MINOR_VERSION`, which can be
The latest database version is 5.28; The query to update the schema revision table is:

```sql
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 28);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 29);
```
or

```sql
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 28);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 29);
```
In any query remember to add a prefix to the table names if you use one.
-----------------------------------------------------
Version 5.29, 4 February 2024, by Tiviplus
Fixed admin rank table flags being capped at 16 in the DB instead of 24 (byond max)

```sql
ALTER TABLE `admin_ranks`
MODIFY COLUMN `flags` mediumint(5) unsigned NOT NULL,
MODIFY COLUMN `exclude_flags` mediumint(5) unsigned NOT NULL,
MODIFY COLUMN `can_edit_flags` mediumint(5) unsigned NOT NULL;
```
-----------------------------------------------------
Version 5.28, 1 November 2024, by Ghommie
Added `fish_progress` as the first 'progress' subtype of 'datum/award/scores'

Expand Down
6 changes: 3 additions & 3 deletions SQL/tgstation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ DROP TABLE IF EXISTS `admin_ranks`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_ranks` (
`rank` varchar(32) NOT NULL,
`flags` smallint(5) unsigned NOT NULL,
`exclude_flags` smallint(5) unsigned NOT NULL,
`can_edit_flags` smallint(5) unsigned NOT NULL,
`flags` mediumint(5) unsigned NOT NULL,
`exclude_flags` mediumint(5) unsigned NOT NULL,
`can_edit_flags` mediumint(5) unsigned NOT NULL,
PRIMARY KEY (`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
Expand Down
6 changes: 3 additions & 3 deletions SQL/tgstation_schema_prefixed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ DROP TABLE IF EXISTS `SS13_admin_ranks`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `SS13_admin_ranks` (
`rank` varchar(32) NOT NULL,
`flags` smallint(5) unsigned NOT NULL,
`exclude_flags` smallint(5) unsigned NOT NULL,
`can_edit_flags` smallint(5) unsigned NOT NULL,
`flags` mediumint(5) unsigned NOT NULL,
`exclude_flags` mediumint(5) unsigned NOT NULL,
`can_edit_flags` mediumint(5) unsigned NOT NULL,
PRIMARY KEY (`rank`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
Expand Down
9 changes: 0 additions & 9 deletions TGS3.json

This file was deleted.

5 changes: 0 additions & 5 deletions _maps/RandomRuins/IceRuins/icemoon_underground_syndielab.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@
/turf/open/floor/mineral/plastitanium/red,
/area/ruin/syndielab)
"oA" = (
/obj/structure/syndicate_uplink_beacon,
/turf/open/floor/iron/dark/textured,
/area/ruin/syndielab)
"oY" = (
Expand All @@ -267,10 +266,6 @@
pixel_x = -5;
pixel_y = 8
},
/obj/item/traitor_bug{
pixel_y = 6;
pixel_x = 6
},
/turf/open/floor/mineral/plastitanium/red,
/area/ruin/syndielab)
"qy" = (
Expand Down
22 changes: 17 additions & 5 deletions _maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,9 @@
/area/ruin/syndicate_lava_base/chemistry)
"fx" = (
/obj/structure/sign/warning/secure_area,
/obj/machinery/porta_turret/syndicate{
dir = 9
},
/turf/closed/wall/mineral/plastitanium/nodiagonal,
/area/ruin/syndicate_lava_base/cargo)
"fA" = (
Expand Down Expand Up @@ -1593,6 +1596,7 @@
/obj/effect/decal/cleanable/dirt,
/obj/machinery/airalarm/directional/east,
/obj/effect/mapping_helpers/airalarm/syndicate_access,
/obj/item/defibrillator/loaded,
/turf/open/floor/iron/white/side{
dir = 4
},
Expand Down Expand Up @@ -1866,6 +1870,9 @@
/area/ruin/syndicate_lava_base/arrivals)
"oF" = (
/obj/structure/sign/warning/secure_area,
/obj/machinery/porta_turret/syndicate{
dir = 9
},
/turf/closed/wall/mineral/plastitanium/nodiagonal,
/area/ruin/syndicate_lava_base/arrivals)
"oH" = (
Expand Down Expand Up @@ -2163,6 +2170,10 @@
/obj/machinery/light/small/directional/east,
/turf/open/floor/iron/dark,
/area/ruin/syndicate_lava_base/cargo)
"sB" = (
/obj/structure/sign/warning/secure_area,
/turf/closed/wall/mineral/plastitanium/nodiagonal,
/area/ruin/syndicate_lava_base/cargo)
"sH" = (
/obj/machinery/door/airlock/virology/glass{
name = "Monkey Pen"
Expand Down Expand Up @@ -3316,7 +3327,6 @@
/obj/structure/table/wood,
/obj/item/ammo_box/magazine/m9mm,
/obj/machinery/airalarm/directional/north,
/obj/item/crowbar/red,
/obj/effect/mapping_helpers/airalarm/syndicate_access,
/turf/open/floor/carpet/red,
/area/ruin/syndicate_lava_base/dormitories)
Expand Down Expand Up @@ -3648,6 +3658,10 @@
},
/turf/open/floor/iron,
/area/ruin/syndicate_lava_base/engineering)
"Oj" = (
/obj/structure/sign/warning/secure_area,
/turf/closed/wall/mineral/plastitanium/nodiagonal,
/area/ruin/syndicate_lava_base/arrivals)
"Oq" = (
/obj/effect/spawner/random/vending/colavend{
hacked = 1
Expand Down Expand Up @@ -4127,7 +4141,6 @@
/obj/item/ammo_box/magazine/m9mm,
/obj/item/ammo_box/magazine/sniper_rounds,
/obj/machinery/airalarm/directional/north,
/obj/item/crowbar/red,
/obj/effect/mapping_helpers/airalarm/syndicate_access,
/turf/open/floor/carpet/red,
/area/ruin/syndicate_lava_base/dormitories)
Expand Down Expand Up @@ -4506,7 +4519,6 @@
/obj/structure/table/wood,
/obj/item/ammo_box/magazine/m9mm,
/obj/item/ammo_box/magazine/sniper_rounds,
/obj/item/crowbar/red,
/turf/open/floor/carpet/red,
/area/ruin/syndicate_lava_base/dormitories)
"Zw" = (
Expand Down Expand Up @@ -5325,7 +5337,7 @@ Vb
mT
mT
mT
oF
Oj
ab
ab
ab
Expand Down Expand Up @@ -6648,7 +6660,7 @@ ab
ab
ab
ab
fx
sB
gh
fx
si
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@
/obj/effect/turf_decal/tile/neutral/fourcorners,
/turf/open/floor/iron/dark,
/area/ruin/syndicate_lava_base/telecomms)
"R" = (
/obj/structure/filingcabinet/medical,
/turf/open/floor/iron/dark,
/area/ruin/syndicate_lava_base/telecomms)
"U" = (
/obj/machinery/light/small/directional/east,
/obj/machinery/atmospherics/components/unary/vent_pump/on/layer4,
Expand Down Expand Up @@ -216,7 +220,7 @@ f
(6,1,1) = {"
a
e
c
R
Z
m
C
Expand Down
Loading

0 comments on commit c7aeaae

Please sign in to comment.