1
0
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:
NoobishSVK
2024-11-03 21:27:02 +01:00
parent fa1c193544
commit 84bbf692d3

View File

@@ -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) {