From 3ce2631c1c1292c73a5807161920573d666bb304 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Farka=C5=A1?= Date: Sun, 8 Dec 2024 22:10:00 +0100 Subject: [PATCH] Update index.js bw protection --- server/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/index.js b/server/index.js index 72d525e..11a7ffb 100644 --- a/server/index.js +++ b/server/index.js @@ -479,7 +479,8 @@ wss.on('connection', (ws, request) => { const command = antispamProtection(message, clientIp, ws, userCommands, lastWarn, userCommandHistory, '18', 'text'); // Existing command processing logic - if ((command.startsWith('X') || command.startsWith('Y')) && !request.session.isAdminAuthenticated) { + if (((command.startsWith('X') || command.startsWith('Y')) && !request.session.isAdminAuthenticated) || + ((command.startsWith('F') || command.startsWith('W')) && serverConfig.bwSwitch == "false")) { logWarn(`User \x1b[90m${clientIp}\x1b[0m attempted to send a potentially dangerous command. You may consider blocking this user.`); return; }