Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
f6585da
Yippeee
flleeppyy Sep 10, 2025
aae5ebe
guh
flleeppyy Sep 11, 2025
13b594c
Merge branch 'master' into playtime-enhancements
flleeppyy Sep 11, 2025
a1e332f
forgot a thing; intern garbage
flleeppyy Sep 11, 2025
f696f5e
make linters happy i think
flleeppyy Sep 11, 2025
1565ad0
yippee, woohoo
flleeppyy Sep 12, 2025
2f0d48b
remove unused flag
flleeppyy Sep 12, 2025
a6dacfd
interns work now!
flleeppyy Sep 12, 2025
b6203b9
ah yeah fix that
flleeppyy Sep 12, 2025
87c9be3
Merge branch 'master' of https://github.com/monkestation/Monkeris int…
flleeppyy Sep 12, 2025
732f0a2
uncomment those blackbox comments; remove some stuff
flleeppyy Sep 12, 2025
82d02b3
run prettier linter
flleeppyy Sep 12, 2025
f6983f2
Merge branch 'master' of https://github.com/monkestation/Monkeris int…
flleeppyy Sep 13, 2025
28c0468
ASDF
flleeppyy Sep 13, 2025
54af37f
Merge branch 'master' into playtime-enhancements
flleeppyy Sep 13, 2025
bb1f849
FCUKK MEEEEE IM SO OVERHWLEMED
flleeppyy Sep 13, 2025
ac62303
Merge branch 'master' into playtime-enhancements
flleeppyy Oct 1, 2025
f6998a9
Merge branch 'master' of https://github.com/monkestation/Monkeris int…
flleeppyy Oct 4, 2025
c8ec7b4
fix dat linter garbagegebge
flleeppyy Oct 4, 2025
af1badd
Merge branch 'master' into playtime-enhancements
flleeppyy Oct 7, 2025
35f7d8d
Merge branch 'master' into playtime-enhancements
flleeppyy Oct 10, 2025
3746473
do not fix merge conflicts in the web editor do not fix merge conflic…
flleeppyy Oct 10, 2025
a58768d
Merge branch 'master' of https://github.com/monkestation/Monkeris int…
flleeppyy Oct 26, 2025
3280b55
potential fix
flleeppyy Oct 26, 2025
b1dfa72
no
flleeppyy Oct 26, 2025
b80d738
Merge branch 'master' of https://github.com/monkestation/Monkeris int…
flleeppyy Oct 27, 2025
9b5be52
Add feedback table
flleeppyy Oct 27, 2025
79e629f
asdf
flleeppyy Oct 27, 2025
e4a3df4
remove my screaming warning
flleeppyy Oct 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
121 changes: 103 additions & 18 deletions SQL/ceveris_schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,26 @@ CREATE TABLE `death` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `feedback`
--

DROP TABLE IF EXISTS `feedback`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `feedback` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(11) unsigned NULL,
`key_name` varchar(32) NOT NULL,
`key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
`version` tinyint(3) unsigned NOT NULL,
`json` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `player`
--
Expand All @@ -183,6 +203,25 @@ CREATE TABLE `player` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `legacy_population`
--

DROP TABLE IF EXISTS `legacy_population`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `legacy_population` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`playercount` int(11) DEFAULT NULL,
`admincount` int(11) DEFAULT NULL,
`time` datetime NOT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;


--
-- Table structure for table `library`
Expand Down Expand Up @@ -241,6 +280,44 @@ CREATE TABLE `messages` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role_time`
--

DROP TABLE IF EXISTS `role_time`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

CREATE TABLE `role_time`
( `ckey` VARCHAR(32) NOT NULL ,
`job` VARCHAR(32) NOT NULL ,
`minutes` INT UNSIGNED NOT NULL,
PRIMARY KEY (`ckey`, `job`)
) ENGINE = InnoDB;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `role_time`
--

DROP TABLE IF EXISTS `role_time_log`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;

