Merge branch '3.8.2-DEV' of https://dev.sp-tarkov.com/SPT-AKI/Server into 3.8.2-DEV

This commit is contained in:
Dev 2024-05-10 14:51:44 +01:00
commit fddbe4cf54
3 changed files with 8 additions and 5 deletions

View File

@ -56,8 +56,7 @@ export class BundleLoader
public addBundles(modpath: string): void public addBundles(modpath: string): void
{ {
const bundleManifestArr const bundleManifestArr = this.jsonUtil.deserialize<BundleManifest>(this.vfs.readFile(`${modpath}bundles.json`)).manifest;
= this.jsonUtil.deserialize<BundleManifest>(this.vfs.readFile(`${modpath}bundles.json`)).manifest;
for (const bundleManifest of bundleManifestArr) for (const bundleManifest of bundleManifestArr)
{ {

View File

@ -8,7 +8,7 @@ export class BundleDynamicRouter extends DynamicRouter
constructor(@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks) constructor(@inject("BundleCallbacks") protected bundleCallbacks: BundleCallbacks)
{ {
super([ super([
new RouteAction(".bundle", (url: string, info: any, sessionID: string, output: string): any => new RouteAction("/files/bundle", (url: string, info: any, sessionID: string, output: string): any =>
{ {
return this.bundleCallbacks.getBundle(url, info, sessionID); return this.bundleCallbacks.getBundle(url, info, sessionID);
}), }),

View File

@ -19,10 +19,14 @@ export class BundleSerializer extends Serializer
public override serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void public override serialize(sessionID: string, req: IncomingMessage, resp: ServerResponse, body: any): void
{ {
this.logger.info(`[BUNDLE]: ${req.url}`);
const key = decodeURI(req.url.split("/bundle/")[1]); const key = decodeURI(req.url.split("/bundle/")[1]);
const bundle = this.bundleLoader.getBundle(key); const bundle = this.bundleLoader.getBundle(key);
if (!bundle)
{
return;
}
this.logger.info(`[BUNDLE]: ${req.url}`);
this.httpFileUtil.sendFile(resp, `${bundle.modpath}/bundles/${bundle.filename}`); this.httpFileUtil.sendFile(resp, `${bundle.modpath}/bundles/${bundle.filename}`);
} }