Skip to content

Commit c7aeaae

Browse files
authored
Merge branch 'Huz2e:master' into master
2 parents 5ddfd6f + 5ff5802 commit c7aeaae

File tree

846 files changed

+41858
-31207
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

846 files changed

+41858
-31207
lines changed

.dockerignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
GPLv3.txt
44
LICENSE
55
README.md
6-
TGS3.json
76
.github
87
.gitignore
98
.gitattributes

.git-blame-ignore-revs

+4
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@
1616
0f435d5dff0a7957e8cba60a41a7fc10439064c3
1717
# Remove one errant disposals pipe
1818
cc78227c693a3246e8d4d2930ee97242f6546246
19+
# Reorganized the sound folder
20+
58501dce77aba5811fa92a6d7de7d0cc0a1e56ac
21+
# Compress all sounds using optivorbis
22+
436ba869ebcd0b60b63973fb7562f447ee655205

.github/actions/restore_or_install_byond/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# This is a reusable workflow to restore BYOND from a cache, or to install it otherwise.
1+
# This action attempts to restore BYOND from a cache, or to install it otherwise.
22
name: Restore or Install BYOND
33
description: Attempts to restore a specified BYOND version from cache; if it can't, it installs it.
44

.github/actions/setup_node/action.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# This action is a wrapper around `actions/setup-node`, to use the version specified in
2+
# `dependencies.sh`.
3+
name: Setup Node
4+
description: Install Node using the version specified in `dependencies.sh`; additionally, restores the Yarn cache if one exists
5+
6+
inputs:
7+
restore-yarn-cache:
8+
description: 'If `true`, restores the Yarn cache alongside installing node.'
9+
required: false
10+
type: boolean
11+
default: false
12+
13+
runs:
14+
using: composite
15+
steps:
16+
- name: Configure Node version
17+
shell: bash
18+
run: |
19+
source dependencies.sh
20+
echo "NODE_VERSION_REQUIRED=$NODE_VERSION_LTS" >> $GITHUB_ENV
21+
- name: Install Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: ${{ env.NODE_VERSION_REQUIRED }}
25+
cache: ${{ fromJSON(inputs.restore-yarn-cache) && 'yarn' || '' }}
26+
cache-dependency-path: ${{ fromJSON(inputs.restore-yarn-cache) && 'tgui/yarn.lock' || '' }}

.github/guides/STANDARDS.md

+8-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,18 @@ You can avoid hacky code by using object-oriented methodologies, such as overrid
2323

2424
### Develop Secure Code
2525

26-
* 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
26+
* 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.
27+
* 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!
28+
* 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.
29+
* 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.
30+
* 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.
31+
* 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.
2732

2833
* 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.
2934

3035
* 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.
36+
* 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.
37+
* 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.
3138

3239
* 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.
3340

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

7582
* 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.
7683

77-
* 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.
78-
7984
## Structural
8085
### No duplicated code (Don't repeat yourself)
8186
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.

.github/workflows/ci_suite.yml

+8-20
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,10 @@ jobs:
4242
key: ${{ runner.os }}-spacemandmm-${{ hashFiles('dependencies.sh') }}
4343
restore-keys: |
4444
${{ runner.os }}-spacemandmm-
45-
- name: Restore Yarn cache
46-
uses: actions/cache@v4
47-
with:
48-
path: tgui/.yarn/cache
49-
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
50-
restore-keys: |
51-
${{ runner.os }}-yarn-
52-
- name: Restore Node cache
53-
uses: actions/cache@v4
45+
- name: Setup Node
46+
uses: ./.github/actions/setup_node
5447
with:
55-
path: ~/.nvm
56-
key: ${{ runner.os }}-node-${{ hashFiles('dependencies.sh') }}
57-
restore-keys: |
58-
${{ runner.os }}-node-
48+
restore-yarn-cache: true
5949
- name: Restore Bootstrap cache
6050
uses: actions/cache@v4
6151
with:
@@ -89,7 +79,6 @@ jobs:
8979
- name: Install Tools
9080
run: |
9181
pip3 install setuptools
92-
bash tools/ci/install_node.sh
9382
bash tools/ci/install_spaceman_dmm.sh dreamchecker
9483
bash tools/ci/install_ripgrep.sh
9584
tools/bootstrap/python -c ''
@@ -154,6 +143,8 @@ jobs:
154143

