updated search of UC
This commit is contained in:
@@ -59,12 +59,13 @@ export class NetworkScanner {
|
|||||||
this.log('UC Check running...', 'log', 'startUCCheck')
|
this.log('UC Check running...', 'log', 'startUCCheck')
|
||||||
const udpClient = new UdpClient(this.udpPort)
|
const udpClient = new UdpClient(this.udpPort)
|
||||||
const aliveClients = await udpClient.getTargetClients(operationCodes.ARE_YOU_UC)
|
const aliveClients = await udpClient.getTargetClients(operationCodes.ARE_YOU_UC)
|
||||||
|
console.log(aliveClients)
|
||||||
const data = await this.db.read()
|
const data = await this.db.read()
|
||||||
const foundClient = aliveClients.length > 0
|
const foundClient = aliveClients.length > 0
|
||||||
const serverFound = data.app_config.server_found
|
const serverFound = data.app_config.server_found
|
||||||
|
|
||||||
if (foundClient) {
|
if (foundClient) {
|
||||||
const ipAddress = aliveClients[0]
|
const ipAddress = aliveClients[0].ipAddress
|
||||||
|
|
||||||
if (data.network.serverIp !== ipAddress) {
|
if (data.network.serverIp !== ipAddress) {
|
||||||
await this.db.update((data) => {
|
await this.db.update((data) => {
|
||||||
@@ -108,7 +109,6 @@ export class NetworkScanner {
|
|||||||
try {
|
try {
|
||||||
this.log('IP Lookup running...', 'log', 'startUserIPLookup')
|
this.log('IP Lookup running...', 'log', 'startUserIPLookup')
|
||||||
const data = await this.db.read()
|
const data = await this.db.read()
|
||||||
const serverIp = data.network.serverIp
|
|
||||||
const udpClient = new UdpClient(this.udpPort)
|
const udpClient = new UdpClient(this.udpPort)
|
||||||
const activeClients = await udpClient.getTargetClients(operationCodes.ARE_YOU_HUMAN)
|
const activeClients = await udpClient.getTargetClients(operationCodes.ARE_YOU_HUMAN)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user