Optimizes IP Address Storage in DB (#25751)

* Initial commit

* comment fix

* Updates new columns position in table

* Updates insert statement for connection_log

* 57 to 58 - Handles changes post merge conflict
This commit is contained in:
Matt
2024-07-14 12:44:35 +00:00
committed by GitHub
parent a7ad650e22
commit 61e89af131
5 changed files with 22 additions and 5 deletions
+1 -1
View File
@@ -420,7 +420,7 @@
#define INVESTIGATE_HOTMIC "hotmic"
// The SQL version required by this version of the code
#define SQL_VERSION 57
#define SQL_VERSION 58
// Vending machine stuff
#define CAT_NORMAL (1<<0)
+2 -2
View File
@@ -1921,9 +1921,9 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
/proc/log_connection(ckey, ip, cid, connection_type)
ASSERT(connection_type in list(CONNECTION_TYPE_ESTABLISHED, CONNECTION_TYPE_DROPPED_IPINTEL, CONNECTION_TYPE_DROPPED_BANNED, CONNECTION_TYPE_DROPPED_INVALID))
var/datum/db_query/query_accesslog = SSdbcore.NewQuery("INSERT INTO connection_log (`datetime`, `ckey`, `ip`, `computerid`, `result`, `server_id`) VALUES(Now(), :ckey, :ip, :cid, :result, :server_id)", list(
var/datum/db_query/query_accesslog = SSdbcore.NewQuery("INSERT INTO connection_log (`datetime`, `ckey`, `ip`, `computerid`, `result`, `server_id`) VALUES(Now(), :ckey, INET_ATON(:ip), :cid, :result, :server_id)", list(
"ckey" = ckey,
"ip" = "[ip ? ip : ""]", // This is important. NULL is not the same as "", and if you directly open the `.dmb` file, you get a NULL IP.
"ip" = "[ip ? ip : "127.0.0.1"]",
"cid" = cid,
"result" = connection_type,
"server_id" = GLOB.configuration.system.instance_id