diff --git a/SQL/database_changelog.txt.rej b/SQL/database_changelog.txt.rej index 1b201ec4aa..41fdcf49c3 100644 --- a/SQL/database_changelog.txt.rej +++ b/SQL/database_changelog.txt.rej @@ -1,15 +1,36 @@ diff a/SQL/database_changelog.txt b/SQL/database_changelog.txt (rejected hunks) -@@ -1,10 +1,10 @@ +@@ -1,26 +1,20 @@ 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 3.1; The query to update the schema revision table is: -+The latest database version is 3.0; 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: ++The latest database version is 3.1; The query to update the schema revision table is: --UPDATE `schema_revision` SET major = 3, minor = 1 LIMIT 1; -+INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 0); +-INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 2); ++INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 1); or --UPDATE `SS13_schema_revision` SET major = 3, minor = 1 LIMIT 1; -+INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 0); +-INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 2); ++INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 1); + + ---------------------------------------------------- + +-18 August 2017, by nfreader, bump to 3.2 ++18 August 2017, by Cyberboss and nfreader, bump to 3.1 + +-Modified table 'death', adding the column 'suicide'. ++Modified table 'death', adding the columns `last_words` and 'suicide'. + +-ALTER TABLE `death` ADD COLUMN `suicide` tinyint(0) NOT NULL DEFAULT '0' AFTER `last_words` +- +----------------------------------------------------- +- +-16 August 2017, by Cyberboss, bump to 3.1 +- +-Modified table 'death', adding the column 'last_words'. +- +-ALTER TABLE `death` ADD COLUMN `last_words` varchar(255) DEFAULT NULL AFTER `staminaloss` ++ALTER TABLE `death` ++ADD COLUMN `last_words` varchar(255) DEFAULT NULL AFTER `staminaloss`, ++ADD COLUMN `suicide` tinyint(0) NOT NULL DEFAULT '0' AFTER `last_words`; ---------------------------------------------------- diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 4c76e1f275..8159b3d9c1 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -151,6 +151,8 @@ CREATE TABLE `death` ( `toxloss` smallint(5) unsigned NOT NULL, `cloneloss` smallint(5) unsigned NOT NULL, `staminaloss` smallint(5) unsigned NOT NULL, + `last_words` varchar(255) DEFAULT NULL, + `suicide` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql index f717bf96ad..92db271b2c 100644 --- a/SQL/tgstation_schema_prefixed.sql +++ b/SQL/tgstation_schema_prefixed.sql @@ -148,6 +148,8 @@ CREATE TABLE `SS13_death` ( `toxloss` smallint(5) unsigned NOT NULL, `cloneloss` smallint(5) unsigned NOT NULL, `staminaloss` smallint(5) unsigned NOT NULL, + `last_words` varchar(255) DEFAULT NULL, + `suicide` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; /*!40101 SET character_set_client = @saved_cs_client */; diff --git a/code/_compile_options.dm b/code/_compile_options.dm index a669f1b4f5..fe66b9bf69 100644 --- a/code/_compile_options.dm +++ b/code/_compile_options.dm @@ -72,4 +72,4 @@ //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 3 -#define DB_MINOR_VERSION 0 +#define DB_MINOR_VERSION 1 diff --git a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm index 3344afcaaa..11eb703a8a 100644 --- a/code/controllers/subsystem/blackbox.dm +++ b/code/controllers/subsystem/blackbox.dm @@ -198,8 +198,10 @@ SUBSYSTEM_DEF(blackbox) var/x_coord = sanitizeSQL(L.x) var/y_coord = sanitizeSQL(L.y) var/z_coord = sanitizeSQL(L.z) + var/last_words = sanitizeSQL(L.last_words) + var/suicide = sanitizeSQL(L.suiciding) var/map = sanitizeSQL(SSmapping.config.map_name) - var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina])") + var/datum/DBQuery/query_report_death = SSdbcore.NewQuery("INSERT INTO [format_table_name("death")] (pod, x_coord, y_coord, z_coord, mapname, server_ip, server_port, round_id, tod, job, special, name, byondkey, laname, lakey, bruteloss, fireloss, brainloss, oxyloss, toxloss, cloneloss, staminaloss, last_words) VALUES ('[sqlpod]', '[x_coord]', '[y_coord]', '[z_coord]', '[map]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', [GLOB.round_id], '[SQLtime()]', '[sqljob]', '[sqlspecial]', '[sqlname]', '[sqlkey]', '[laname]', '[lakey]', [sqlbrute], [sqlfire], [sqlbrain], [sqloxy], [sqltox], [sqlclone], [sqlstamina], [last_words], [suicide])") query_report_death.Execute() /datum/controller/subsystem/blackbox/proc/Seal() diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm index 6cb3a8daa9..f32ca97b09 100644 --- a/code/modules/mob/living/living_defines.dm +++ b/code/modules/mob/living/living_defines.dm @@ -75,3 +75,5 @@ var/datum/riding/riding_datum var/datum/language/selected_default_language + + var/last_words //used for database logging diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 68e2b150f3..cf1b95b98d 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -155,6 +155,7 @@ GLOBAL_LIST_INIT(department_radio_keys, list( var/message_len = length(message) message = copytext(message, 1, health_diff) + "[message_len > health_diff ? "-.." : "..."]" message = Ellipsis(message, 10, 1) + last_words = message message_mode = MODE_WHISPER_CRIT succumbed = TRUE else