Skip to content

Commit

Permalink
[MDB IGNORE] [IDB IGNORE] Upstream Merge for New Years (MrMelbert#131)
Browse files Browse the repository at this point in the history
* Squashed commit of Upstream Merge
  • Loading branch information
MrMelbert authored Jan 3, 2022
1 parent a6a28ac commit f3ab628
Show file tree
Hide file tree
Showing 1,841 changed files with 92,435 additions and 58,568 deletions.
1 change: 1 addition & 0 deletions .github/gbp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ no_balance_label = "GBP: No Update"
reset_label = "GBP: Reset"

[points]
"Accessibility" = 3
"Administration" = 2
"Atomic" = 2
"Balance/Rebalance" = -8
Expand Down
6 changes: 3 additions & 3 deletions .github/guides/HARDDELETES.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ This of course means they can store that location in memory in another object's
/proc/someshit(mem_location)
var/datum/some_obj = new()
some_obj.reference = mem_location
some_obj.reference = mem_location
```

But what happens when you get rid of the object we're passing around references to? If we just cleared it out from memory, everything that holds a reference to it would suddenly be pointing to nowhere, or worse, something totally different!
Expand Down Expand Up @@ -94,7 +94,7 @@ Let's briefly go over the more painful ones yeah?

### Sleeping procs

Any proc that calls `sleep()`, `spawn()`, or anything that creates a seperate "thread" (not technically a thread, but it's the same in these terms. Not gonna cause any race conditions tho) will hang references to any var inside it. This includes the usr it started from, the src it was called on, and any vars created as a part of processing
Any proc that calls `sleep()`, `spawn()`, or anything that creates a separate "thread" (not technically a thread, but it's the same in these terms. Not gonna cause any race conditions tho) will hang references to any var inside it. This includes the usr it started from, the src it was called on, and any vars created as a part of processing

### Static vars

Expand Down Expand Up @@ -128,7 +128,7 @@ You can read more about what each of these do in that file, but the long and sho

It'll tell you what object is holding the ref if it's in an object, or what pattern of list transversal was required to find the ref if it's hiding in a list of some sort

## Techniques For Fixing Hard Deletes
## Techniques For Fixing Hard Deletes

Once you've found the issue, it becomes a matter of making sure the ref is cleared as a part of Destroy(). I'm gonna walk you through a few patterns and discuss how you might go about fixing them

Expand Down
13 changes: 7 additions & 6 deletions .github/guides/STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ All procs that are registered to listen for signals using `RegisterSignal()` mus
```
This is to ensure that it is clear the proc handles signals and turns on a lint to ensure it does not sleep.

Any sleeping behaviour that you need to perform inside a `SIGNAL_HANDLER` proc must be called asynchronously (e.g. with `INVOKE_ASYNC()`) or be redone to work asynchronously.
Any sleeping behaviour that you need to perform inside a `SIGNAL_HANDLER` proc must be called asynchronously (e.g. with `INVOKE_ASYNC()`) or be redone to work asynchronously.

### Enforcing parent calling

Expand Down Expand Up @@ -222,7 +222,7 @@ Good:
off_overlay = iconstate2appearance(icon, "off")
broken_overlay = icon2appearance(broken_icon)
if (stat & broken)
add_overlay(broken_overlay)
add_overlay(broken_overlay)
return
if (is_on)
add_overlay(on_overlay)
Expand All @@ -243,10 +243,10 @@ Bad:
```dm
/obj/machine/update_overlays(var/blah)
var/static/our_overlays
if(isnull(our_overlays)
if (isnull(our_overlays))
our_overlays = list("on" = iconstate2appearance(overlay_icon, "on"), "off" = iconstate2appearance(overlay_icon, "off"), "broken" = iconstate2appearance(overlay_icon, "broken"))
if (stat & broken)
add_overlay(our_overlays["broken"])
add_overlay(our_overlays["broken"])
return
...
```
Expand All @@ -256,9 +256,10 @@ Good:
#define OUR_ON_OVERLAY 1
#define OUR_OFF_OVERLAY 2
#define OUR_BROKEN_OVERLAY 3
/obj/machine/update_overlays(var/blah
/obj/machine/update_overlays(var/blah)
var/static/our_overlays
if(isnull(our_overlays)
if (isnull(our_overlays))
our_overlays = list(iconstate2appearance(overlay_icon, "on"), iconstate2appearance(overlay_icon, "off"), iconstate2appearance(overlay_icon, "broken"))
if (stat & broken)
add_overlay(our_overlays[OUR_BROKEN_OVERLAY])
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* **Codedocs:** https://codedocs.tgstation13.org/
* **/tg/station Discord:** https://tgstation13.org/phpBB/viewforum.php?f=60
* **Coderbus Discord:** https://discord.gg/Vh8TJp9
* ~~**IRC:** irc://irc.rizon.net/coderbus~~ (dead)

This is the codebase for the /tg/station flavoured fork of SpaceStation 13.

Expand Down
64 changes: 61 additions & 3 deletions SQL/database_changelog.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,71 @@
Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255.

The latest database version is 5.17; The query to update the schema revision table is:
Make sure to also update `DB_MAJOR_VERSION` and `DB_MINOR_VERSION`, which can be found in `code/__DEFINES/subsystem.dm`.

INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 17);
The latest database version is 5.21; The query to update the schema revision table is:

INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 22);
or
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 17);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 22);