155144
steps:
156145
- uses: actions/checkout@v4
146+
- name: Setup Node
147+
uses: ./.github/actions/setup_node
157148
- name: Restore BYOND from Cache
158149
uses: ./.github/actions/restore_or_install_byond
159150
- name: Compile All Maps
@@ -263,13 +254,10 @@ jobs:
263254

264255
steps:
265256
- uses: actions/checkout@v4
266-
- name: Restore Yarn cache
267-
uses: actions/cache@v4
257+
- name: Setup Node
258+
uses: ./.github/actions/setup_node
268259
with:
269-
path: tgui/.yarn/cache
270-
key: ${{ runner.os }}-yarn-${{ hashFiles('tgui/yarn.lock') }}
271-
restore-keys: |
272-
${{ runner.os }}-yarn-
260+
restore-yarn-cache: true
273261
- name: Compile
274262
run: pwsh tools/ci/build.ps1
275263
env:

.github/workflows/docker_publish.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
publish:
88
if: ( !contains(github.event.head_commit.message, '[ci skip]') )
9-
runs-on: ubuntu-20.04
9+
runs-on: ubuntu-24.04
1010
steps:
1111
- uses: actions/checkout@v4
1212

.github/workflows/run_integration_tests.yml

+26
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
mysql -u root -proot tg_ci < SQL/tgstation_schema.sql
4545
mysql -u root -proot -e 'CREATE DATABASE tg_ci_prefixed;'
4646
mysql -u root -proot tg_ci_prefixed < SQL/tgstation_schema_prefixed.sql
47+
- name: Setup Node
48+
uses: ./.github/actions/setup_node
4749
- name: Install rust-g
4850
run: |
4951
bash tools/ci/install_rust_g.sh
@@ -61,6 +63,7 @@ jobs:
6163
source $HOME/BYOND/byond/bin/byondsetup
6264
tools/build/build --ci dm -DCIBUILDING -DANSICOLORS -Werror -ITG0001 -I"loop_checks"
6365
- name: Run Tests
66+
id: run_tests
6467
run: |
6568
source $HOME/BYOND/byond/bin/byondsetup
6669
bash tools/ci/run_server.sh ${{ inputs.map }}
@@ -71,6 +74,29 @@ jobs:
7174
name: test_artifacts_${{ inputs.map }}_${{ inputs.major }}_${{ inputs.minor }}
7275
path: data/screenshots_new/
7376
retention-days: 1
77+
- name: On test fail, write a step summary
78+
if: always() && steps.run_tests.outcome == 'failure'
79+
run: |
80+
# Get a JSON array of failed unit tests
81+
FAILED_UNIT_TESTS=$(jq 'to_entries | map(.value | select(.status == 1))' data/unit_tests.json)
82+
83+
FAIL_COUNT=$(echo $FAILED_UNIT_TESTS | jq 'length')
84+
85+
echo "# Test failures" >> $GITHUB_STEP_SUMMARY
86+
echo "$FAIL_COUNT tests failed." >> $GITHUB_STEP_SUMMARY
87+
echo "" >> $GITHUB_STEP_SUMMARY
88+
89+
for i in $( seq $FAIL_COUNT ); do
90+
CURRENT_FAIL=$(echo $FAILED_UNIT_TESTS | jq --arg i $i '.[($i | tonumber) - 1]')
91+
92+
TEST=$(echo $CURRENT_FAIL | jq --raw-output '.name')
93+
94+
echo "### $TEST" >> $GITHUB_STEP_SUMMARY
95+
echo '```' >> $GITHUB_STEP_SUMMARY
96+
echo $CURRENT_FAIL | jq --raw-output '.message' >> $GITHUB_STEP_SUMMARY
97+
echo '```' >> $GITHUB_STEP_SUMMARY
98+
echo "" >> $GITHUB_STEP_SUMMARY
99+
done
74100
- name: Check client Compatibility
75101
if: always() && steps.compile_tests.outcome == 'success'
76102
uses: tgstation/byond-client-compatibility-check@v3

SQL/database_changelog.md

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,25 @@ Make sure to also update `DB_MAJOR_VERSION` and `DB_MINOR_VERSION`, which can be
55
The latest database version is 5.28; The query to update the schema revision table is:
66

