updated search of UC

This commit is contained in:
andrei-mihnea-cerbu
2025-02-04 20:52:12 +02:00
parent b0754d00c6
commit 0f37544668
+2 -2
View File
@@ -59,12 +59,13 @@ export class NetworkScanner {
this.log('UC Check running...', 'log', 'startUCCheck')
const udpClient = new UdpClient(this.udpPort)
const aliveClients = await udpClient.getTargetClients(operationCodes.ARE_YOU_UC)
console.log(aliveClients)
const data = await this.db.read()
const foundClient = aliveClients.length > 0
const serverFound = data.app_config.server_found
if (foundClient) {
const ipAddress = aliveClients[0]
const ipAddress = aliveClients[0].ipAddress
if (data.network.serverIp !== ipAddress) {
await this.db.update((data) => {
@@ -108,7 +109,6 @@ export class NetworkScanner {
try {
this.log('IP Lookup running...', 'log', 'startUserIPLookup')
const data = await this.db.read()
const serverIp = data.network.serverIp
const udpClient = new UdpClient(this.udpPort)
const activeClients = await udpClient.getTargetClients(operationCodes.ARE_YOU_HUMAN)