From 29653b3e4f2970bdc0de5fb4ab04800cca4d3139 Mon Sep 17 00:00:00 2001 From: Luke Berndt Date: Sun, 22 Feb 2026 16:16:44 -0500 Subject: [PATCH] Update index.js --- backend/index.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/backend/index.js b/backend/index.js index 666a0c6..c22c0fa 100644 --- a/backend/index.js +++ b/backend/index.js @@ -274,6 +274,13 @@ io.sockets.on('connection', function (client) { clients[client.id].timestamp = new Date(); client.on('start', async function (data) { if (typeof clients[client.id] !== "undefined") { + if ((data.filterType != "firehose") && (!data.shortName || (typeof data.shortName != "string"))) { // If it is not firehose, then it must have a shortName + console.error("Error - Socket - Invalid ShortName: " + data.shortName + " ClientID: " + client.id + " IP: " + ipAddress); + delete clients[client.id]; + return; + } + + clients[client.id].active = true; clients[client.id].shortName = data.shortName.toLowerCase(); clients[client.id].filterCode = String(data.filterCode); @@ -298,13 +305,6 @@ io.sockets.on('connection', function (client) { return; } - if ((data.filterType != "firehose") && (!data.shortName || (typeof data.shortName != "string"))) { // If it is not firehose, then it must have a shortName - console.error("Error - Socket - Invalid ShortName: " + data.shortName + " ClientID: " + client.id + " IP: " + ipAddress); - delete clients[client.id]; - return; - } - - // Check if the filterType is firehose and the filterCode is the firehose key if (data.filterType == "firehose") { if (firehose_key && (typeof data.filterCode == "string") && (data.filterCode == firehose_key)) {