Skip to content

Commit

Permalink
Discord commands updates (#17212)
Browse files Browse the repository at this point in the history
Co-authored-by: TiviPlus <[email protected]>
  • Loading branch information
TiviPlus and TiviPlus authored Mar 5, 2025
1 parent b8cee3c commit 46dc24d
Show file tree
Hide file tree
Showing 14 changed files with 1,712 additions and 72 deletions.
20 changes: 18 additions & 2 deletions SQL/database_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,30 @@ Any time you make a change to the schema files, remember to increment the databa
The latest database version is 2.0; The query to update the schema revision table is:

```sql
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (2, 3);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (2, 5);
or
```
```sql
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (2, 3);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (2, 5);
```
In any query remember to add a prefix to the table names if you use one.

----------------------------------------------------
Version 2.5, 24 February 2025, by TiviPlus
Added discord_links table for discord-ckey verification
```sql
DROP TABLE IF EXISTS `discord_links`;
CREATE TABLE `discord_links` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` VARCHAR(32) NOT NULL,
`discord_id` BIGINT(20) DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`one_time_token` VARCHAR(100) NOT NULL,
`valid` BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;
```

----------------------------------------------------
Version 2.3, 04 February 2025, by TiviPlus
Fixed admin rank table flags being capped at 16 in the DB instead of 24 (byond max)
Expand Down
14 changes: 14 additions & 0 deletions SQL/tgmc-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,20 @@ END
$$
DELIMITER ;

--
-- Table structure for table `discord_links`
--
DROP TABLE IF EXISTS `discord_links`;
CREATE TABLE `discord_links` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` VARCHAR(32) NOT NULL,
`discord_id` BIGINT(20) DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`one_time_token` VARCHAR(100) NOT NULL,
`valid` BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY (`id`)
) ENGINE=InnoDB;

DROP TABLE IF EXISTS `tutorial_completions`;
CREATE TABLE `tutorial_completions` (
`id` INT NOT NULL AUTO_INCREMENT,
Expand Down
37 changes: 19 additions & 18 deletions code/__DEFINES/_subsystems.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//Update this whenever the db schema changes
//make sure you add an update to the schema_version stable in the db changelog
#define DB_MAJOR_VERSION 2
#define DB_MINOR_VERSION 3
#define DB_MINOR_VERSION 5

//Timing subsystem
//Don't run if there is an identical unique timer active
Expand Down Expand Up @@ -86,23 +86,24 @@
#define INIT_ORDER_SECURITY_LEVEL 18
#define INIT_ORDER_INSTRUMENTS 17
#define INIT_ORDER_GREYSCALE 16
#define INIT_ORDER_CODEX 15
#define INIT_ORDER_EVENTS 14
#define INIT_ORDER_MONITOR 13
#define INIT_ORDER_JOBS 12
#define INIT_ORDER_TICKER 11
#define INIT_ORDER_MAPPING 10
#define INIT_ORDER_EARLY_ASSETS 9
#define INIT_ORDER_SPATIAL_GRID 8
#define INIT_ORDER_PERSISTENCE 7 //before assets because some assets take data from SSPersistence, such as vendor items
#define INIT_ORDER_TTS 6
#define INIT_ORDER_ATOMS 5
#define INIT_ORDER_MODULARMAPPING 4
#define INIT_ORDER_MACHINES 3
#define INIT_ORDER_AI_NODES 2
#define INIT_ORDER_TIMER 1
#define INIT_ORDER_DEFAULT 0
#define INIT_ORDER_AIR -1
#define INIT_ORDER_DISCORD 15
#define INIT_ORDER_CODEX 14
#define INIT_ORDER_EVENTS 13
#define INIT_ORDER_MONITOR 12
#define INIT_ORDER_JOBS 11
#define INIT_ORDER_TICKER 10
#define INIT_ORDER_MAPPING 9
#define INIT_ORDER_EARLY_ASSETS 8
#define INIT_ORDER_SPATIAL_GRID 7
#define INIT_ORDER_PERSISTENCE 6 //before assets because some assets take data from SSPersistence, such as vendor items
#define INIT_ORDER_TTS 5
#define INIT_ORDER_ATOMS 4
#define INIT_ORDER_MODULARMAPPING 3
#define INIT_ORDER_MACHINES 2
#define INIT_ORDER_AI_NODES 1
#define INIT_ORDER_TIMER 0
#define INIT_ORDER_DEFAULT -1
#define INIT_ORDER_AIR -2
#define INIT_ORDER_ASSETS -4
#define INIT_ORDER_SPAWNING_POOL -5
#define INIT_ORDER_OVERLAY -6
Expand Down
11 changes: 11 additions & 0 deletions code/controllers/configuration/entries/game_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,14 @@
/datum/config_entry/str_list/tts_voice_blacklist

/datum/config_entry/flag/give_tutorials_without_db

/datum/config_entry/str_list/channel_announce_new_game

/datum/config_entry/str_list/chat_new_game_notifications

/datum/config_entry/string/discordbotcommandprefix
default = "?"

/// validate ownership of admin flags for chat commands
/datum/config_entry/flag/secure_chat_commands
default = FALSE
Loading

0 comments on commit 46dc24d

Please sign in to comment.