Removed dead code from BundleCallbacks
This commit is contained in:
parent
5e8fb7b303
commit
5694af2030
@ -3,9 +3,7 @@ import { inject, injectable } from "tsyringe";
|
|||||||
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
|
import { BundleLoader } from "@spt-aki/loaders/BundleLoader";
|
||||||
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
import { ConfigTypes } from "@spt-aki/models/enums/ConfigTypes";
|
||||||
import { IHttpConfig } from "@spt-aki/models/spt/config/IHttpConfig";
|
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 { ConfigServer } from "@spt-aki/servers/ConfigServer";
|
||||||
import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
|
|
||||||
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
||||||
|
|
||||||
@injectable()
|
@injectable()
|
||||||
@ -14,9 +12,7 @@ export class BundleCallbacks
|
|||||||
protected httpConfig: IHttpConfig;
|
protected httpConfig: IHttpConfig;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@inject("WinstonLogger") protected logger: ILogger,
|
|
||||||
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
||||||
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil,
|
|
||||||
@inject("BundleLoader") protected bundleLoader: BundleLoader,
|
@inject("BundleLoader") protected bundleLoader: BundleLoader,
|
||||||
@inject("ConfigServer") protected configServer: ConfigServer,
|
@inject("ConfigServer") protected configServer: ConfigServer,
|
||||||
)
|
)
|
||||||
@ -24,29 +20,15 @@ export class BundleCallbacks
|
|||||||
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
|
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
|
* Handle singleplayer/bundles
|
||||||
*/
|
*/
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
||||||
public getBundles(url: string, info: any, sessionID: string): string
|
public getBundles(url: string, info: any, sessionID: string): string
|
||||||
{
|
{
|
||||||
const local = this.httpConfig.ip === "127.0.0.1" || this.httpConfig.ip === "localhost";
|
const local = this.httpConfig.ip === "127.0.0.1" || this.httpConfig.ip === "localhost";
|
||||||
return this.httpResponse.noBody(this.bundleLoader.getBundles(local));
|
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
|
public getBundle(url: string, info: any, sessionID: string): string
|
||||||
{
|
{
|
||||||
return "BUNDLE";
|
return "BUNDLE";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user