From 596a621c6279c725d6952b31999a6a7bd0b6d8d1 Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Fri, 22 Nov 2024 13:57:36 +0700 Subject: [PATCH] BUGFIX: Missing migration code for v0.56.0 (#1790) --- src/SaveObject.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SaveObject.ts b/src/SaveObject.ts index cf1202254..d72fe94c4 100644 --- a/src/SaveObject.ts +++ b/src/SaveObject.ts @@ -13,6 +13,7 @@ import { createUniqueRandomIp, AddToAllServers, GetServer, + renameServer, } from "./Server/AllServers"; import { Settings } from "./Settings/Settings"; import { loadStockMarket, StockMarket } from "./StockMarket/StockMarket"; @@ -313,6 +314,10 @@ function evaluateVersionCompatibility(ver: string | number): void { delete anyPlayer.companyPosition; } if (ver < "0.56.0") { + // In older versions, keys of AllServers are IP addresses instead of hostnames. + for (const server of GetAllServers()) { + renameServer(server.ip, server.hostname); + } for (const q of anyPlayer.queuedAugmentations) { if (q.name === "Graphene BranchiBlades Upgrade") { q.name = "Graphene BrachiBlades Upgrade";