bugfixes, accessibility settings

This commit is contained in:
NoobishSVK
2024-05-20 21:45:09 +02:00
parent 42c528a480
commit 2314ba5d2a
14 changed files with 110 additions and 87 deletions
+5 -1
View File
@@ -259,7 +259,7 @@ wss.on('connection', (ws, request) => {
logInfo(`Web client \x1b[32mconnected\x1b[0m (${clientIp}) \x1b[90m[${currentUsers}]\x1b[0m`);
} else {
const userLocation = `${locationInfo.city}, ${locationInfo.region}, ${locationInfo.country}`;
const userData = { ip: clientIp, location: userLocation, time: connectionTime };
const userData = { ip: clientIp, location: userLocation, time: connectionTime, instance: ws };
storage.connectedUsers.push(userData);
logInfo(`Web client \x1b[32mconnected\x1b[0m (${clientIp}) \x1b[90m[${currentUsers}]\x1b[0m Location: ${locationInfo.city}, ${locationInfo.region}, ${locationInfo.country}`);
}
@@ -338,6 +338,10 @@ wss.on('connection', (ws, request) => {
storage.connectedUsers.splice(index, 1); // Remove the user's data from storage.connectedUsers array
}
if(currentUsers === 0) {
storage.connectedUsers = [];
}
if (currentUsers === 0 && serverConfig.enableDefaultFreq === true && serverConfig.autoShutdown !== true && serverConfig.xdrd.wirelessConnection === true) {
setTimeout(function() {
if(currentUsers === 0) {