mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-26 19:14:32 +02:00
REFACTOR: Speed up by-ip lookups by introducing a new map entry (#2488)
Thankfully, the existing AllServers map is not exported, so we can ensure that all the changes are only local to this file. This also fixes a bug if renameServer was called with the same name. (Probably calling code checked that case already.)
This commit is contained in:
@@ -13,7 +13,7 @@
|
||||
|
||||
import { Player } from "@player";
|
||||
import { AugmentationName, CityName, CodingContractName, LocationName } from "@enums";
|
||||
import { GetAllServers, renameServer } from "../Server/AllServers";
|
||||
import { GetAllServers } from "../Server/AllServers";
|
||||
import { StockMarket } from "../StockMarket/StockMarket";
|
||||
import { AwardNFG, v1APIBreak } from "./v1APIBreak";
|
||||
import { Settings } from "../Settings/Settings";
|
||||
@@ -89,10 +89,6 @@ export async function evaluateVersionCompatibility(ver: string | number): Promis
|
||||
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";
|
||||
|
||||
Reference in New Issue
Block a user