DEVMENU: Reset hacknet server list properly when setting level of SF9 (#2177)

This commit is contained in:
catloversg
2025-07-12 02:57:38 +07:00
committed by GitHub
parent f182030385
commit 073dd43d94
3 changed files with 30 additions and 17 deletions
+3 -3
View File
@@ -111,9 +111,9 @@ export function createUniqueRandomIp(): IPAddress {
// Safely add a Server to the AllServers map
export function AddToAllServers(server: Server | HacknetServer): void {
if (GetServer(server.hostname)) {
console.warn(`Hostname of the server thats being added: ${server.hostname}`);
console.warn(`The server that already has this IP is: ${AllServers[server.hostname].hostname}`);
throw new Error("Error: Trying to add a server with an existing IP");
console.warn(`The hostname of the server that's being added is: ${server.hostname}`);
console.warn(`The server that already has this hostname is: ${AllServers[server.hostname].hostname}`);
throw new Error(`Error: Trying to add a server with an existing hostname. Hostname: ${server.hostname}.`);
}
AllServers[server.hostname] = server;