added discord integration and updated create table script

This commit is contained in:
jenz
2023-02-03 11:38:47 +01:00
parent 532c3212ce
commit 2d3ef46f86
3 changed files with 69 additions and 25 deletions
+23 -7
View File
@@ -1,9 +1,25 @@
CREATE TABLE ban_detector (
CREATE TABLE `ban_detector` (
`fingerprint` varchar(512) NOT NULL,
`ip` varchar(64) NOT NULL,
`steamid` varchar(64),
`name` varchar(128),
`logged_message` boolean default false,
`created_on` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`fingerprint`, `ip`)
)
`steamid` varchar(64) DEFAULT NULL,
`name` varchar(128) DEFAULT NULL,
`created_on` datetime DEFAULT CURRENT_TIMESTAMP
PRIMARY KEY (`fingerprint`,`ip`)
);
--usefull read query
select bd2.* from ban_detector bd2
inner join
(
SELECT fingerprint,
count(*) AS c
FROM ban_detector bd
GROUP BY fingerprint
HAVING c > 1
ORDER BY c DESC
) as t
on bd2.fingerprint = t.fingerprint