diff --git a/SQL/database_changelog.md b/SQL/database_changelog.md
index d86d1bc5ca3..94f2a2b8f75 100644
--- a/SQL/database_changelog.md
+++ b/SQL/database_changelog.md
@@ -2,18 +2,26 @@ 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 5.32 (for bubberstation) (5.28 for /tg/); The query to update the schema revision table is:
+The latest database version is 5.33 (for bubberstation) (5.30 for /tg/); The query to update the schema revision table is:
```sql
-INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 32);
+INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 33);
```
or
```sql
-INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 32);
+INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 33);
```
In any query remember to add a prefix to the table names if you use one.
-----------------------------------------------------
+Version 5.30, 1 May 2025, by Rengan
+Adds `crime_desc` field to the `citation` table to save the description of the crime.
+
+```sql
+ALTER TABLE `citation`
+ADD COLUMN `crime_desc` TEXT NULL DEFAULT NULL AFTER `crime`;
+```
+-----------------------------------------------------
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)
diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql
index 7abf0f46998..8dc6ac513cc 100644
--- a/SQL/tgstation_schema.sql
+++ b/SQL/tgstation_schema.sql
@@ -118,6 +118,7 @@ CREATE TABLE IF NOT EXISTS `citation` (
`sender_ic` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`recipient` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`crime` text NOT NULL,
+ `crime_desc` text NULL DEFAULT NULL,
`fine` int(4) DEFAULT NULL,
`paid` int(4) DEFAULT 0,
`timestamp` datetime NOT NULL,
diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql
index 6a2b04eb8e3..5fe174b893d 100644
--- a/SQL/tgstation_schema_prefixed.sql
+++ b/SQL/tgstation_schema_prefixed.sql
@@ -117,6 +117,7 @@ CREATE TABLE IF NOT EXISTS `SS13_citation` (
`sender_ic` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`recipient` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`crime` text NOT NULL,
+ `crime_desc` text NULL DEFAULT NULL,
`fine` int(4) DEFAULT NULL,
`paid` int(4) DEFAULT 0,
`timestamp` datetime NOT NULL,
diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm
index df450ab43a2..b0888682cd5 100644
--- a/code/__DEFINES/subsystems.dm
+++ b/code/__DEFINES/subsystems.dm
@@ -20,7 +20,7 @@
*
* make sure you add an update to the schema_version stable in the db changelog
*/
-#define DB_MINOR_VERSION 32 // BUBBER EDIT
+#define DB_MINOR_VERSION 33 // BUBBER EDIT
//! ## Timing subsystem
diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm
index 4f08ecc16b9..008b6076e23 100644
--- a/code/controllers/subsystem/blackbox.dm
+++ b/code/controllers/subsystem/blackbox.dm
@@ -376,7 +376,10 @@ Versioning
query_report_death.Execute(async = TRUE)
qdel(query_report_death)
-/datum/controller/subsystem/blackbox/proc/ReportCitation(citation, sender, sender_ic, recipient, message, fine = 0, paid = 0)
+/datum/controller/subsystem/blackbox/proc/ReportCitation(citation, sender, sender_ic, recipient, message, description, fine = 0, paid = 0)
+ var/action = "Citation Created"
+ if(!fine)
+ action = "Crime Created"
var/datum/db_query/query_report_citation = SSdbcore.NewQuery({"INSERT INTO [format_table_name("citation")]
(server_ip,
server_port,
@@ -387,6 +390,7 @@ Versioning
sender_ic,
recipient,
crime,
+ crime_desc,
fine,
paid,
timestamp) VALUES (
@@ -399,20 +403,24 @@ Versioning
:sender_ic,
:recipient,
:message,
+ :desc,
:fine,
:paid,
NOW()
) ON DUPLICATE KEY UPDATE
- paid = paid + VALUES(paid)"}, list(
+ paid = paid + VALUES(paid),
+ crime = IF(VALUES(crime) IS NOT NULL, VALUES(crime), crime),
+ crime_desc = IF(VALUES(crime_desc) IS NOT NULL, VALUES(crime_desc), crime_desc)"}, list(
"server_ip" = world.internet_address || "0",
"port" = "[world.port]",
"round_id" = GLOB.round_id,
"citation" = citation,
- "action" = "Citation Created",
+ "action" = action,
"sender" = sender,
"sender_ic" = sender_ic,
"recipient" = recipient,
"message" = message,
+ "desc" = description,
"fine" = fine,
"paid" = paid,
))
diff --git a/code/game/machinery/computer/records/security.dm b/code/game/machinery/computer/records/security.dm
index 9816e912020..17a46e34576 100644
--- a/code/game/machinery/computer/records/security.dm
+++ b/code/game/machinery/computer/records/security.dm
@@ -227,6 +227,7 @@
var/datum/crime/new_crime = new(name = input_name, details = input_details, author = usr)
target.crimes += new_crime
investigate_log("New Crime: [input_name] | Added to [target.name] by [key_name(user)]. Their previous status was [target.wanted_status]", INVESTIGATE_RECORDS)
+ SSblackbox.ReportCitation(REF(new_crime), user.ckey, user.real_name, target.name, input_name, input_details)
target.wanted_status = WANTED_ARREST
update_matching_security_huds(target.name)
@@ -238,7 +239,7 @@
target.citations += new_citation
new_citation.alert_owner(user, src, target.name, "You have been issued a [params["fine"]]cr citation for [input_name]. Fines are payable at Security.")
investigate_log("New Citation: [input_name] Fine: [params["fine"]] | Added to [target.name] by [key_name(user)]", INVESTIGATE_RECORDS)
- SSblackbox.ReportCitation(REF(new_citation), user.ckey, user.real_name, target.name, input_name, params["fine"])
+ SSblackbox.ReportCitation(REF(new_citation), user.ckey, user.real_name, target.name, input_name, input_details, params["fine"])
return TRUE
@@ -256,12 +257,14 @@
var/new_name = strip_html_full(params["name"], MAX_CRIME_NAME_LEN)
investigate_log("[user] edited crime: \"[editing_crime.name]\" for target: \"[target.name]\", changing the name to: \"[new_name]\".", INVESTIGATE_RECORDS)
editing_crime.name = new_name
+ SSblackbox.ReportCitation(REF(editing_crime), message = new_name)
return TRUE
if(params["description"] && length(params["description"]) > 2 && params["name"] != editing_crime.name)
var/new_details = strip_html_full(params["description"], MAX_MESSAGE_LEN)
investigate_log("[user] edited crime \"[editing_crime.name]\" for target: \"[target.name]\", changing the details to: \"[new_details]\" from: \"[editing_crime.details]\".", INVESTIGATE_RECORDS)
editing_crime.details = new_details
+ SSblackbox.ReportCitation(REF(editing_crime), description = new_details)
return TRUE
return FALSE
diff --git a/code/game/machinery/computer/warrant.dm b/code/game/machinery/computer/warrant.dm
index 71455fc5a2e..7e66c748917 100644
--- a/code/game/machinery/computer/warrant.dm
+++ b/code/game/machinery/computer/warrant.dm
@@ -128,6 +128,7 @@
var/datum/bank_account/sec_account = SSeconomy.get_dep_account(ACCOUNT_SEC)
sec_account.adjust_money(amount)
+ SSblackbox.ReportCitation(REF(warrant), paid = warrant.paid)
if(warrant.fine != 0 || target.name == user)
return TRUE
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index dd8e03e6eba..459bd070fa5 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -355,8 +355,7 @@
target_record.citations += new_citation
new_citation.alert_owner(usr, src, target_record.name, "You have been fined [fine] credits for '[citation_name]'. Fines may be paid at security.")
investigate_log("New Citation: [citation_name] Fine: [fine] | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS)
- SSblackbox.ReportCitation(REF(new_citation), human_user.ckey, human_user.real_name, target_record.name, citation_name, fine)
- return
+ SSblackbox.ReportCitation(REF(new_citation), human_user.ckey, human_user.real_name, target_record.name, citation_name, null, fine)
//SKYRAT EDIT ADDITION BEGIN - EXAMINE RECORDS
if(href_list["genrecords"])
@@ -383,6 +382,7 @@
target_record.crimes += new_crime
investigate_log("New Crime: [crime_name] | Added to [target_record.name] by [key_name(human_user)]", INVESTIGATE_RECORDS)
+ SSblackbox.ReportCitation(REF(new_crime), human_user.ckey, human_user.real_name, target_record.name, crime_name, null)
to_chat(human_user, span_notice("Successfully added a crime."))
return