mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-25 13:07:46 +01:00
fixes connection logging to DB not working
This commit is contained in:
@@ -579,4 +579,18 @@ CREATE TABLE `playtime_history` (
|
||||
`time_living` SMALLINT NOT NULL,
|
||||
`time_ghost` SMALLINT NOT NULL,
|
||||
PRIMARY KEY (`ckey`, `date`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
|
||||
--
|
||||
-- Table structure for table `connection_log`
|
||||
--
|
||||
DROP TABLE IF EXISTS `connection_log`;
|
||||
CREATE TABLE `connection_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`datetime` datetime NOT NULL,
|
||||
`ckey` varchar(32) NOT NULL,
|
||||
`ip` varchar(32) NOT NULL,
|
||||
`computerid` varchar(32) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
@@ -577,4 +577,17 @@ CREATE TABLE `SS13_playtime_history` (
|
||||
`time_living` SMALLINT NOT NULL,
|
||||
`time_ghost` SMALLINT NOT NULL,
|
||||
PRIMARY KEY (`ckey`, `date`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
--
|
||||
-- Table structure for table `SS13_connection_log`
|
||||
--
|
||||
DROP TABLE IF EXISTS `SS13_connection_log`;
|
||||
CREATE TABLE `SS13_connection_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`datetime` datetime NOT NULL,
|
||||
`ckey` varchar(32) NOT NULL,
|
||||
`ip` varchar(32) NOT NULL,
|
||||
`computerid` varchar(32) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
@@ -9,3 +9,13 @@ CREATE TABLE `playtime_history` (
|
||||
PRIMARY KEY (`ckey`, `date`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
# Add the 'connection_log' table, which is used to log all connections to the server
|
||||
DROP TABLE IF EXISTS `connection_log`;
|
||||
CREATE TABLE `connection_log` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`datetime` datetime NOT NULL,
|
||||
`ckey` varchar(32) NOT NULL,
|
||||
`ip` varchar(32) NOT NULL,
|
||||
`computerid` varchar(32) NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
|
||||
@@ -560,9 +560,8 @@
|
||||
log_game("SQL ERROR during log_client_to_db (insert). Error : \[[err]\]\n")
|
||||
message_admins("SQL ERROR during log_client_to_db (insert). Error : \[[err]\]\n")
|
||||
|
||||
//Logging player access
|
||||
var/serverip = "[world.internet_address]:[world.port]"
|
||||
var/DBQuery/query_accesslog = dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]`(`id`,`datetime`,`serverip`,`ckey`,`ip`,`computerid`) VALUES(null,Now(),'[serverip]','[ckey]','[sql_ip]','[sql_computerid]');")
|
||||
// Log player connections to DB
|
||||
var/DBQuery/query_accesslog = dbcon.NewQuery("INSERT INTO `[format_table_name("connection_log")]`(`datetime`,`ckey`,`ip`,`computerid`) VALUES(Now(),'[ckey]','[sql_ip]','[sql_computerid]');")
|
||||
query_accesslog.Execute()
|
||||
|
||||
/client/proc/check_ip_intel()
|
||||
|
||||
Reference in New Issue
Block a user