4ac12ef70a
These are the formatting & linting configuration changes from the `3.8.0` branch and the changes that they make to the overall project. The majority of these changes are from running two commands: `npm run lint:fix` `npm run style:fix` This has already been run on the `3.8.0` branch and this PR should make `master` play nicer when it comes to merges going forward. There are now four VSCode plugins recommended for server development. They've been added to the workspace file and a user should get a UI notification when the workspace is opened if they're not installed. The four plugins are: https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig https://marketplace.visualstudio.com/items?itemName=dprint.dprint https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint https://marketplace.visualstudio.com/items?itemName=biomejs.biome Once installed they should just work within the workspace. Also, be sure to `npm i` to get the new dprint application. Co-authored-by: Refringe <brownelltyler@gmail.com> Reviewed-on: https://dev.sp-tarkov.com/SPT-AKI/Server/pulls/168
84 lines
2.5 KiB
TypeScript
84 lines
2.5 KiB
TypeScript
import { inject, injectable } from "tsyringe";
|
|
|
|
import { InraidController } from "@spt-aki/controllers/InraidController";
|
|
import { INullResponseData } from "@spt-aki/models/eft/httpResponse/INullResponseData";
|
|
import { IRegisterPlayerRequestData } from "@spt-aki/models/eft/inRaid/IRegisterPlayerRequestData";
|
|
import { ISaveProgressRequestData } from "@spt-aki/models/eft/inRaid/ISaveProgressRequestData";
|
|
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
|
|
|
|
/**
|
|
* Handle client requests
|
|
*/
|
|
@injectable()
|
|
export class InraidCallbacks
|
|
{
|
|
constructor(
|
|
@inject("InraidController") protected inraidController: InraidController,
|
|
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
|
|
)
|
|
{}
|
|
|
|
/**
|
|
* Handle client/location/getLocalloot
|
|
* Store active map in profile + applicationContext
|
|
* @param url
|
|
* @param info register player request
|
|
* @param sessionID Session id
|
|
* @returns Null http response
|
|
*/
|
|
public registerPlayer(url: string, info: IRegisterPlayerRequestData, sessionID: string): INullResponseData
|
|
{
|
|
this.inraidController.addPlayer(sessionID, info);
|
|
return this.httpResponse.nullResponse();
|
|
}
|
|
|
|
/**
|
|
* Handle raid/profile/save
|
|
* @param url
|
|
* @param info Save progress request
|
|
* @param sessionID Session id
|
|
* @returns Null http response
|
|
*/
|
|
public saveProgress(url: string, info: ISaveProgressRequestData, sessionID: string): INullResponseData
|
|
{
|
|
this.inraidController.savePostRaidProgress(info, sessionID);
|
|
return this.httpResponse.nullResponse();
|
|
}
|
|
|
|
/**
|
|
* Handle singleplayer/settings/raid/endstate
|
|
* @returns
|
|
*/
|
|
public getRaidEndState(): string
|
|
{
|
|
return this.httpResponse.noBody(this.inraidController.getInraidConfig().MIAOnRaidEnd);
|
|
}
|
|
|
|
/**
|
|
* Handle singleplayer/settings/raid/menu
|
|
* @returns JSON as string
|
|
*/
|
|
public getRaidMenuSettings(): string
|
|
{
|
|
return this.httpResponse.noBody(this.inraidController.getInraidConfig().raidMenuSettings);
|
|
}
|
|
|
|
/**
|
|
* Handle singleplayer/settings/weapon/durability
|
|
* @returns
|
|
*/
|
|
public getWeaponDurability(): string
|
|
{
|
|
return this.httpResponse.noBody(this.inraidController.getInraidConfig().save.durability);
|
|
}
|
|
|
|
/**
|
|
* Handle singleplayer/airdrop/config
|
|
* @returns JSON as string
|
|
*/
|
|
public getAirdropConfig(): string
|
|
{
|
|
return this.httpResponse.noBody(this.inraidController.getAirdropConfig());
|
|
}
|
|
}
|