Server/project/src/callbacks/BundleCallbacks.ts

35 lines
1.1 KiB
TypeScript
Raw Normal View History

2023-03-03 15:23:46 +00:00
import { inject, injectable } from "tsyringe";
import { BundleLoader } from "@spt/loaders/BundleLoader";
import { ConfigTypes } from "@spt/models/enums/ConfigTypes";
import { IHttpConfig } from "@spt/models/spt/config/IHttpConfig";
import { ConfigServer } from "@spt/servers/ConfigServer";
import { HttpResponseUtil } from "@spt/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,
@inject("ConfigServer") protected configServer: ConfigServer,
2023-03-03 15:23:46 +00:00
)
{
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
}
/**
* Handle singleplayer/bundles
*/
2023-03-03 15:23:46 +00:00
public getBundles(url: string, info: any, sessionID: string): string
{
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";
}
}