mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-10 09:54:52 +00:00
Adds more round id tracking
This commit is contained in:
@@ -1,15 +1,29 @@
|
|||||||
diff a/SQL/database_changelog.txt b/SQL/database_changelog.txt (rejected hunks)
|
diff a/SQL/database_changelog.txt b/SQL/database_changelog.txt (rejected hunks)
|
||||||
@@ -1,10 +1,10 @@
|
@@ -1,10 +1,24 @@
|
||||||
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.
|
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.2; 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.3; 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, 2);
|
||||||
+INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 0);
|
+INSERT INTO `schema_revision` (`major`, `minor`) VALUES (3, 3);
|
||||||
or
|
or
|
||||||
-UPDATE `SS13_schema_revision` SET major = 3, minor = 1 LIMIT 1;
|
-INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 2);
|
||||||
+INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 0);
|
+INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (3, 3);
|
||||||
|
+
|
||||||
|
+----------------------------------------------------
|
||||||
|
+In any query remember to add a prefix to the table names if you use one.
|
||||||
|
+----------------------------------------------------
|
||||||
|
+
|
||||||
|
+25 August 2017, by Jordie0608
|
||||||
|
+
|
||||||
|
+Modified tables 'connection_log', 'legacy_population', 'library', 'messages' and 'player' to add additional 'round_id' tracking in various forms and 'server_ip' and 'server_port' to the table 'messages'.
|
||||||
|
+
|
||||||
|
+ALTER TABLE `connection_log` ADD COLUMN `round_id` INT(11) UNSIGNED NOT NULL AFTER `server_port`;
|
||||||
|
+ALTER TABLE `legacy_population` ADD COLUMN `round_id` INT(11) UNSIGNED NOT NULL AFTER `server_port`;
|
||||||
|
+ALTER TABLE `library` ADD COLUMN `round_id_created` INT(11) UNSIGNED NOT NULL AFTER `deleted`;
|
||||||
|
+ALTER TABLE `messages` ADD COLUMN `server_ip` INT(10) UNSIGNED NOT NULL AFTER `server`, ADD COLUMN `server_port` SMALLINT(5) UNSIGNED NOT NULL AFTER `server_ip`, ADD COLUMN `round_id` INT(11) UNSIGNED NOT NULL AFTER `server_port`;
|
||||||
|
+ALTER TABLE `player` ADD COLUMN `firstseen_round_id` INT(11) UNSIGNED NOT NULL AFTER `firstseen`, ADD COLUMN `lastseen_round_id` INT(11) UNSIGNED NOT NULL AFTER `lastseen`;
|
||||||
|
|
||||||
----------------------------------------------------
|
----------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ CREATE TABLE `connection_log` (
|
|||||||
`datetime` datetime DEFAULT NULL,
|
`datetime` datetime DEFAULT NULL,
|
||||||
`server_ip` int(10) unsigned NOT NULL,
|
`server_ip` int(10) unsigned NOT NULL,
|
||||||
`server_port` smallint(5) unsigned NOT NULL,
|
`server_port` smallint(5) unsigned NOT NULL,
|
||||||
|
`round_id` int(11) unsigned NOT NULL,
|
||||||
`ckey` varchar(45) DEFAULT NULL,
|
`ckey` varchar(45) DEFAULT NULL,
|
||||||
`ip` int(10) unsigned NOT NULL,
|
`ip` int(10) unsigned NOT NULL,
|
||||||
`computerid` varchar(45) DEFAULT NULL,
|
`computerid` varchar(45) DEFAULT NULL,
|
||||||
@@ -204,6 +205,7 @@ CREATE TABLE `legacy_population` (
|
|||||||
`time` datetime NOT NULL,
|
`time` datetime NOT NULL,
|
||||||
`server_ip` int(10) unsigned NOT NULL,
|
`server_ip` int(10) unsigned NOT NULL,
|
||||||
`server_port` smallint(5) unsigned NOT NULL,
|
`server_port` smallint(5) unsigned NOT NULL,
|
||||||
|
`round_id` int(11) unsigned NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
@@ -224,6 +226,7 @@ CREATE TABLE `library` (
|
|||||||
`ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
|
`ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
|
||||||
`datetime` datetime NOT NULL,
|
`datetime` datetime NOT NULL,
|
||||||
`deleted` tinyint(1) unsigned DEFAULT NULL,
|
`deleted` tinyint(1) unsigned DEFAULT NULL,
|
||||||
|
`round_id_created` int(11) unsigned NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `deleted_idx` (`deleted`),
|
KEY `deleted_idx` (`deleted`),
|
||||||
KEY `idx_lib_id_del` (`id`,`deleted`),
|
KEY `idx_lib_id_del` (`id`,`deleted`),
|
||||||
@@ -247,6 +250,9 @@ CREATE TABLE `messages` (
|
|||||||
`text` varchar(2048) NOT NULL,
|
`text` varchar(2048) NOT NULL,
|
||||||
`timestamp` datetime NOT NULL,
|
`timestamp` datetime NOT NULL,
|
||||||
`server` varchar(32) DEFAULT NULL,
|
`server` varchar(32) DEFAULT NULL,
|
||||||
|
`server_ip` int(10) unsigned NOT NULL,
|
||||||
|
`server_port` smallint(5) unsigned NOT NULL,
|
||||||
|
`round_id` int(11) unsigned NOT NULL,
|
||||||
`secret` tinyint(1) unsigned NOT NULL,
|
`secret` tinyint(1) unsigned NOT NULL,
|
||||||
`lasteditor` varchar(32) DEFAULT NULL,
|
`lasteditor` varchar(32) DEFAULT NULL,
|
||||||
`edits` text,
|
`edits` text,
|
||||||
@@ -267,7 +273,9 @@ DROP TABLE IF EXISTS `player`;
|
|||||||
CREATE TABLE `player` (
|
CREATE TABLE `player` (
|
||||||
`ckey` varchar(32) NOT NULL,
|
`ckey` varchar(32) NOT NULL,
|
||||||
`firstseen` datetime NOT NULL,
|
`firstseen` datetime NOT NULL,
|
||||||
|
`firstseen_round_id` int(11) unsigned NOT NULL,
|
||||||
`lastseen` datetime NOT NULL,
|
`lastseen` datetime NOT NULL,
|
||||||
|
`lastseen_round_id` int(11) unsigned NOT NULL,
|
||||||
`ip` int(10) unsigned NOT NULL,
|
`ip` int(10) unsigned NOT NULL,
|
||||||
`computerid` varchar(32) NOT NULL,
|
`computerid` varchar(32) NOT NULL,
|
||||||
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
|
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
|
||||||
|
|||||||
@@ -112,6 +112,7 @@ CREATE TABLE `SS13_connection_log` (
|
|||||||
`datetime` datetime DEFAULT NULL,
|
`datetime` datetime DEFAULT NULL,
|
||||||
`server_ip` int(10) unsigned NOT NULL,
|
`server_ip` int(10) unsigned NOT NULL,
|
||||||
`server_port` smallint(5) unsigned NOT NULL,
|
`server_port` smallint(5) unsigned NOT NULL,
|
||||||
|
`round_id` int(11) unsigned NOT NULL,
|
||||||
`ckey` varchar(45) DEFAULT NULL,
|
`ckey` varchar(45) DEFAULT NULL,
|
||||||
`ip` int(10) unsigned NOT NULL,
|
`ip` int(10) unsigned NOT NULL,
|
||||||
`computerid` varchar(45) DEFAULT NULL,
|
`computerid` varchar(45) DEFAULT NULL,
|
||||||
@@ -200,6 +201,7 @@ CREATE TABLE `SS13_legacy_population` (
|
|||||||
`time` datetime NOT NULL,
|
`time` datetime NOT NULL,
|
||||||
`server_ip` int(10) unsigned NOT NULL,
|
`server_ip` int(10) unsigned NOT NULL,
|
||||||
`server_port` smallint(5) unsigned NOT NULL,
|
`server_port` smallint(5) unsigned NOT NULL,
|
||||||
|
`round_id` int(11) unsigned NOT NULL,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||||
/*!40101 SET character_set_client = @saved_cs_client */;
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
||||||
@@ -220,6 +222,7 @@ CREATE TABLE `SS13_library` (
|
|||||||
`ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
|
`ckey` varchar(32) NOT NULL DEFAULT 'LEGACY',
|
||||||
`datetime` datetime NOT NULL,
|
`datetime` datetime NOT NULL,
|
||||||
`deleted` tinyint(1) unsigned DEFAULT NULL,
|
`deleted` tinyint(1) unsigned DEFAULT NULL,
|
||||||
|
`round_id_created` int(11) unsigned NOT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
KEY `deleted_idx` (`deleted`),
|
KEY `deleted_idx` (`deleted`),
|
||||||
KEY `idx_lib_id_del` (`id`,`deleted`),
|
KEY `idx_lib_id_del` (`id`,`deleted`),
|
||||||
@@ -243,6 +246,9 @@ CREATE TABLE `SS13_messages` (
|
|||||||
`text` varchar(2048) NOT NULL,
|
`text` varchar(2048) NOT NULL,
|
||||||
`timestamp` datetime NOT NULL,
|
`timestamp` datetime NOT NULL,
|
||||||
`server` varchar(32) DEFAULT NULL,
|
`server` varchar(32) DEFAULT NULL,
|
||||||
|
`server_ip` int(10) unsigned NOT NULL,
|
||||||
|
`server_port` smallint(5) unsigned NOT NULL,
|
||||||
|
`round_id` int(11) unsigned NOT NULL,
|
||||||
`secret` tinyint(1) unsigned NOT NULL,
|
`secret` tinyint(1) unsigned NOT NULL,
|
||||||
`lasteditor` varchar(32) DEFAULT NULL,
|
`lasteditor` varchar(32) DEFAULT NULL,
|
||||||
`edits` text,
|
`edits` text,
|
||||||
@@ -263,7 +269,9 @@ DROP TABLE IF EXISTS `SS13_player`;
|
|||||||
CREATE TABLE `SS13_player` (
|
CREATE TABLE `SS13_player` (
|
||||||
`ckey` varchar(32) NOT NULL,
|
`ckey` varchar(32) NOT NULL,
|
||||||
`firstseen` datetime NOT NULL,
|
`firstseen` datetime NOT NULL,
|
||||||
|
`firstseen_round_id` int(11) unsigned NOT NULL,
|
||||||
`lastseen` datetime NOT NULL,
|
`lastseen` datetime NOT NULL,
|
||||||
|
`lastseen_round_id` int(11) unsigned NOT NULL,
|
||||||
`ip` int(10) unsigned NOT NULL,
|
`ip` int(10) unsigned NOT NULL,
|
||||||
`computerid` varchar(32) NOT NULL,
|
`computerid` varchar(32) NOT NULL,
|
||||||
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
|
`lastadminrank` varchar(32) NOT NULL DEFAULT 'Player',
|
||||||
|
|||||||
11
code/_compile_options.dm.rej
Normal file
11
code/_compile_options.dm.rej
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
diff a/code/_compile_options.dm b/code/_compile_options.dm (rejected hunks)
|
||||||
|
@@ -69,7 +69,7 @@
|
||||||
|
#error You need version 511 or higher
|
||||||
|
#endif
|
||||||
|
|
||||||
|
-//Update this whenever the db schema changes
|
||||||
|
+//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 2
|
||||||
|
+#define DB_MINOR_VERSION 3
|
||||||
10
code/controllers/subsystem/blackbox.dm.rej
Normal file
10
code/controllers/subsystem/blackbox.dm.rej
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
diff a/code/controllers/subsystem/blackbox.dm b/code/controllers/subsystem/blackbox.dm (rejected hunks)
|
||||||
|
@@ -35,7 +35,7 @@ SUBSYSTEM_DEF(blackbox)
|
||||||
|
if(M.client)
|
||||||
|
playercount += 1
|
||||||
|
var/admincount = GLOB.admins.len
|
||||||
|
- var/datum/DBQuery/query_record_playercount = SSdbcore.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]')")
|
||||||
|
+ var/datum/DBQuery/query_record_playercount = SSdbcore.NewQuery("INSERT INTO [format_table_name("legacy_population")] (playercount, admincount, time, server_ip, server_port, round_id) VALUES ([playercount], [admincount], '[SQLtime()]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', '[GLOB.round_id]')")
|
||||||
|
query_record_playercount.Execute()
|
||||||
|
|
||||||
|
if(config.use_exp_tracking)
|
||||||
@@ -44,7 +44,7 @@
|
|||||||
secret = 0
|
secret = 0
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
var/datum/DBQuery/query_create_message = SSdbcore.NewQuery("INSERT INTO [format_table_name("messages")] (type, targetckey, adminckey, text, timestamp, server, secret) VALUES ('[type]', '[target_ckey]', '[admin_ckey]', '[text]', '[timestamp]', '[server]', '[secret]')")
|
var/datum/DBQuery/query_create_message = SSdbcore.NewQuery("INSERT INTO [format_table_name("messages")] (type, targetckey, adminckey, text, timestamp, server, server_ip, server_port, round_id, secret) VALUES ('[type]', '[target_ckey]', '[admin_ckey]', '[text]', '[timestamp]', '[server]', INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')), '[world.port]', '[GLOB.round_id]','[secret]')")
|
||||||
if(!query_create_message.warn_execute())
|
if(!query_create_message.warn_execute())
|
||||||
return
|
return
|
||||||
if(logged)
|
if(logged)
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ GLOBAL_LIST(external_rsc_urls)
|
|||||||
|
|
||||||
new_player = 1
|
new_player = 1
|
||||||
account_join_date = sanitizeSQL(findJoinDate())
|
account_join_date = sanitizeSQL(findJoinDate())
|
||||||
var/datum/DBQuery/query_add_player = SSdbcore.NewQuery("INSERT INTO [format_table_name("player")] (`ckey`, `firstseen`, `lastseen`, `ip`, `computerid`, `lastadminrank`, `accountjoindate`) VALUES ('[sql_ckey]', Now(), Now(), INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]', [account_join_date ? "'[account_join_date]'" : "NULL"])")
|
var/datum/DBQuery/query_add_player = SSdbcore.NewQuery("INSERT INTO [format_table_name("player")] (`ckey`, `firstseen`, `firstseen_round_id`, `lastseen`, `lastseen_round_id`, `ip`, `computerid`, `lastadminrank`, `accountjoindate`) VALUES ('[sql_ckey]', Now(), '[GLOB.round_id]', Now(), '[GLOB.round_id]', INET_ATON('[sql_ip]'), '[sql_computerid]', '[sql_admin_rank]', [account_join_date ? "'[account_join_date]'" : "NULL"])")
|
||||||
if(!query_add_player.Execute())
|
if(!query_add_player.Execute())
|
||||||
return
|
return
|
||||||
if(!account_join_date)
|
if(!account_join_date)
|
||||||
@@ -473,12 +473,12 @@ GLOBAL_LIST(external_rsc_urls)
|
|||||||
if(query_datediff.NextRow())
|
if(query_datediff.NextRow())
|
||||||
account_age = text2num(query_datediff.item[1])
|
account_age = text2num(query_datediff.item[1])
|
||||||
if(!new_player)
|
if(!new_player)
|
||||||
var/datum/DBQuery/query_log_player = SSdbcore.NewQuery("UPDATE [format_table_name("player")] SET lastseen = Now(), ip = INET_ATON('[sql_ip]'), computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]', accountjoindate = [account_join_date ? "'[account_join_date]'" : "NULL"] WHERE ckey = '[sql_ckey]'")
|
var/datum/DBQuery/query_log_player = SSdbcore.NewQuery("UPDATE [format_table_name("player")] SET lastseen = Now(), lastseen_round_id = '[GLOB.round_id]', ip = INET_ATON('[sql_ip]'), computerid = '[sql_computerid]', lastadminrank = '[sql_admin_rank]', accountjoindate = [account_join_date ? "'[account_join_date]'" : "NULL"] WHERE ckey = '[sql_ckey]'")
|
||||||
if(!query_log_player.Execute())
|
if(!query_log_player.Execute())
|
||||||
return
|
return
|
||||||
if(!account_join_date)
|
if(!account_join_date)
|
||||||
account_join_date = "Error"
|
account_join_date = "Error"
|
||||||
var/datum/DBQuery/query_log_connection = SSdbcore.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')),'[world.port]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')")
|
var/datum/DBQuery/query_log_connection = SSdbcore.NewQuery("INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`round_id`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),INET_ATON(IF('[world.internet_address]' LIKE '', '0', '[world.internet_address]')),'[world.port]','[GLOB.round_id]','[sql_ckey]',INET_ATON('[sql_ip]'),'[sql_computerid]')")
|
||||||
query_log_connection.Execute()
|
query_log_connection.Execute()
|
||||||
if(new_player)
|
if(new_player)
|
||||||
player_age = -1
|
player_age = -1
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
diff a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm (rejected hunks)
|
diff a/code/modules/client/client_procs.dm b/code/modules/client/client_procs.dm (rejected hunks)
|
||||||
@@ -73,7 +73,7 @@
|
@@ -353,7 +353,7 @@ GLOBAL_LIST(external_rsc_urls)
|
||||||
return
|
|
||||||
|
|
||||||
//Logs all hrefs, except chat pings
|
/client/Del()
|
||||||
- if(href_list["proc"] != "ping")
|
if(credits)
|
||||||
+ if(!(href_list["_src_"] == "chat" && href_list["proc"] == "ping" && LAZYLEN(href_list) == 2))
|
- QDEL_LIST(credits)
|
||||||
WRITE_FILE(GLOB.world_href_log, "<small>[time_stamp(show_ds = TRUE)] [src] (usr:[usr])</small> || [hsrc ? "[hsrc] " : ""][href]<br>")
|
+ QDEL_LIST(credits)
|
||||||
|
log_access("Logout: [key_name(src)]")
|
||||||
// Admin PM
|
if(holder)
|
||||||
|
adminGreet(1)
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ GLOBAL_LIST(cachedbooks) // List of our cached book datums
|
|||||||
var/sqlauthor = sanitizeSQL(scanner.cache.author)
|
var/sqlauthor = sanitizeSQL(scanner.cache.author)
|
||||||
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
|
var/sqlcontent = sanitizeSQL(scanner.cache.dat)
|
||||||
var/sqlcategory = sanitizeSQL(upload_category)
|
var/sqlcategory = sanitizeSQL(upload_category)
|
||||||
var/datum/DBQuery/query_library_upload = SSdbcore.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now())")
|
var/datum/DBQuery/query_library_upload = SSdbcore.NewQuery("INSERT INTO [format_table_name("library")] (author, title, content, category, ckey, datetime, round_id_created) VALUES ('[sqlauthor]', '[sqltitle]', '[sqlcontent]', '[sqlcategory]', '[usr.ckey]', Now(), '[GLOB.round_id]')")
|
||||||
if(!query_library_upload.Execute())
|
if(!query_library_upload.Execute())
|
||||||
alert("Database error encountered uploading to Archive")
|
alert("Database error encountered uploading to Archive")
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user