mirror of
https://github.com/sp-tarkov/server.git
synced 2025-02-13 09:50:43 -05:00
Rebranded src code and scripts to SPT Co-authored-by: clodan <clodan@clodan.com> Reviewed-on: SPT-AKI/Server#345 Co-authored-by: Alex <clodan@noreply.dev.sp-tarkov.com> Co-committed-by: Alex <clodan@noreply.dev.sp-tarkov.com>
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
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";
|
|
|
|
@injectable()
|
|
export class BundleCallbacks
|
|
{
|
|
protected httpConfig: IHttpConfig;
|
|
|
|
constructor(
|
|
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
|
@inject("BundleLoader") protected bundleLoader: BundleLoader,
|
|
@inject("ConfigServer") protected configServer: ConfigServer,
|
|
)
|
|
{
|
|
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
|
|
}
|
|
|
|
/**
|
|
* Handle singleplayer/bundles
|
|
*/
|
|
public getBundles(url: string, info: any, sessionID: string): string
|
|
{
|
|
return this.httpResponse.noBody(this.bundleLoader.getBundles());
|
|
}
|
|
|
|
public getBundle(url: string, info: any, sessionID: string): string
|
|
{
|
|
return "BUNDLE";
|
|
}
|
|
}
|