2023-03-03 15:23:46 +00:00
|
|
|
import { inject, injectable } from "tsyringe";
|
2023-10-19 17:21:17 +00:00
|
|
|
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
|
|
|
|
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
|
|
|
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
|
|
|
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
|
|
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
2023-03-03 15:23:46 +00:00
|
|
|
|
|
|
|
@injectable()
|
|
|
|
export class BundleCallbacks
|
|
|
|
{
|
|
|
|
protected httpConfig: IHttpConfig;
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
|
|
|
@inject("BundleLoader") protected bundleLoader: BundleLoader,
|
2023-11-16 21:42:06 +00:00
|
|
|
@inject("ConfigServer") protected configServer: ConfigServer,
|
2023-03-03 15:23:46 +00:00
|
|
|
)
|
|
|
|
{
|
|
|
|
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
|
|
|
|
}
|
|
|
|
|
2023-07-15 10:56:00 +01:00
|
|
|
/**
|
|
|
|
* Handle singleplayer/bundles
|
|
|
|
*/
|
2023-03-03 15:23:46 +00:00
|
|
|
public getBundles(url: string, info: any, sessionID: string): string
|
|
|
|
{
|
2024-03-29 18:43:36 +00:00
|
|
|
return this.httpResponse.noBody(this.bundleLoader.getBundles());
|
2023-03-03 15:23:46 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public getBundle(url: string, info: any, sessionID: string): string
|
|
|
|
{
|
|
|
|
return "BUNDLE";
|
|
|
|
}
|
|
|
|
}
|