77
```sql
8-
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 28);
8+
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 29);
99
```
1010
or
1111

1212
```sql
13-
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 28);
13+
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 29);
1414
```
1515
In any query remember to add a prefix to the table names if you use one.
1616
-----------------------------------------------------
17+
Version 5.29, 4 February 2024, by Tiviplus
18+
Fixed admin rank table flags being capped at 16 in the DB instead of 24 (byond max)
19+
20+
```sql
21+
ALTER TABLE `admin_ranks`
22+
MODIFY COLUMN `flags` mediumint(5) unsigned NOT NULL,
23+
MODIFY COLUMN `exclude_flags` mediumint(5) unsigned NOT NULL,
24+
MODIFY COLUMN `can_edit_flags` mediumint(5) unsigned NOT NULL;
25+
```
26+
-----------------------------------------------------
1727
Version 5.28, 1 November 2024, by Ghommie
1828
Added `fish_progress` as the first 'progress' subtype of 'datum/award/scores'
1929

SQL/tgstation_schema.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ DROP TABLE IF EXISTS `admin_ranks`;
5353
/*!40101 SET character_set_client = utf8 */;
5454
CREATE TABLE `admin_ranks` (
5555
`rank` varchar(32) NOT NULL,
56-
`flags` smallint(5) unsigned NOT NULL,
57-
`exclude_flags` smallint(5) unsigned NOT NULL,
58-
`can_edit_flags` smallint(5) unsigned NOT NULL,
56+
`flags` mediumint(5) unsigned NOT NULL,
57+
`exclude_flags` mediumint(5) unsigned NOT NULL,
58+
`can_edit_flags` mediumint(5) unsigned NOT NULL,
5959
PRIMARY KEY (`rank`)
6060
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
6161
/*!40101 SET character_set_client = @saved_cs_client */;

SQL/tgstation_schema_prefixed.sql

+3-3
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ DROP TABLE IF EXISTS `SS13_admin_ranks`;
5353
/*!40101 SET character_set_client = utf8 */;
5454
CREATE TABLE `SS13_admin_ranks` (
5555
`rank` varchar(32) NOT NULL,
56-
`flags` smallint(5) unsigned NOT NULL,
57-
`exclude_flags` smallint(5) unsigned NOT NULL,
58-
`can_edit_flags` smallint(5) unsigned NOT NULL,
56+
`flags` mediumint(5) unsigned NOT NULL,
57+
`exclude_flags` mediumint(5) unsigned NOT NULL,
58+
`can_edit_flags` mediumint(5) unsigned NOT NULL,
5959
PRIMARY KEY (`rank`)
6060
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
6161
/*!40101 SET character_set_client = @saved_cs_client */;

TGS3.json

-9
This file was deleted.

_maps/RandomRuins/IceRuins/icemoon_underground_syndielab.dmm

-5
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,6 @@
246246
/turf/open/floor/mineral/plastitanium/red,
247247
/area/ruin/syndielab)
248248
"oA" = (
249-
/obj/structure/syndicate_uplink_beacon,
250249
/turf/open/floor/iron/dark/textured,
251250
/area/ruin/syndielab)
252251
"oY" = (
@@ -267,10 +266,6 @@
267266
pixel_x = -5;
268267
pixel_y = 8
269268
},
270-
/obj/item/traitor_bug{
271-
pixel_y = 6;
272-
pixel_x = 6
273-
},
274269
/turf/open/floor/mineral/plastitanium/red,
275270
/area/ruin/syndielab)
276271
"qy" = (

_maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1.dmm

+17-5
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,9 @@
667667
/area/ruin/syndicate_lava_base/chemistry)
668668
"fx" = (
669669
/obj/structure/sign/warning/secure_area,
670+
/obj/machinery/porta_turret/syndicate{
671+
dir = 9
672+
},
670673
/turf/closed/wall/mineral/plastitanium/nodiagonal,
671674
/area/ruin/syndicate_lava_base/cargo)
672675
"fA" = (
@@ -1593,6 +1596,7 @@
15931596
/obj/effect/decal/cleanable/dirt,
15941597
/obj/machinery/airalarm/directional/east,
15951598
/obj/effect/mapping_helpers/airalarm/syndicate_access,
1599+
/obj/item/defibrillator/loaded,
15961600
/turf/open/floor/iron/white/side{
15971601
dir = 4
15981602
},
@@ -1866,6 +1870,9 @@
18661870
/area/ruin/syndicate_lava_base/arrivals)
18671871
"oF" = (
18681872
/obj/structure/sign/warning/secure_area,
1873+
/obj/machinery/porta_turret/syndicate{
1874+
dir = 9
1875+
},
18691876
/turf/closed/wall/mineral/plastitanium/nodiagonal,
18701877
/area/ruin/syndicate_lava_base/arrivals)
18711878
"oH" = (
@@ -2163,6 +2170,10 @@
21632170
/obj/machinery/light/small/directional/east,
21642171
/turf/open/floor/iron/dark,
21652172
/area/ruin/syndicate_lava_base/cargo)
2173+
"sB" = (
2174+
/obj/structure/sign/warning/secure_area,
2175+
/turf/closed/wall/mineral/plastitanium/nodiagonal,
2176+
/area/ruin/syndicate_lava_base/cargo)
21662177
"sH" = (
21672178
/obj/machinery/door/airlock/virology/glass{
21682179
name = "Monkey Pen"
@@ -3316,7 +3327,6 @@
33163327
/obj/structure/table/wood,
33173328
/obj/item/ammo_box/magazine/m9mm,
33183329
/obj/machinery/airalarm/directional/north,
3319-
/obj/item/crowbar/red,
33203330
/obj/effect/mapping_helpers/airalarm/syndicate_access,
33213331
/turf/open/floor/carpet/red,
33223332
/area/ruin/syndicate_lava_base/dormitories)
@@ -3648,6 +3658,10 @@
36483658
},
36493659
/turf/open/floor/iron,
36503660
/area/ruin/syndicate_lava_base/engineering)
3661+
"Oj" = (
3662+
/obj/structure/sign/warning/secure_area,
3663+
/turf/closed/wall/mineral/plastitanium/nodiagonal,
3664+
/area/ruin/syndicate_lava_base/arrivals)
36513665
"Oq" = (
36523666
/obj/effect/spawner/random/vending/colavend{
36533667
hacked = 1
@@ -4127,7 +4141,6 @@
41274141
/obj/item/ammo_box/magazine/m9mm,
41284142
/obj/item/ammo_box/magazine/sniper_rounds,
41294143
/obj/machinery/airalarm/directional/north,
4130-
/obj/item/crowbar/red,
41314144
/obj/effect/mapping_helpers/airalarm/syndicate_access,
41324145
/turf/open/floor/carpet/red,
41334146
/area/ruin/syndicate_lava_base/dormitories)
@@ -4506,7 +4519,6 @@
45064519
/obj/structure/table/wood,
45074520
/obj/item/ammo_box/magazine/m9mm,
45084521
/obj/item/ammo_box/magazine/sniper_rounds,
4509-
/obj/item/crowbar/red,
45104522
/turf/open/floor/carpet/red,
45114523
/area/ruin/syndicate_lava_base/dormitories)
45124524
"Zw" = (
@@ -5325,7 +5337,7 @@ Vb
53255337
mT
53265338
mT
53275339
mT
5328-
oF
5340+
Oj
53295341
ab
53305342
ab
53315343
ab
@@ -6648,7 +6660,7 @@ ab
66486660
ab
66496661
ab
66506662
ab
6651-
fx
6663+
sB
66526664
gh
66536665
fx
66546666
si

_maps/RandomRuins/LavaRuins/lavaland_surface_syndicate_base1/commswilding_1.dmm

+5-1
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@
135135
/obj/effect/turf_decal/tile/neutral/fourcorners,
136136
/turf/open/floor/iron/dark,
137137
/area/ruin/syndicate_lava_base/telecomms)
138+
"R" = (
139+
/obj/structure/filingcabinet/medical,
140+
/turf/open/floor/iron/dark,
141+
/area/ruin/syndicate_lava_base/telecomms)
138142
"U" = (
139143
/obj/machinery/light/small/directional/east,
140144
/obj/machinery/atmospherics/components/unary/vent_pump/on/layer4,
@@ -216,7 +220,7 @@ f
216220
(6,1,1) = {"
217221
a
218222
e
219-
c
223+
R
220224
Z
221225
m
222226
C

0 commit comments

Comments
 (0)