Update index.js

This commit is contained in:
Luke Berndt
2026-02-22 16:16:44 -05:00
parent e4cd8072d9
commit 29653b3e4f

View File

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