diff --git a/project/package.json b/project/package.json index 22c662fc..8df289bc 100644 --- a/project/package.json +++ b/project/package.json @@ -1,6 +1,6 @@ { "name": "aki-server", - "version": "3.8.0", + "version": "3.8.1", "author": "SPT-AKI Server", "license": "NCSA", "main": "obj/bundle.js", diff --git a/project/src/ide/TestEntry.ts b/project/src/ide/TestEntry.ts index e1ff4e4a..dc4ca2a9 100644 --- a/project/src/ide/TestEntry.ts +++ b/project/src/ide/TestEntry.ts @@ -2,7 +2,10 @@ import "reflect-metadata"; import "source-map-support/register"; import { Program } from "@spt-aki/Program"; -import * as buildInfo from "./build.json"; +// target run:profiler doesnt work with this here +// since this is the Test entry we can just remove +// it and leave those empty +// import * as buildInfo from "./build.json"; globalThis.G_DEBUG_CONFIGURATION = true; globalThis.G_RELEASE_CONFIGURATION = false; @@ -11,9 +14,9 @@ globalThis.G_MODS_TRANSPILE_TS = false; globalThis.G_LOG_REQUESTS = true; globalThis.G_WATERMARK_ENABLED = false; -globalThis.G_AKIVERSION = buildInfo.akiVersion; -globalThis.G_COMMIT = buildInfo.commit; -globalThis.G_BUILDTIME = buildInfo.buildTime; +globalThis.G_AKIVERSION = ""; +globalThis.G_COMMIT = ""; +globalThis.G_BUILDTIME = ""; const program = new Program(); program.start(); diff --git a/project/src/utils/RagfairOfferHolder.ts b/project/src/utils/RagfairOfferHolder.ts index 21367593..aa806efa 100644 --- a/project/src/utils/RagfairOfferHolder.ts +++ b/project/src/utils/RagfairOfferHolder.ts @@ -86,7 +86,16 @@ export class RagfairOfferHolder if (this.offersById.has(offer._id)) { this.offersById.delete(offer._id); - this.offersByTrader.get(offer.user.id).delete(offer._id); + const traderOffers = this.offersByTrader.get(offer.user.id); + traderOffers.delete(offer._id); + // This was causing a memory leak, we need to make sure that we remove + // the user ID from the cached offers after they dont have anything else + // on the flea placed. We regenerate the ID for the NPC users, making it + // continously grow otherwise + if (traderOffers.size === 0) + { + this.offersByTrader.delete(offer.user.id); + } this.offersByTemplate.get(offer.items[0]._tpl).delete(offer._id); } }