Removed dead code from BundleCallbacks

This commit is contained in:
TheSparta 2024-03-24 17:53:04 +00:00
parent 5e8fb7b303
commit 5694af2030

View File

@ -3,9 +3,7 @@ import { inject, injectable } from "tsyringe";
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 { ILogger } from "@spt-aki/models/spt/utils/ILogger";
import { ConfigServer } from "@spt-aki/servers/ConfigServer";
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
@injectable()
@ -14,9 +12,7 @@ export class BundleCallbacks
protected httpConfig: IHttpConfig;
constructor(
@inject("WinstonLogger") protected logger: ILogger,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil,
@inject("BundleLoader") protected bundleLoader: BundleLoader,
@inject("ConfigServer") protected configServer: ConfigServer,
)
@ -24,29 +20,15 @@ export class BundleCallbacks
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendBundle(sessionID: string, req: any, resp: any, body: any): void
{
this.logger.info(`[BUNDLE]: ${req.url}`);
const key = req.url.split("/bundle/")[1];
const bundle = this.bundleLoader.getBundle(key, true);
// send bundle
this.httpFileUtil.sendFile(resp, bundle.path);
}
/**
* Handle singleplayer/bundles
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getBundles(url: string, info: any, sessionID: string): string
{
const local = this.httpConfig.ip === "127.0.0.1" || this.httpConfig.ip === "localhost";
return this.httpResponse.noBody(this.bundleLoader.getBundles(local));
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getBundle(url: string, info: any, sessionID: string): string
{
return "BUNDLE";