From eb9af28c1bf961a21e7e7abb51a7e3a4be732189 Mon Sep 17 00:00:00 2001 From: Aria Adair Date: Sun, 23 Apr 2023 09:50:52 +0000 Subject: [PATCH] Make it possible to dynamically add bundles. (!87) I'm experimenting around with this to allow for loading bundles from ZIP files to help with texture pack distribution, wanted to get it out in front of folks for review. Co-authored-by: Ari Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/87 Co-authored-by: Aria Adair Co-committed-by: Aria Adair --- project/src/loaders/BundleLoader.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/project/src/loaders/BundleLoader.ts b/project/src/loaders/BundleLoader.ts index a470e095..0d891f62 100644 --- a/project/src/loaders/BundleLoader.ts +++ b/project/src/loaders/BundleLoader.ts @@ -67,9 +67,13 @@ export class BundleLoader { const bundlePath = `${this.httpServerHelper.getBackendUrl()}/files/bundle/${bundle.key}`; const bundleFilepath = bundle.path || `${modpath}bundles/${bundle.key}`.replace(/\\/g, "/"); - this.bundles[bundle.key] = new BundleInfo(modpath, bundle, bundlePath, bundleFilepath); + this.addBundle(bundle.key, new BundleInfo(modpath, bundle, bundlePath, bundleFilepath)); } } + + public addBundle(key: string, b: BundleInfo): void { + this.bundles[key] = b; + } } export interface BundleManifest