CREATE TABLE IF NOT EXISTS `role_time_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) NOT NULL,
`job` varchar(128) NOT NULL,
`delta` int(11) NOT NULL,
`datetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `ckey` (`ckey`),
KEY `job` (`job`),
KEY `datetime` (`datetime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;



--
-- Table structure for table `polls`
Expand Down Expand Up @@ -351,25 +428,33 @@ CREATE TABLE `poll_votes` (
CONSTRAINT `fk_rails_a6e6974b7e` FOREIGN KEY (`poll_id`) REFERENCES `polls` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP PROCEDURE IF EXISTS `set_poll_deleted`;
DROP TRIGGER IF EXISTS `role_timeTlogupdate`;
DROP TRIGGER IF EXISTS `role_timeTloginsert`;
DROP TRIGGER IF EXISTS `role_timeTlogdelete`;
DELIMITER $$
CREATE PROCEDURE `set_poll_deleted`(
IN `poll_id` INT
)
SQL SECURITY INVOKER
BEGIN
UPDATE `poll_question` SET deleted = 1 WHERE id = poll_id;
UPDATE `poll_option` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `poll_vote` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `poll_textreply` SET deleted = 1 WHERE pollid = poll_id;
END
$$
CREATE TRIGGER `role_timeTlogupdate` AFTER UPDATE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.CKEY, NEW.job, NEW.minutes-OLD.minutes);
END
$$
CREATE TRIGGER `role_timeTloginsert` AFTER INSERT ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.ckey, NEW.job, NEW.minutes);
END
$$
CREATE TRIGGER `role_timeTlogdelete` AFTER DELETE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (OLD.ckey, OLD.job, 0-OLD.minutes);
END
$$
DELIMITER ;

--
-- Table structure for table `populations`
--

DROP TABLE IF EXISTS `populations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `populations` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`playercount` int(11) DEFAULT NULL,
`admincount` int(11) DEFAULT NULL,
`time` datetime NOT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Table structure for table `round`
Expand Down
76 changes: 74 additions & 2 deletions SQL/database_changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,86 @@ Any time you make a change to the schema files, remember to increment the databa

Make sure to also update `DB_MAJOR_VERSION` and `DB_MINOR_VERSION`, which can be found in `code/__DEFINES/subsystem.dm`.

The latest database version is 3.1; The query to update the schema revision table is:
The latest database version is 3.2; The query to update the schema revision table is:

```sql
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 1);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 2);
```


In any query remember to add a prefix to the table names if you use one.
-----------------------------------------------------
Version 3.2 27 October 2025, by Flleeppyy
Add `feedback`, `legacy_population`, `role_time` and `role_time_log` tables

```sql

CREATE TABLE `feedback` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
`round_id` int(11) unsigned NULL,
`key_name` varchar(32) NOT NULL,
`key_type` enum('text', 'amount', 'tally', 'nested tally', 'associative') NOT NULL,
`version` tinyint(3) unsigned NOT NULL,
`json` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `legacy_population` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`playercount` int(11) DEFAULT NULL,
`admincount` int(11) DEFAULT NULL,
`time` datetime NOT NULL,
`server_ip` int(10) unsigned NOT NULL,
`server_port` smallint(5) unsigned NOT NULL,
`round_id` int(11) unsigned NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

CREATE TABLE `role_time`
( `ckey` VARCHAR(32) NOT NULL ,
`job` VARCHAR(32) NOT NULL ,
`minutes` INT UNSIGNED NOT NULL,
PRIMARY KEY (`ckey`, `job`)
) ENGINE = InnoDB;


CREATE TABLE `role_time_log` (
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) NOT NULL,
`job` varchar(128) NOT NULL,
`delta` int(11) NOT NULL,
`datetime` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
PRIMARY KEY (`id`),
KEY `ckey` (`ckey`),
KEY `job` (`job`),
KEY `datetime` (`datetime`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

DELIMITER $$
CREATE PROCEDURE `set_poll_deleted`(
IN `poll_id` INT
)
SQL SECURITY INVOKER
BEGIN
UPDATE `poll_question` SET deleted = 1 WHERE id = poll_id;
UPDATE `poll_option` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `poll_vote` SET deleted = 1 WHERE pollid = poll_id;
UPDATE `poll_textreply` SET deleted = 1 WHERE pollid = poll_id;
END
$$
CREATE TRIGGER `role_timeTlogupdate` AFTER UPDATE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.CKEY, NEW.job, NEW.minutes-OLD.minutes);
END
$$
CREATE TRIGGER `role_timeTloginsert` AFTER INSERT ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.ckey, NEW.job, NEW.minutes);
END
$$
CREATE TRIGGER `role_timeTlogdelete` AFTER DELETE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (OLD.ckey, OLD.job, 0-OLD.minutes);
END
$$
DELIMITER ;
```

-----------------------------------------------------
Version 3.1 7 October 2025, by Flleeppyy
Remove `stickyban` and its related tables.
Expand Down
5 changes: 5 additions & 0 deletions cev_eris.dme
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@
#include "code\__DEFINES\tgs.dm"
#include "code\__DEFINES\tgui.dm"
#include "code\__DEFINES\tick.dm"
#include "code\__DEFINES\tickets.dm"
#include "code\__DEFINES\time.dm"
#include "code\__DEFINES\tools_and_qualities.dm"
#include "code\__DEFINES\topic.dm"
Expand Down Expand Up @@ -291,6 +292,7 @@
#include "code\controllers\subsystems\assets.dm"
#include "code\controllers\subsystems\atoms.dm"
#include "code\controllers\subsystems\ban_cache.dm"
#include "code\controllers\subsystems\blackbox.dm"
#include "code\controllers\subsystems\chat.dm"
#include "code\controllers\subsystems\chemistry.dm"
#include "code\controllers\subsystems\chunks.dm"
Expand Down Expand Up @@ -724,6 +726,8 @@
#include "code\game\jobs\access.dm"
#include "code\game\jobs\access_datum.dm"
#include "code\game\jobs\department.dm"
#include "code\game\jobs\job_exp.dm"
#include "code\game\jobs\job_report.dm"
#include "code\game\jobs\jobs.dm"
#include "code\game\jobs\wages.dm"
#include "code\game\jobs\job\assistant.dm"
Expand Down Expand Up @@ -1586,6 +1590,7 @@
#include "code\modules\client\client_procs.dm"
#include "code\modules\client\darkmode.dm"
#include "code\modules\client\message.dm"
#include "code\modules\client\persistent_client.dm"
#include "code\modules\client\preferences.dm"
#include "code\modules\client\preferences_options.dm"
#include "code\modules\client\preferences_savefile.dm"
Expand Down
37 changes: 37 additions & 0 deletions code/__DEFINES/jobs.dm
Original file line number Diff line number Diff line change
@@ -1,5 +1,30 @@
#define JOB_AVAILABLE 0
#define JOB_UNAVAILABLE_GENERIC 1
#define JOB_UNAVAILABLE_BANNED 2
#define JOB_UNAVAILABLE_PLAYTIME 3
#define JOB_UNAVAILABLE_ACCOUNTAGE 4
#define JOB_UNAVAILABLE_SLOTFULL 5
/// Job unavailable due to incompatibility with an antag role.
#define JOB_UNAVAILABLE_ANTAG_INCOMPAT 6
#define JOB_UNAVAILABLE_CONDITIONS_UNMET 7

/// Used when the `get_job_unavailable_error_message` proc can't make sense of a given code.
#define GENERIC_JOB_UNAVAILABLE_ERROR "Error: Unknown job availability."

#define ASSISTANT_TITLE "Vagabond"

/**
* =======================
* WARNING WARNING WARNING
* WARNING WARNING WARNING
* WARNING WARNING WARNING
* =======================
* These names are used as keys in many locations in the database
* you cannot change them trivially without breaking job bans and
* role time tracking, if you do this and get it wrong you will die
* and it will hurt the entire time
*/

//Jobs depatment lists for use in constant expressions
#define JOBS_SECURITY "Ironhammer Commander","Ironhammer Gunnery Sergeant","Ironhammer Inspector","Ironhammer Medical Specialist","Ironhammer Operative"
#define JOBS_ARMORY "Captain","First Officer","Ironhammer Commander","Ironhammer Gunnery Sergeant"
Expand Down Expand Up @@ -27,5 +52,17 @@
#define DEPARTMENT_OFFSHIP "Offship"
#define DEPARTMENT_SILICON "Silicon"


#define EXP_TYPE_LIVING "Living"
#define EXP_TYPE_CREW "Crew"

#define EXP_TYPE_ANTAG "Antag"
#define EXP_TYPE_SPECIAL "Special"
#define EXP_TYPE_GHOST "Ghost"
#define EXP_TYPE_ADMIN "Admin"

#define ALL_DEPARTMENTS list(DEPARTMENT_COMMAND, DEPARTMENT_MEDICAL, DEPARTMENT_ENGINEERING, DEPARTMENT_SCIENCE, DEPARTMENT_SECURITY, DEPARTMENT_GUILD, DEPARTMENT_CIVILIAN, DEPARTMENT_CHURCH)
#define ASTER_DEPARTMENTS list(DEPARTMENT_COMMAND, DEPARTMENT_GUILD)

/// Fallback time if none of the config entries are set for USE_LOW_LIVING_HOUR_INTERN
#define INTERN_THRESHOLD_FALLBACK_HOURS 15
1 change: 1 addition & 0 deletions code/__DEFINES/logging.dm
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
#define LOG_CATEGORY_DEBUG "debug"
#define LOG_CATEGORY_DEBUG_ASSET "debug-asset"
#define LOG_CATEGORY_DEBUG_HREF "debug-href"
#define LOG_CATEGORY_DEBUG_JOB "debug-job"
// #ifndef DISABLE_DREAMLUAU
// #define LOG_CATEGORY_DEBUG_LUA "debug-lua"
// #endif
Expand Down
10 changes: 10 additions & 0 deletions code/__DEFINES/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@
#define TGUI_LAYOUT_GRID "grid"
/// Force list layout, even if default is a grid.
#define TGUI_LAYOUT_LIST "list"

//Flags in the players table in the db
#define DB_FLAG_EXEMPT 1

//Job preferences levels

#define JOB_LEVEL_NEVER 4
#define JOB_LEVEL_LOW 3
#define JOB_LEVEL_MEDIUM 2
#define JOB_LEVEL_HIGH 1
14 changes: 14 additions & 0 deletions code/__DEFINES/tickets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//Defines
//Deciseconds until ticket becomes stale if unanswered. Alerts admins.
#define TICKET_TIMEOUT 10 MINUTES // 10 minutes
//Decisecions before the user is allowed to open another ticket while their existing one is open.
#define TICKET_DUPLICATE_COOLDOWN 5 MINUTES // 5 minutes

//Status defines
#define TICKET_OPEN 1
#define TICKET_CLOSED 2
#define TICKET_RESOLVED 3
#define TICKET_STALE 4

#define TICKET_STAFF_MESSAGE_ADMIN_CHANNEL 1
#define TICKET_STAFF_MESSAGE_PREFIX 2
6 changes: 3 additions & 3 deletions code/__HELPERS/_lists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -894,7 +894,7 @@ Checks if a list has the same entries and values as an element of big.

//Copies a list, and all lists inside it recusively
//Does not copy any other reference type
/proc/deepCopyList(list/l)
/proc/deep_copy_list(list/l)
if(!islist(l))
return l
. = l.Copy()
Expand All @@ -905,10 +905,10 @@ Checks if a list has the same entries and values as an element of big.
continue
var/value = .[key]
if(islist(value))
value = deepCopyList(value)
value = deep_copy_list(value)
.[key] = value
if(islist(key))
key = deepCopyList(key)
key = deep_copy_list(key)
.[i] = key
.[key] = value

Expand Down
4 changes: 4 additions & 0 deletions code/__HELPERS/logging/debug.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
/proc/log_filter_raw(text, list/data)
logger.Log(LOG_CATEGORY_FILTER, text, data)

/// Logging for job slot changes
/proc/log_job_debug(text, list/data)
logger.Log(LOG_CATEGORY_DEBUG_JOB, text, data)

// #ifndef DISABLE_DREAMLUAU
// /// Logging for lua scripting
// /proc/log_lua(text, list/data)
Expand Down
Loading
Loading