You've already forked fm-dx-webserver
mirror of
https://github.com/KubaPro010/fm-dx-webserver.git
synced 2026-02-26 22:13:53 +01:00
filter adjust
This commit is contained in:
@@ -422,7 +422,7 @@ wss.on('connection', (ws, request) => {
|
|||||||
userCommandHistory[clientIp].push(now);
|
userCommandHistory[clientIp].push(now);
|
||||||
|
|
||||||
// Remove timestamps older than 10 ms from the history
|
// Remove timestamps older than 10 ms from the history
|
||||||
userCommandHistory[clientIp] = userCommandHistory[clientIp].filter(timestamp => now - timestamp <= 10);
|
userCommandHistory[clientIp] = userCommandHistory[clientIp].filter(timestamp => now - timestamp <= 20);
|
||||||
|
|
||||||
// Check if there are 3 or more commands in the last 10 ms
|
// Check if there are 3 or more commands in the last 10 ms
|
||||||
if (userCommandHistory[clientIp].length >= 5) {
|
if (userCommandHistory[clientIp].length >= 5) {
|
||||||
|
|||||||
Reference in New Issue
Block a user