From 1e2e42af75df76afad1c59963dbf57006243123f Mon Sep 17 00:00:00 2001 From: Gabriel Hawk Date: Mon, 13 Jun 2022 01:07:21 -0500 Subject: [PATCH 1/2] ipExists acceses server list correctly --- src/Server/AllServers.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Server/AllServers.ts b/src/Server/AllServers.ts index 47355e557..b7de02714 100644 --- a/src/Server/AllServers.ts +++ b/src/Server/AllServers.ts @@ -77,7 +77,12 @@ export function DeleteServer(serverkey: string): void { } export function ipExists(ip: string): boolean { - return AllServers[ip] != null; + for (const hostName in AllServers) { + if (AllServers[hostName].ip === ip) { + return true + } + } + return false } export function createUniqueRandomIp(): string { From 60c6536f8ef2791f1a56db925d1f87ccbb8755fe Mon Sep 17 00:00:00 2001 From: Gabriel Hawk Date: Mon, 13 Jun 2022 01:13:36 -0500 Subject: [PATCH 2/2] npm format --- src/Server/AllServers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Server/AllServers.ts b/src/Server/AllServers.ts index b7de02714..59a485594 100644 --- a/src/Server/AllServers.ts +++ b/src/Server/AllServers.ts @@ -79,10 +79,10 @@ export function DeleteServer(serverkey: string): void { export function ipExists(ip: string): boolean { for (const hostName in AllServers) { if (AllServers[hostName].ip === ip) { - return true + return true; } } - return false + return false; } export function createUniqueRandomIp(): string {