Skip to content

Commit 1709bca

Browse files
authored
Log BYOND version and build in connection_log table (#5924)
## About The Pull Request See title. ## Why It's Good For The Game Statistics
1 parent 86beca1 commit 1709bca

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

SQL/database_changelog.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,26 @@ Any time you make a change to the schema files, remember to increment the databa
22

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

5-
The latest database version is 5.26; The query to update the schema revision table is:
5+
The latest database version is 5.27; The query to update the schema revision table is:
66

77
```sql
8-
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 26);
8+
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 27);
99
```
1010
or
1111

1212
```sql
13-
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 26);
13+
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 27);
1414
```
1515

1616
In any query remember to add a prefix to the table names if you use one.
1717

18+
-----------------------------------------------------
19+
Version 5.27 16 March 2025, by Flleeppyy
20+
Add `byond_build` and `byond_version` to the `connection_log` table.
21+
22+
```sql
23+
ALTER TABLE `connection_log` ADD COLUMN `byond_version` varchar(8) DEFAULT NULL, ADD COLUMN `byond_build` varchar(255) DEFAULT NULL;
24+
```
1825
-----------------------------------------------------
1926
Version 5.26, 20 September 2024, by Absolucy
2027
Properly added the previously undocumented `metric_data`, `subsystem_metrics`, `subsystem_extra_metrics`, `overwatch_whitelist`, and `overwatch_asn_ban` tables.

SQL/tgstation_schema.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ CREATE TABLE `connection_log` (
135135
`datetime` datetime DEFAULT NULL,
136136
`server_ip` int(10) unsigned NOT NULL,
137137
`server_port` smallint(5) unsigned NOT NULL,
138-
`round_id` int(11) unsigned NULL,
138+
`round_id` int(11) unsigned DEFAULT NULL,
139139
`ckey` varchar(45) DEFAULT NULL,
140140
`ip` int(10) unsigned NOT NULL,
141141
`computerid` varchar(45) DEFAULT NULL,
142+
`byond_version` varchar(8) DEFAULT NULL,
143+
`byond_build` varchar(255) DEFAULT NULL,
142144
PRIMARY KEY (`id`)
143145
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
144146
/*!40101 SET character_set_client = @saved_cs_client */;

code/__DEFINES/subsystems.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* make sure you add an update to the schema_version stable in the db changelog
2222
*/
23-
#define DB_MINOR_VERSION 26 // monkestation edit: we've added plenty of our own tables to the db
23+
#define DB_MINOR_VERSION 27 // monkestation edit: we've added plenty of our own tables to the db
2424

2525

2626
//! ## Timing subsystem

code/modules/client/client_procs.dm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
547547
if(!tooltips)
548548
tooltips = new /datum/tooltip(src)
549549

550-
if(((player_age != -1) && player_age < CONFIG_GET(number/minimum_age)) && !(ckey in GLOB.interviews.approved_ckeys))
550+
if(((player_age != -1) && player_age < CONFIG_GET(number/minimum_age)) && !(ckey in GLOB.interviews.approved_ckeys) && !(is_mentor()) && !(is_admin(src)))
551551
interviewee = TRUE
552552
register_for_interview()
553553

@@ -774,9 +774,9 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
774774
/client/proc/log_client_to_db_connection_log()
775775
if(!SSdbcore.shutting_down)
776776
SSdbcore.FireAndForget({"
777-
INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`round_id`,`ckey`,`ip`,`computerid`)
778-
VALUES(null,Now(),INET_ATON(:internet_address),:port,:round_id,:ckey,INET_ATON(:ip),:computerid)
779-
"}, list("internet_address" = world.internet_address || "0", "port" = world.port, "round_id" = GLOB.round_id, "ckey" = ckey, "ip" = address, "computerid" = computer_id))
777+
INSERT INTO `[format_table_name("connection_log")]` (`id`,`datetime`,`server_ip`,`server_port`,`round_id`,`ckey`,`ip`,`computerid`,`byond_version`,`byond_build`)
778+
VALUES(null,Now(),INET_ATON(:internet_address),:port,:round_id,:ckey,INET_ATON(:ip),:computerid,:byond_version,:byond_build)
779+
"}, list("internet_address" = world.internet_address || "0", "port" = world.port, "round_id" = GLOB.round_id, "ckey" = ckey, "ip" = address, "computerid" = computer_id, "byond_version" = byond_version, "byond_build" = byond_build))
780780

781781
/client/proc/findJoinDate()
782782
var/list/http = world.Export("http://byond.com/members/[ckey]?format=text")
@@ -958,7 +958,7 @@ GLOBAL_LIST_INIT(blacklisted_builds, list(
958958
string += ", "
959959
string += "Mobile Hostspot IP"
960960

961-
if(failed && !(ckey in GLOB.interviews.approved_ckeys))
961+
if(failed && !(ckey in GLOB.interviews.approved_ckeys) && !(is_mentor()) && !(is_admin(src)))
962962
message_admins(span_adminnotice("Proxy Detection: [key_name_admin(src)] Overwatch detected this is a [string]"))
963963
interviewee = TRUE
964964

0 commit comments

Comments
 (0)