Skip to content

Commit

Permalink
support all bundle file extension
Browse files Browse the repository at this point in the history
This issue was brought up by SiulSC on Discord.

If bundle files have a different extension than .bundle, SPT will return an UNHANDLED exception and won't download the bundle correctly. However, custom bundle extensions are managed on normal standard SPT, so not sure why we're getting this issue with SITCoop. This PR aims to fix this issue.

Tested using this mod: https://hub.sp-tarkov.com/files/file/889-goblin-king/ which is using .goblin with some of its bundles.
Confirmed to be working with this PR.
  • Loading branch information
trippyone committed Nov 23, 2023
1 parent 4d7595c commit 5431d9b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/StayInTarkovMod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ import { CoopMatchResponse } from "./CoopMatchResponse";
import { friendlyAI } from "./FriendlyAI";
import { SITCustomTraders } from "./Traders/SITCustomTraders";
import { HttpServerHelper } from "@spt-aki/helpers/HttpServerHelper";
import { BundleCallbacks } from "@spt-aki/callbacks/BundleCallbacks";
// -------------------------------------------------------------------------


Expand All @@ -70,6 +71,7 @@ export class StayInTarkovMod implements IPreAkiLoadMod, IPostDBLoadMod
resolvedExternalIP: string;
profileHelper: ProfileHelper;
httpServerHelper: HttpServerHelper;
bundleCallbacks: BundleCallbacks;

public traders: any[] = [];

Expand Down Expand Up @@ -114,6 +116,7 @@ export class StayInTarkovMod implements IPreAkiLoadMod, IPostDBLoadMod
this.bundleLoader = container.resolve<BundleLoader>("BundleLoader");
this.profileHelper = container.resolve<ProfileHelper>("ProfileHelper");
this.httpServerHelper = container.resolve<HttpServerHelper>("HttpServerHelper");
this.bundleCallbacks = container.resolve<BundleCallbacks>("BundleCallbacks");

// this.traders.push(new SITCustomTraders(), new CoopGroupTrader(), new UsecTrader(), new BearTrader());
this.traders.push(new SITCustomTraders());
Expand Down Expand Up @@ -200,6 +203,14 @@ export class StayInTarkovMod implements IPreAkiLoadMod, IPostDBLoadMod
output = JSON.stringify(friendlyAI);
return output;
}
),
new RouteAction(
"/files/bundle",
// eslint-disable-next-line @typescript-eslint/no-unused-vars
(url: string, info: any, sessionID: string, output: string): any =>
{
return this.bundleCallbacks.getBundle(url, info, sessionID);
}
)
]
,"aki"
Expand Down

0 comments on commit 5431d9b

Please sign in to comment.