Add routes for Modules to get Bosses that are allowed to be converted (!368)
Reviewed-on: https://dev.sp-tarkov.com/SPT/Server/pulls/368
This commit is contained in:
parent
541264af73
commit
4b2f42a406
@ -110,4 +110,9 @@ export class InraidCallbacks
|
|||||||
{
|
{
|
||||||
return this.httpResponse.noBody(this.inraidController.getSandboxMaxPatrolValue(url, sessionId));
|
return this.httpResponse.noBody(this.inraidController.getSandboxMaxPatrolValue(url, sessionId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getBossConvertSettings(url: string, info: IEmptyRequestData, sessionId: string): string
|
||||||
|
{
|
||||||
|
return this.httpResponse.noBody(this.inraidController.getBossConvertSettings(url, sessionId))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ import { PmcChatResponseService } from "@spt/services/PmcChatResponseService";
|
|||||||
import { TraderServicesService } from "@spt/services/TraderServicesService";
|
import { TraderServicesService } from "@spt/services/TraderServicesService";
|
||||||
import { RandomUtil } from "@spt/utils/RandomUtil";
|
import { RandomUtil } from "@spt/utils/RandomUtil";
|
||||||
import { TimeUtil } from "@spt/utils/TimeUtil";
|
import { TimeUtil } from "@spt/utils/TimeUtil";
|
||||||
|
import { IBotConfig } from "@spt/models/spt/config/IBotConfig";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logic for handling In Raid callbacks
|
* Logic for handling In Raid callbacks
|
||||||
@ -55,6 +56,7 @@ export class InraidController
|
|||||||
protected locationConfig: ILocationConfig;
|
protected locationConfig: ILocationConfig;
|
||||||
protected ragfairConfig: IRagfairConfig;
|
protected ragfairConfig: IRagfairConfig;
|
||||||
protected hideoutConfig: IHideoutConfig;
|
protected hideoutConfig: IHideoutConfig;
|
||||||
|
protected botConfig: IBotConfig;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@inject("PrimaryLogger") protected logger: ILogger,
|
@inject("PrimaryLogger") protected logger: ILogger,
|
||||||
@ -86,6 +88,7 @@ export class InraidController
|
|||||||
this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION);
|
this.locationConfig = this.configServer.getConfig(ConfigTypes.LOCATION);
|
||||||
this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR);
|
this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR);
|
||||||
this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT);
|
this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT);
|
||||||
|
this.botConfig = this.configServer.getConfig(ConfigTypes.BOT);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -712,4 +715,9 @@ export class InraidController
|
|||||||
{
|
{
|
||||||
return this.locationConfig.sandboxMaxPatrolvalue;
|
return this.locationConfig.sandboxMaxPatrolvalue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public getBossConvertSettings(url: string, sessionId: string): string[]
|
||||||
|
{
|
||||||
|
return Object.keys(this.botConfig.assaultToBossConversion.bossesToConvertToWeights);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,6 +65,13 @@ export class InraidStaticRouter extends StaticRouter
|
|||||||
return this.inraidCallbacks.getSandboxMaxPatrolValue(url, info, sessionID);
|
return this.inraidCallbacks.getSandboxMaxPatrolValue(url, info, sessionID);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
new RouteAction(
|
||||||
|
"/singleplayer/BossConvert",
|
||||||
|
async (url: string, info: any, sessionID: string, output: string): Promise<string> =>
|
||||||
|
{
|
||||||
|
return this.inraidCallbacks.getBossConvertSettings(url, info, sessionID);
|
||||||
|
},
|
||||||
|
),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user