In any query remember to add a prefix to the table names if you use one.

Version 5.22, 22 December 2021, by Mothblocks
Fixes a bug in `telemetry_connections` that limited the range of IPs.

```
ALTER TABLE `telemetry_connections` MODIFY COLUMN `address` INT(10) UNSIGNED NOT NULL;
```
-----------------------------------------------------

Version 5.21, 15 December 2021, by Mothblocks
Adds `telemetry_connections` table for tracking tgui telemetry.

```
CREATE TABLE `telemetry_connections` (
`id` INT NOT NULL AUTO_INCREMENT,
`ckey` VARCHAR(32) NOT NULL,
`telemetry_ckey` VARCHAR(32) NOT NULL,
`address` INT(10) NOT NULL,
`computer_id` VARCHAR(32) NOT NULL,
`first_round_id` INT(11) UNSIGNED NULL,
`latest_round_id` INT(11) UNSIGNED NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_constraints` (`ckey` , `telemetry_ckey` , `address` , `computer_id`)
);
```
-----------------------------------------------------

Version 5.20, 11 November 2021, by Mothblocks
Adds `admin_ckey` field to the `known_alts` table to track who added what.

```
ALTER TABLE `known_alts`
ADD COLUMN `admin_ckey` VARCHAR(32) NOT NULL DEFAULT '*no key*' AFTER `ckey2`;
```

-----------------------------------------------------
Version 5.19, 10 November 2021, by WalterMeldron
Adds an urgent column to tickets for ahelps marked as urgent.

```
ALTER TABLE `ticket` ADD COLUMN `urgent` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `sender`;
```

-----------------------------------------------------
Version 5.18, 1 November 2021, by Mothblocks
Added `known_alts` table for tracking who not to create suspicious logins for.

```
CREATE TABLE `known_alts` (
`id` INT NOT NULL AUTO_INCREMENT,
`ckey1` VARCHAR(32) NOT NULL,
`ckey2` VARCHAR(32) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_contraints` (`ckey1` , `ckey2`)
);
```

-----------------------------------------------------
Version 5.17, 8 October 2021, by MrStonedOne + Mothblocks
Changes any table that requrired a NOT NULL round ID to now accept NULL. In the BSQL past, these were handled as 0, but in the move to rust-g this behavior was lost.
Expand Down
30 changes: 30 additions & 0 deletions SQL/tgstation_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ CREATE TABLE `ticket` (
`round_id` int(11) unsigned NULL,
`ticket` smallint(11) unsigned NOT NULL,
`action` varchar(20) NOT NULL DEFAULT 'Message',
`urgent` TINYINT(1) unsigned NOT NULL DEFAULT '0',
`message` text NOT NULL,
`timestamp` datetime NOT NULL,
`recipient` varchar(32) DEFAULT NULL,
Expand Down Expand Up @@ -663,6 +664,35 @@ CREATE TABLE `admin_connections` (
UNIQUE INDEX `unique_constraints` (`ckey`, `ip`, `cid`)
) ENGINE=InnoDB;

--
-- Table structure for table `known_alts`
--
DROP TABLE IF EXISTS `known_alts`;
CREATE TABLE `known_alts` (
`id` INT NOT NULL AUTO_INCREMENT,
`ckey1` VARCHAR(32) NOT NULL,
`ckey2` VARCHAR(32) NOT NULL,
`admin_ckey` VARCHAR(32) NOT NULL DEFAULT '*no key*',
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_contraints` (`ckey1` , `ckey2`)
);

--
-- Table structure for table `telemetry_connections`
--
DROP TABLE IF EXISTS `telemetry_connections`;
CREATE TABLE `telemetry_connections` (
`id` INT NOT NULL AUTO_INCREMENT,
`ckey` VARCHAR(32) NOT NULL,
`telemetry_ckey` VARCHAR(32) NOT NULL,
`address` INT(10) UNSIGNED NOT NULL,
`computer_id` VARCHAR(32) NOT NULL,
`first_round_id` INT(11) UNSIGNED NULL,
`latest_round_id` INT(11) UNSIGNED NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_constraints` (`ckey` , `telemetry_ckey` , `address` , `computer_id`)
);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
Expand Down
30 changes: 30 additions & 0 deletions SQL/tgstation_schema_prefixed.sql
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,7 @@ CREATE TABLE `SS13_ticket` (
`round_id` int(11) unsigned NULL,
`ticket` smallint(11) unsigned NOT NULL,
`action` varchar(20) NOT NULL DEFAULT 'Message',
`urgent` TINYINT(1) unsigned NOT NULL DEFAULT '0',
`message` text NOT NULL,
`timestamp` datetime NOT NULL,
`recipient` varchar(32) DEFAULT NULL,
Expand Down Expand Up @@ -663,6 +664,35 @@ CREATE TABLE `SS13_admin_connections` (
UNIQUE INDEX `unique_constraints` (`ckey`, `ip`, `cid`)
) ENGINE=InnoDB;

--
-- Table structure for table `known_alts`
--
DROP TABLE IF EXISTS `SS13_known_alts`;
CREATE TABLE `SS13_known_alts` (
`id` INT NOT NULL AUTO_INCREMENT,
`ckey1` VARCHAR(32) NOT NULL,
`ckey2` VARCHAR(32) NOT NULL,
`admin_ckey` VARCHAR(32) NOT NULL DEFAULT '*no key*',
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_contraints` (`ckey1` , `ckey2`)
);

--
-- Table structure for table `telemetry_connections`
--
DROP TABLE IF EXISTS `SS13_telemetry_connections`;
CREATE TABLE `SS13_telemetry_connections` (
`id` INT NOT NULL AUTO_INCREMENT,
`ckey` VARCHAR(32) NOT NULL,
`telemetry_ckey` VARCHAR(32) NOT NULL,
`address` INT(10) UNSIGNED NOT NULL,
`computer_id` VARCHAR(32) NOT NULL,
`first_round_id` INT(11) UNSIGNED NULL,
`latest_round_id` INT(11) UNSIGNED NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `unique_constraints` (`ckey` , `telemetry_ckey` , `address` , `computer_id`)
);

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
Expand Down
6 changes: 3 additions & 3 deletions _maps/RandomRuins/AnywhereRuins/golem_ship.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"m" = (
/obj/effect/mob_spawn/human/golem/adamantine,
/obj/effect/mob_spawn/ghost_role/human/golem/adamantine,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"n" = (
Expand Down Expand Up @@ -208,7 +208,7 @@
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"M" = (
/obj/effect/mob_spawn/human/golem/adamantine,
/obj/effect/mob_spawn/ghost_role/human/golem/adamantine,
/obj/machinery/light/small/directional/north,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
Expand All @@ -230,7 +230,7 @@
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
"U" = (
/obj/effect/mob_spawn/human/golem/adamantine,
/obj/effect/mob_spawn/ghost_role/human/golem/adamantine,
/obj/machinery/light/small/directional/south,
/turf/open/floor/mineral/titanium/purple,
/area/ruin/powered/golem_ship)
Expand Down
4 changes: 2 additions & 2 deletions _maps/RandomRuins/IceRuins/icemoon_surface_asteroid.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
/turf/open/floor/bronze,
/area/icemoon/surface)
"h" = (
/obj/effect/mob_spawn/human/skeleton,
/obj/effect/mob_spawn/corpse/human/skeleton,
/obj/item/clothing/suit/bronze,
/obj/item/clothing/shoes/bronze,
/obj/item/clothing/head/bronze,
Expand Down Expand Up @@ -56,7 +56,7 @@
/turf/open/floor/bronze,
/area/icemoon/surface)
"J" = (
/obj/effect/mob_spawn/human/skeleton,
/obj/effect/mob_spawn/corpse/human/skeleton,
/turf/open/floor/bronze,
/area/icemoon/surface)
"K" = (
Expand Down
4 changes: 2 additions & 2 deletions _maps/RandomRuins/IceRuins/icemoon_surface_bughabitat.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"hy" = (
/obj/effect/decal/remains/human,
/obj/item/clothing/suit/toggle/labcoat,
/obj/machinery/power/apc/auto_name/west,
/obj/machinery/power/apc/auto_name/directional/west,
/obj/structure/cable,
/obj/structure/window/reinforced/spawner/north,
/turf/open/floor/plastic,
Expand Down Expand Up @@ -333,9 +333,9 @@
/obj/structure/toilet{
dir = 8
},
/obj/machinery/light/small/blacklight,
/obj/item/plunger,
/mob/living/simple_animal/mouse,
/obj/machinery/light/small/blacklight/directional/south,
/turf/open/floor/plastic,
/area/ruin/bughabitat)
"Pt" = (
Expand Down
8 changes: 4 additions & 4 deletions _maps/RandomRuins/IceRuins/icemoon_surface_engioutpost.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/turf/open/floor/plating/snowed/icemoon,
/area/icemoon/surface/outdoors)
"ac" = (
/obj/effect/mob_spawn/human/engineer/rig,
/obj/effect/mob_spawn/corpse/human/engineer/mod,
/turf/open/floor/plating/snowed/icemoon,
/area/icemoon/surface/outdoors)
"ad" = (
Expand Down Expand Up @@ -367,7 +367,7 @@
/turf/open/floor/plating/snowed/icemoon,
/area/icemoon/surface/outdoors)
"bz" = (
/obj/item/clothing/suit/space/hardsuit/engine,
/obj/item/mod/control/pre_equipped/engineering,
/turf/open/floor/plating/asteroid/snow/icemoon,
/area/icemoon/surface/outdoors)
"bA" = (
Expand Down Expand Up @@ -470,7 +470,7 @@
/turf/open/floor/iron/icemoon,
/area/icemoon/surface/outdoors)
"bV" = (
/obj/effect/mob_spawn/human/corpse/assistant,
/obj/effect/mob_spawn/corpse/human/assistant,
/turf/open/floor/iron/icemoon,
/area/icemoon/surface/outdoors)
"bW" = (
Expand Down Expand Up @@ -719,7 +719,7 @@
/area/icemoon/surface/outdoors)
"cU" = (
/obj/structure/cable,
/obj/effect/mob_spawn/human/engineer/rig,
/obj/effect/mob_spawn/corpse/human/engineer/mod,
/turf/open/floor/plating/icemoon,
/area/icemoon/surface/outdoors)
"cV" = (
Expand Down
2 changes: 1 addition & 1 deletion _maps/RandomRuins/IceRuins/icemoon_surface_mining_site.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
"r" = (
/obj/item/chair/wood,
/obj/effect/decal/cleanable/blood/splatter,
/obj/effect/mob_spawn/human/miner/explorer,
/obj/effect/mob_spawn/corpse/human/miner/explorer,
/obj/effect/decal/cleanable/blood/drip,
/turf/open/floor/wood,
/area/ruin/unpowered)
Expand Down
Loading

0 comments on commit f3ab628

Please sign in to comment.