Auto-formatting for callback classes.

This commit is contained in:
Refringe 2023-11-10 15:19:56 -05:00
parent 90cdd6eea1
commit ab7f41b924
No known key found for this signature in database
GPG Key ID: 64E03E5F892C6F9E
32 changed files with 556 additions and 328 deletions

View File

@ -12,7 +12,8 @@ export class BotCallbacks
{ {
constructor( constructor(
@inject("BotController") protected botController: BotController, @inject("BotController") protected botController: BotController,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil) @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
)
{} {}
/** /**
@ -20,7 +21,6 @@ export class BotCallbacks
* Is called by client to define each bot roles wave limit * Is called by client to define each bot roles wave limit
* @returns string * @returns string
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string public getBotLimit(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
const splittedUrl = url.split("/"); const splittedUrl = url.split("/");
@ -32,7 +32,6 @@ export class BotCallbacks
* Handle singleplayer/settings/bot/difficulty * Handle singleplayer/settings/bot/difficulty
* @returns string * @returns string
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string public getBotDifficulty(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
const splittedUrl = url.split("/"); const splittedUrl = url.split("/");
@ -42,7 +41,6 @@ export class BotCallbacks
{ {
return this.httpResponse.noBody(this.botController.getBotCoreDifficulty()); return this.httpResponse.noBody(this.botController.getBotCoreDifficulty());
} }
return this.httpResponse.noBody(this.botController.getBotDifficulty(type, difficulty)); return this.httpResponse.noBody(this.botController.getBotDifficulty(type, difficulty));
} }
@ -50,7 +48,11 @@ export class BotCallbacks
* Handle client/game/bot/generate * Handle client/game/bot/generate
* @returns IGetBodyResponseData * @returns IGetBodyResponseData
*/ */
public generateBots(url: string, info: IGenerateBotsRequestData, sessionID: string): IGetBodyResponseData<IBotBase[]> public generateBots(
url: string,
info: IGenerateBotsRequestData,
sessionID: string,
): IGetBodyResponseData<IBotBase[]>
{ {
return this.httpResponse.getBody(this.botController.generate(sessionID, info)); return this.httpResponse.getBody(this.botController.generate(sessionID, info));
} }

View File

@ -18,13 +18,12 @@ export class BundleCallbacks
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil, @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,
) )
{ {
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): any public sendBundle(sessionID: string, req: any, resp: any, body: any): any
{ {
this.logger.info(`[BUNDLE]: ${req.url}`); this.logger.info(`[BUNDLE]: ${req.url}`);
@ -39,14 +38,12 @@ export class BundleCallbacks
/** /**
* 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";

View File

@ -10,14 +10,13 @@ export class ClientLogCallbacks
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("ClientLogController") protected clientLogController: ClientLogController @inject("ClientLogController") protected clientLogController: ClientLogController,
) )
{} {}
/** /**
* Handle /singleplayer/log * Handle /singleplayer/log
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public clientLog(url: string, info: IClientLogRequest, sessionID: string): INullResponseData public clientLog(url: string, info: IClientLogRequest, sessionID: string): INullResponseData
{ {
this.clientLogController.clientLog(info); this.clientLogController.clientLog(info);

View File

@ -18,7 +18,7 @@ export class CustomizationCallbacks
constructor( constructor(
@inject("CustomizationController") protected customizationController: CustomizationController, @inject("CustomizationController") protected customizationController: CustomizationController,
@inject("SaveServer") protected saveServer: SaveServer, @inject("SaveServer") protected saveServer: SaveServer,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
) )
{} {}
@ -30,7 +30,7 @@ export class CustomizationCallbacks
{ {
const result: IGetSuitsResponse = { const result: IGetSuitsResponse = {
_id: `pmc${sessionID}`, _id: `pmc${sessionID}`,
suites: this.saveServer.getProfile(sessionID).suits suites: this.saveServer.getProfile(sessionID).suits,
}; };
return this.httpResponse.getBody(result); return this.httpResponse.getBody(result);
} }

View File

@ -27,7 +27,7 @@ export class DataCallbacks
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("DatabaseServer") protected databaseServer: DatabaseServer, @inject("DatabaseServer") protected databaseServer: DatabaseServer,
@inject("RagfairController") protected ragfairController: RagfairController, @inject("RagfairController") protected ragfairController: RagfairController,
@inject("HideoutController") protected hideoutController: HideoutController @inject("HideoutController") protected hideoutController: HideoutController,
) )
{} {}
@ -35,7 +35,6 @@ export class DataCallbacks
* Handle client/settings * Handle client/settings
* @returns ISettingsBase * @returns ISettingsBase
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase> public getSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ISettingsBase>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().settings); return this.httpResponse.getBody(this.databaseServer.getTables().settings);
@ -45,7 +44,6 @@ export class DataCallbacks
* Handle client/globals * Handle client/globals
* @returns IGlobals * @returns IGlobals
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals> public getGlobals(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGlobals>
{ {
this.databaseServer.getTables().globals.time = Date.now() / 1000; this.databaseServer.getTables().globals.time = Date.now() / 1000;
@ -56,7 +54,6 @@ export class DataCallbacks
* Handle client/items * Handle client/items
* @returns string * @returns string
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string public getTemplateItems(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.getUnclearedBody(this.databaseServer.getTables().templates.items); return this.httpResponse.getUnclearedBody(this.databaseServer.getTables().templates.items);
@ -66,8 +63,11 @@ export class DataCallbacks
* Handle client/handbook/templates * Handle client/handbook/templates
* @returns IHandbookBase * @returns IHandbookBase
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getTemplateHandbook(
public getTemplateHandbook(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHandbookBase> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IHandbookBase>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().templates.handbook); return this.httpResponse.getBody(this.databaseServer.getTables().templates.handbook);
} }
@ -76,8 +76,11 @@ export class DataCallbacks
* Handle client/customization * Handle client/customization
* @returns Record<string, ICustomizationItem * @returns Record<string, ICustomizationItem
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getTemplateSuits(
public getTemplateSuits(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, ICustomizationItem>> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<Record<string, ICustomizationItem>>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().templates.customization); return this.httpResponse.getBody(this.databaseServer.getTables().templates.customization);
} }
@ -86,7 +89,6 @@ export class DataCallbacks
* Handle client/account/customization * Handle client/account/customization
* @returns string[] * @returns string[]
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]> public getTemplateCharacter(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string[]>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().templates.character); return this.httpResponse.getBody(this.databaseServer.getTables().templates.character);
@ -96,26 +98,38 @@ export class DataCallbacks
* Handle client/hideout/settings * Handle client/hideout/settings
* @returns IHideoutSettingsBase * @returns IHideoutSettingsBase
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getHideoutSettings(
public getHideoutSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutSettingsBase> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IHideoutSettingsBase>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().hideout.settings); return this.httpResponse.getBody(this.databaseServer.getTables().hideout.settings);
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getHideoutAreas(
public getHideoutAreas(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutArea[]> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IHideoutArea[]>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().hideout.areas); return this.httpResponse.getBody(this.databaseServer.getTables().hideout.areas);
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars public gethideoutProduction(
public gethideoutProduction(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutProduction[]> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IHideoutProduction[]>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().hideout.production); return this.httpResponse.getBody(this.databaseServer.getTables().hideout.production);
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getHideoutScavcase(
public getHideoutScavcase(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IHideoutScavCase[]> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IHideoutScavCase[]>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().hideout.scavcase); return this.httpResponse.getBody(this.databaseServer.getTables().hideout.scavcase);
} }
@ -123,8 +137,11 @@ export class DataCallbacks
/** /**
* Handle client/languages * Handle client/languages
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getLocalesLanguages(
public getLocalesLanguages(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, string>> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<Record<string, string>>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().locales.languages); return this.httpResponse.getBody(this.databaseServer.getTables().locales.languages);
} }
@ -132,25 +149,26 @@ export class DataCallbacks
/** /**
* Handle client/menu/locale * Handle client/menu/locale
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string> public getLocalesMenu(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>
{ {
return this.httpResponse.getBody(this.databaseServer.getTables().locales.menu[url.replace("/client/menu/locale/", "")]); return this.httpResponse.getBody(
this.databaseServer.getTables().locales.menu[url.replace("/client/menu/locale/", "")],
);
} }
/** /**
* Handle client/locale * Handle client/locale
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string public getLocalesGlobal(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.getUnclearedBody(this.databaseServer.getTables().locales.global[url.replace("/client/locale/", "")]); return this.httpResponse.getUnclearedBody(
this.databaseServer.getTables().locales.global[url.replace("/client/locale/", "")],
);
} }
/** /**
* Handle client/hideout/qte/list * Handle client/hideout/qte/list
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getQteList(url: string, info: IEmptyRequestData, sessionID: string): string public getQteList(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.getUnclearedBody(this.hideoutController.getQteList(sessionID)); return this.httpResponse.getUnclearedBody(this.hideoutController.getQteList(sessionID));
@ -161,21 +179,23 @@ export class DataCallbacks
* Called when viewing a traders assorts * Called when viewing a traders assorts
* TODO - fully implement this * TODO - fully implement this
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getItemPrices(
public getItemPrices(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetItemPricesResponse> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IGetItemPricesResponse>
{ {
const handbookPrices = this.ragfairController.getStaticPrices(); const handbookPrices = this.ragfairController.getStaticPrices();
const response: IGetItemPricesResponse = { const response: IGetItemPricesResponse = {
supplyNextTime: 1672236024, // todo: get trader refresh time? supplyNextTime: 1672236024, // todo: get trader refresh time?
prices: handbookPrices, prices: handbookPrices,
currencyCourses: { currencyCourses: {
// eslint-disable-next-line @typescript-eslint/naming-convention /* eslint-disable @typescript-eslint/naming-convention */
"5449016a4bdc2d6f028b456f": handbookPrices[Money.ROUBLES], "5449016a4bdc2d6f028b456f": handbookPrices[Money.ROUBLES],
// eslint-disable-next-line @typescript-eslint/naming-convention
"569668774bdc2da2298b4568": handbookPrices[Money.EUROS], "569668774bdc2da2298b4568": handbookPrices[Money.EUROS],
// eslint-disable-next-line @typescript-eslint/naming-convention "5696686a4bdc2da3298b456a": handbookPrices[Money.DOLLARS],
"5696686a4bdc2da3298b456a": handbookPrices[Money.DOLLARS] /* eslint-enable @typescript-eslint/naming-convention */
} },
}; };
return this.httpResponse.getBody(response); return this.httpResponse.getBody(response);
} }

View File

@ -3,7 +3,10 @@ import { inject, injectable } from "tsyringe";
import { DialogueController } from "@spt-aki/controllers/DialogueController"; import { DialogueController } from "@spt-aki/controllers/DialogueController";
import { OnUpdate } from "@spt-aki/di/OnUpdate"; import { OnUpdate } from "@spt-aki/di/OnUpdate";
import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "@spt-aki/models/eft/common/IEmptyRequestData";
import { IAcceptFriendRequestData, ICancelFriendRequestData } from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData"; import {
IAcceptFriendRequestData,
ICancelFriendRequestData,
} from "@spt-aki/models/eft/dialog/IAcceptFriendRequestData";
import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer"; import { IChatServer } from "@spt-aki/models/eft/dialog/IChatServer";
import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest"; import { IClearMailMessageRequest } from "@spt-aki/models/eft/dialog/IClearMailMessageRequest";
import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest"; import { IDeleteFriendRequest } from "@spt-aki/models/eft/dialog/IDeleteFriendRequest";
@ -36,16 +39,19 @@ export class DialogueCallbacks implements OnUpdate
@inject("HashUtil") protected hashUtil: HashUtil, @inject("HashUtil") protected hashUtil: HashUtil,
@inject("TimeUtil") protected timeUtil: TimeUtil, @inject("TimeUtil") protected timeUtil: TimeUtil,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("DialogueController") protected dialogueController: DialogueController @inject("DialogueController") protected dialogueController: DialogueController,
) )
{ {}
}
/** /**
* Handle client/friend/list * Handle client/friend/list
* @returns IGetFriendListDataResponse * @returns IGetFriendListDataResponse
*/ */
public getFriendList(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGetFriendListDataResponse> public getFriendList(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IGetFriendListDataResponse>
{ {
return this.httpResponse.getBody(this.dialogueController.getFriendList(sessionID)); return this.httpResponse.getBody(this.dialogueController.getFriendList(sessionID));
} }
@ -54,45 +60,58 @@ export class DialogueCallbacks implements OnUpdate
* Handle client/chatServer/list * Handle client/chatServer/list
* @returns IChatServer[] * @returns IChatServer[]
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getChatServerList(
public getChatServerList(url: string, info: IGetChatServerListRequestData, sessionID: string): IGetBodyResponseData<IChatServer[]> url: string,
{ info: IGetChatServerListRequestData,
sessionID: string,
const chatServer: IChatServer = ): IGetBodyResponseData<IChatServer[]>
{ {
const chatServer: IChatServer = {
_id: this.hashUtil.generate(), _id: this.hashUtil.generate(),
RegistrationId: 20, RegistrationId: 20,
DateTime: this.timeUtil.getTimestamp(), DateTime: this.timeUtil.getTimestamp(),
IsDeveloper: true, IsDeveloper: true,
Regions: ["EUR"], Regions: ["EUR"],
VersionId: "bgkidft87ddd", VersionId: "bgkidft87ddd", // TODO: Is this... correct?
Ip: "", Ip: "",
Port: 0, Port: 0,
Chats: [ Chats: [
{ {
_id: "0", _id: "0",
Members: 0 Members: 0,
} },
] ],
}; };
return this.httpResponse.getBody([chatServer]); return this.httpResponse.getBody([chatServer]);
} }
/** Handle client/mail/dialog/list */ /** Handle client/mail/dialog/list */
public getMailDialogList(url: string, info: IGetMailDialogListRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo[]> public getMailDialogList(
url: string,
info: IGetMailDialogListRequestData,
sessionID: string,
): IGetBodyResponseData<DialogueInfo[]>
{ {
return this.httpResponse.getBody(this.dialogueController.generateDialogueList(sessionID)); return this.httpResponse.getBody(this.dialogueController.generateDialogueList(sessionID));
} }
/** Handle client/mail/dialog/view */ /** Handle client/mail/dialog/view */
public getMailDialogView(url: string, info: IGetMailDialogViewRequestData, sessionID: string): IGetBodyResponseData<IGetMailDialogViewResponseData> public getMailDialogView(
url: string,
info: IGetMailDialogViewRequestData,
sessionID: string,
): IGetBodyResponseData<IGetMailDialogViewResponseData>
{ {
return this.httpResponse.getBody(this.dialogueController.generateDialogueView(info, sessionID)); return this.httpResponse.getBody(this.dialogueController.generateDialogueView(info, sessionID));
} }
/** Handle client/mail/dialog/info */ /** Handle client/mail/dialog/info */
public getMailDialogInfo(url: string, info: IGetMailDialogInfoRequestData, sessionID: string): IGetBodyResponseData<DialogueInfo> public getMailDialogInfo(
url: string,
info: IGetMailDialogInfoRequestData,
sessionID: string,
): IGetBodyResponseData<DialogueInfo>
{ {
return this.httpResponse.getBody(this.dialogueController.getDialogueInfo(info.dialogId, sessionID)); return this.httpResponse.getBody(this.dialogueController.getDialogueInfo(info.dialogId, sessionID));
} }
@ -129,7 +148,11 @@ export class DialogueCallbacks implements OnUpdate
* Handle client/mail/dialog/getAllAttachments * Handle client/mail/dialog/getAllAttachments
* @returns IGetAllAttachmentsResponse * @returns IGetAllAttachmentsResponse
*/ */
public getAllAttachments(url: string, info: IGetAllAttachmentsRequestData, sessionID: string): IGetBodyResponseData<IGetAllAttachmentsResponse> public getAllAttachments(
url: string,
info: IGetAllAttachmentsRequestData,
sessionID: string,
): IGetBodyResponseData<IGetAllAttachmentsResponse>
{ {
return this.httpResponse.getBody(this.dialogueController.getAllAttachments(info.dialogId, sessionID)); return this.httpResponse.getBody(this.dialogueController.getAllAttachments(info.dialogId, sessionID));
} }
@ -141,7 +164,6 @@ export class DialogueCallbacks implements OnUpdate
} }
/** Handle client/friend/request/list/outbox */ /** Handle client/friend/request/list/outbox */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]> public listOutbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.getBody([]); return this.httpResponse.getBody([]);
@ -150,7 +172,6 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/list/inbox * Handle client/friend/request/list/inbox
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]> public listInbox(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.getBody([]); return this.httpResponse.getBody([]);
@ -159,8 +180,11 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/send * Handle client/friend/request/send
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public sendFriendRequest(
public sendFriendRequest(url: string, request: IFriendRequestData, sessionID: string): IGetBodyResponseData<IFriendRequestSendResponse> url: string,
request: IFriendRequestData,
sessionID: string,
): IGetBodyResponseData<IFriendRequestSendResponse>
{ {
return this.httpResponse.getBody({status: 0, requestid: "12345", retryAfter: 600}); return this.httpResponse.getBody({status: 0, requestid: "12345", retryAfter: 600});
} }
@ -168,8 +192,11 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/accept * Handle client/friend/request/accept
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public acceptFriendRequest(
public acceptFriendRequest(url: string, request: IAcceptFriendRequestData, sessionID: string): IGetBodyResponseData<boolean> url: string,
request: IAcceptFriendRequestData,
sessionID: string,
): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
@ -177,46 +204,43 @@ export class DialogueCallbacks implements OnUpdate
/** /**
* Handle client/friend/request/cancel * Handle client/friend/request/cancel
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public cancelFriendRequest(
public cancelFriendRequest(url: string, request: ICancelFriendRequestData, sessionID: string): IGetBodyResponseData<boolean> url: string,
request: ICancelFriendRequestData,
sessionID: string,
): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/friend/delete */ /** Handle client/friend/delete */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData public deleteFriend(url: string, request: IDeleteFriendRequest, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/friend/ignore/set */ /** Handle client/friend/ignore/set */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public ignoreFriend(url: string, request: {uid: string;}, sessionID: string): any
public ignoreFriend(url: string, request: {uid: string}, sessionID: string): any
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/friend/ignore/remove */ /** Handle client/friend/ignore/remove */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public unIgnoreFriend(url: string, request: {uid: string;}, sessionID: string): any
public unIgnoreFriend(url: string, request: {uid: string}, sessionID: string): any
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]> public clearMail(url: string, request: IClearMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.emptyArrayResponse(); return this.httpResponse.emptyArrayResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]> public removeMail(url: string, request: IRemoveMailMessageRequest, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.emptyArrayResponse(); return this.httpResponse.emptyArrayResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public async onUpdate(timeSinceLastRun: number): Promise<boolean> public async onUpdate(timeSinceLastRun: number): Promise<boolean>
{ {
this.dialogueController.update(); this.dialogueController.update();

View File

@ -20,13 +20,13 @@ import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark"; import { Watermark } from "@spt-aki/utils/Watermark";
@injectable() @injectable()
class GameCallbacks implements OnLoad export class GameCallbacks implements OnLoad
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("Watermark") protected watermark: Watermark, @inject("Watermark") protected watermark: Watermark,
@inject("SaveServer") protected saveServer: SaveServer, @inject("SaveServer") protected saveServer: SaveServer,
@inject("GameController") protected gameController: GameController @inject("GameController") protected gameController: GameController,
) )
{} {}
@ -44,7 +44,6 @@ class GameCallbacks implements OnLoad
* Handle client/game/version/validate * Handle client/game/version/validate
* @returns INullResponseData * @returns INullResponseData
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public versionValidate(url: string, info: IVersionValidateRequestData, sessionID: string): INullResponseData public versionValidate(url: string, info: IVersionValidateRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
@ -60,8 +59,7 @@ class GameCallbacks implements OnLoad
const startTimeStampMS = Date.parse(today); const startTimeStampMS = Date.parse(today);
this.gameController.gameStart(url, info, sessionID, startTimeStampMS); this.gameController.gameStart(url, info, sessionID, startTimeStampMS);
return this.httpResponse.getBody({ return this.httpResponse.getBody({
// eslint-disable-next-line @typescript-eslint/naming-convention utc_time: startTimeStampMS / 1000,
utc_time: startTimeStampMS / 1000
}); });
} }
@ -70,12 +68,15 @@ class GameCallbacks implements OnLoad
* Save profiles on game close * Save profiles on game close
* @returns IGameLogoutResponseData * @returns IGameLogoutResponseData
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public gameLogout(
public gameLogout(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameLogoutResponseData> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IGameLogoutResponseData>
{ {
this.saveServer.save(); this.saveServer.save();
return this.httpResponse.getBody({ return this.httpResponse.getBody({
status: "ok" status: "ok",
}); });
} }
@ -83,7 +84,11 @@ class GameCallbacks implements OnLoad
* Handle client/game/config * Handle client/game/config
* @returns IGameConfigResponse * @returns IGameConfigResponse
*/ */
public getGameConfig(url: string, info: IGameEmptyCrcRequestData, sessionID: string): IGetBodyResponseData<IGameConfigResponse> public getGameConfig(
url: string,
info: IGameEmptyCrcRequestData,
sessionID: string,
): IGetBodyResponseData<IGameConfigResponse>
{ {
return this.httpResponse.getBody(this.gameController.getGameConfig(sessionID)); return this.httpResponse.getBody(this.gameController.getGameConfig(sessionID));
} }
@ -91,7 +96,6 @@ class GameCallbacks implements OnLoad
/** /**
* Handle client/server/list * Handle client/server/list
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]> public getServer(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IServerDetails[]>
{ {
return this.httpResponse.getBody(this.gameController.getServer(sessionID)); return this.httpResponse.getBody(this.gameController.getServer(sessionID));
@ -100,7 +104,11 @@ class GameCallbacks implements OnLoad
/** /**
* Handle client/match/group/current * Handle client/match/group/current
*/ */
public getCurrentGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICurrentGroupResponse> public getCurrentGroup(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<ICurrentGroupResponse>
{ {
return this.httpResponse.getBody(this.gameController.getCurrentGroup(sessionID)); return this.httpResponse.getBody(this.gameController.getCurrentGroup(sessionID));
} }
@ -108,8 +116,11 @@ class GameCallbacks implements OnLoad
/** /**
* Handle client/checkVersion * Handle client/checkVersion
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public validateGameVersion(
public validateGameVersion(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ICheckVersionResponse> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<ICheckVersionResponse>
{ {
return this.httpResponse.getBody(this.gameController.getValidGameVersion(sessionID)); return this.httpResponse.getBody(this.gameController.getValidGameVersion(sessionID));
} }
@ -118,8 +129,11 @@ class GameCallbacks implements OnLoad
* Handle client/game/keepalive * Handle client/game/keepalive
* @returns IGameKeepAliveResponse * @returns IGameKeepAliveResponse
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public gameKeepalive(
public gameKeepalive(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IGameKeepAliveResponse> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IGameKeepAliveResponse>
{ {
return this.httpResponse.getBody(this.gameController.getKeepAlive(sessionID)); return this.httpResponse.getBody(this.gameController.getKeepAlive(sessionID));
} }
@ -128,20 +142,15 @@ class GameCallbacks implements OnLoad
* Handle singleplayer/settings/version * Handle singleplayer/settings/version
* @returns string * @returns string
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getVersion(url: string, info: IEmptyRequestData, sessionID: string): string public getVersion(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.noBody({ return this.httpResponse.noBody({
Version: this.watermark.getInGameVersionLabel() Version: this.watermark.getInGameVersionLabel(),
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData public reportNickname(url: string, info: IReportNicknameRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
} }
export { GameCallbacks };

View File

@ -7,14 +7,15 @@ import { OnLoad } from "@spt-aki/di/OnLoad";
export class HandbookCallbacks implements OnLoad export class HandbookCallbacks implements OnLoad
{ {
constructor( constructor(
@inject("HandbookController") protected handbookController: HandbookController @inject("HandbookController") protected handbookController: HandbookController,
) )
{ {}
}
public async onLoad(): Promise<void> public async onLoad(): Promise<void>
{ {
this.handbookController.load(); this.handbookController.load();
} }
public getRoute(): string public getRoute(): string
{ {
return "aki-handbook"; return "aki-handbook";

View File

@ -18,7 +18,8 @@ export class HealthCallbacks
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("ProfileHelper") protected profileHelper: ProfileHelper, @inject("ProfileHelper") protected profileHelper: ProfileHelper,
@inject("HealthController") protected healthController: HealthController) @inject("HealthController") protected healthController: HealthController,
)
{} {}
/** /**
@ -44,9 +45,10 @@ export class HealthCallbacks
public handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData<string> public handleWorkoutEffects(url: string, info: IWorkoutData, sessionID: string): IGetBodyResponseData<string>
{ {
this.healthController.applyWorkoutChanges( this.healthController.applyWorkoutChanges(
this.profileHelper.getPmcProfile(sessionID), info, sessionID this.profileHelper.getPmcProfile(sessionID),
info,
sessionID,
); );
return this.httpResponse.emptyResponse(); return this.httpResponse.emptyResponse();
} }
@ -72,7 +74,11 @@ export class HealthCallbacks
* Handle RestoreHealth * Handle RestoreHealth
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
public healthTreatment(pmcData: IPmcData, info: IHealthTreatmentRequestData, sessionID: string): IItemEventRouterResponse public healthTreatment(
pmcData: IPmcData,
info: IHealthTreatmentRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.healthController.healthTreatment(pmcData, info, sessionID); return this.healthController.healthTreatment(pmcData, info, sessionID);
} }

View File

@ -28,7 +28,7 @@ export class HideoutCallbacks implements OnUpdate
constructor( constructor(
@inject("HideoutController") protected hideoutController: HideoutController, // TODO: delay needed @inject("HideoutController") protected hideoutController: HideoutController, // TODO: delay needed
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer,
) )
{ {
this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT); this.hideoutConfig = this.configServer.getConfig(ConfigTypes.HIDEOUT);
@ -45,7 +45,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutUpgradeComplete event * Handle HideoutUpgradeComplete event
*/ */
public upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse public upgradeComplete(
pmcData: IPmcData,
body: IHideoutUpgradeCompleteRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.upgradeComplete(pmcData, body, sessionID); return this.hideoutController.upgradeComplete(pmcData, body, sessionID);
} }
@ -53,7 +57,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutPutItemsInAreaSlots * Handle HideoutPutItemsInAreaSlots
*/ */
public putItemsInAreaSlots(pmcData: IPmcData, body: IHideoutPutItemInRequestData, sessionID: string): IItemEventRouterResponse public putItemsInAreaSlots(
pmcData: IPmcData,
body: IHideoutPutItemInRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.putItemsInAreaSlots(pmcData, body, sessionID); return this.hideoutController.putItemsInAreaSlots(pmcData, body, sessionID);
} }
@ -61,7 +69,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutTakeItemsFromAreaSlots event * Handle HideoutTakeItemsFromAreaSlots event
*/ */
public takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse public takeItemsFromAreaSlots(
pmcData: IPmcData,
body: IHideoutTakeItemOutRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.takeItemsFromAreaSlots(pmcData, body, sessionID); return this.hideoutController.takeItemsFromAreaSlots(pmcData, body, sessionID);
} }
@ -69,7 +81,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutToggleArea event * Handle HideoutToggleArea event
*/ */
public toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse public toggleArea(
pmcData: IPmcData,
body: IHideoutToggleAreaRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.toggleArea(pmcData, body, sessionID); return this.hideoutController.toggleArea(pmcData, body, sessionID);
} }
@ -77,7 +93,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutSingleProductionStart event * Handle HideoutSingleProductionStart event
*/ */
public singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse public singleProductionStart(
pmcData: IPmcData,
body: IHideoutSingleProductionStartRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.singleProductionStart(pmcData, body, sessionID); return this.hideoutController.singleProductionStart(pmcData, body, sessionID);
} }
@ -85,7 +105,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutScavCaseProductionStart event * Handle HideoutScavCaseProductionStart event
*/ */
public scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse public scavCaseProductionStart(
pmcData: IPmcData,
body: IHideoutScavCaseStartRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.scavCaseProductionStart(pmcData, body, sessionID); return this.hideoutController.scavCaseProductionStart(pmcData, body, sessionID);
} }
@ -93,7 +117,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutContinuousProductionStart * Handle HideoutContinuousProductionStart
*/ */
public continuousProductionStart(pmcData: IPmcData, body: IHideoutContinuousProductionStartRequestData, sessionID: string): IItemEventRouterResponse public continuousProductionStart(
pmcData: IPmcData,
body: IHideoutContinuousProductionStartRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.continuousProductionStart(pmcData, body, sessionID); return this.hideoutController.continuousProductionStart(pmcData, body, sessionID);
} }
@ -101,7 +129,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutTakeProduction event * Handle HideoutTakeProduction event
*/ */
public takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse public takeProduction(
pmcData: IPmcData,
body: IHideoutTakeProductionRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.takeProduction(pmcData, body, sessionID); return this.hideoutController.takeProduction(pmcData, body, sessionID);
} }
@ -109,7 +141,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle HideoutQuickTimeEvent * Handle HideoutQuickTimeEvent
*/ */
public handleQTEEvent(pmcData: IPmcData, request: IHandleQTEEventRequestData, sessionId: string): IItemEventRouterResponse public handleQTEEvent(
pmcData: IPmcData,
request: IHandleQTEEventRequestData,
sessionId: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.handleQTEEventOutcome(sessionId, pmcData, request); return this.hideoutController.handleQTEEventOutcome(sessionId, pmcData, request);
} }
@ -117,7 +153,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle client/game/profile/items/moving - RecordShootingRangePoints * Handle client/game/profile/items/moving - RecordShootingRangePoints
*/ */
public recordShootingRangePoints(pmcData: IPmcData, request: IRecordShootingRangePoints, sessionId: string): IItemEventRouterResponse public recordShootingRangePoints(
pmcData: IPmcData,
request: IRecordShootingRangePoints,
sessionId: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.recordShootingRangePoints(sessionId, pmcData, request); return this.hideoutController.recordShootingRangePoints(sessionId, pmcData, request);
} }
@ -125,7 +165,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle client/game/profile/items/moving - RecordShootingRangePoints * Handle client/game/profile/items/moving - RecordShootingRangePoints
*/ */
public improveArea(pmcData: IPmcData, request: IHideoutImproveAreaRequestData, sessionId: string): IItemEventRouterResponse public improveArea(
pmcData: IPmcData,
request: IHideoutImproveAreaRequestData,
sessionId: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.improveArea(sessionId, pmcData, request); return this.hideoutController.improveArea(sessionId, pmcData, request);
} }
@ -133,7 +177,11 @@ export class HideoutCallbacks implements OnUpdate
/** /**
* Handle client/game/profile/items/moving - HideoutCancelProductionCommand * Handle client/game/profile/items/moving - HideoutCancelProductionCommand
*/ */
public cancelProduction(pmcData: IPmcData, request: IHideoutCancelProductionRequestData, sessionId: string): IItemEventRouterResponse public cancelProduction(
pmcData: IPmcData,
request: IHideoutCancelProductionRequestData,
sessionId: string,
): IItemEventRouterResponse
{ {
return this.hideoutController.cancelProduction(sessionId, pmcData, request); return this.hideoutController.cancelProduction(sessionId, pmcData, request);
} }
@ -145,7 +193,6 @@ export class HideoutCallbacks implements OnUpdate
this.hideoutController.update(); this.hideoutController.update();
return true; return true;
} }
return false; return false;
} }

View File

@ -7,10 +7,9 @@ import { HttpServer } from "@spt-aki/servers/HttpServer";
export class HttpCallbacks implements OnLoad export class HttpCallbacks implements OnLoad
{ {
constructor( constructor(
@inject("HttpServer") protected httpServer: HttpServer @inject("HttpServer") protected httpServer: HttpServer,
) )
{ {}
}
public async onLoad(): Promise<void> public async onLoad(): Promise<void>
{ {
@ -22,7 +21,6 @@ export class HttpCallbacks implements OnLoad
return "aki-http"; return "aki-http";
} }
public getImage(): string public getImage(): string
{ {
return ""; return "";

View File

@ -14,7 +14,7 @@ export class InraidCallbacks
{ {
constructor( constructor(
@inject("InraidController") protected inraidController: InraidController, @inject("InraidController") protected inraidController: InraidController,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
) )
{} {}
@ -58,7 +58,6 @@ export class InraidCallbacks
* Handle singleplayer/settings/raid/menu * Handle singleplayer/settings/raid/menu
* @returns JSON as string * @returns JSON as string
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getRaidMenuSettings(): string public getRaidMenuSettings(): string
{ {
return this.httpResponse.noBody(this.inraidController.getInraidConfig().raidMenuSettings); return this.httpResponse.noBody(this.inraidController.getInraidConfig().raidMenuSettings);

View File

@ -22,7 +22,7 @@ export class InsuranceCallbacks implements OnUpdate
@inject("InsuranceController") protected insuranceController: InsuranceController, @inject("InsuranceController") protected insuranceController: InsuranceController,
@inject("InsuranceService") protected insuranceService: InsuranceService, @inject("InsuranceService") protected insuranceService: InsuranceService,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer,
) )
{ {
this.insuranceConfig = this.configServer.getConfig(ConfigTypes.INSURANCE); this.insuranceConfig = this.configServer.getConfig(ConfigTypes.INSURANCE);
@ -32,7 +32,11 @@ export class InsuranceCallbacks implements OnUpdate
* Handle client/insurance/items/list/cost * Handle client/insurance/items/list/cost
* @returns IGetInsuranceCostResponseData * @returns IGetInsuranceCostResponseData
*/ */
public getInsuranceCost(url: string, info: IGetInsuranceCostRequestData, sessionID: string): IGetBodyResponseData<IGetInsuranceCostResponseData> public getInsuranceCost(
url: string,
info: IGetInsuranceCostRequestData,
sessionID: string,
): IGetBodyResponseData<IGetInsuranceCostResponseData>
{ {
return this.httpResponse.getBody(this.insuranceController.cost(info, sessionID)); return this.httpResponse.getBody(this.insuranceController.cost(info, sessionID));
} }
@ -53,7 +57,6 @@ export class InsuranceCallbacks implements OnUpdate
this.insuranceController.processReturn(); this.insuranceController.processReturn();
return true; return true;
} }
return false; return false;
} }

View File

@ -25,7 +25,7 @@ import { IItemEventRouterResponse } from "@spt-aki/models/eft/itemEvent/IItemEve
export class InventoryCallbacks export class InventoryCallbacks
{ {
constructor( constructor(
@inject("InventoryController") protected inventoryController: InventoryController @inject("InventoryController") protected inventoryController: InventoryController,
) )
{} {}
@ -52,7 +52,11 @@ export class InventoryCallbacks
return this.inventoryController.mergeItem(pmcData, body, sessionID); return this.inventoryController.mergeItem(pmcData, body, sessionID);
} }
public transferItem(pmcData: IPmcData, body: IInventoryTransferRequestData, sessionID: string): IItemEventRouterResponse public transferItem(
pmcData: IPmcData,
body: IInventoryTransferRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.transferItem(pmcData, body, sessionID); return this.inventoryController.transferItem(pmcData, body, sessionID);
} }
@ -84,40 +88,68 @@ export class InventoryCallbacks
return this.inventoryController.bindItem(pmcData, body, sessionID); return this.inventoryController.bindItem(pmcData, body, sessionID);
} }
public examineItem(pmcData: IPmcData, body: IInventoryExamineRequestData, sessionID: string): IItemEventRouterResponse public examineItem(
pmcData: IPmcData,
body: IInventoryExamineRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.examineItem(pmcData, body, sessionID); return this.inventoryController.examineItem(pmcData, body, sessionID);
} }
/** Handle ReadEncyclopedia */ /** Handle ReadEncyclopedia */
public readEncyclopedia(pmcData: IPmcData, body: IInventoryReadEncyclopediaRequestData, sessionID: string): IItemEventRouterResponse public readEncyclopedia(
pmcData: IPmcData,
body: IInventoryReadEncyclopediaRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.readEncyclopedia(pmcData, body, sessionID); return this.inventoryController.readEncyclopedia(pmcData, body, sessionID);
} }
/** Handle ApplyInventoryChanges */ /** Handle ApplyInventoryChanges */
public sortInventory(pmcData: IPmcData, body: IInventorySortRequestData, sessionID: string): IItemEventRouterResponse public sortInventory(
pmcData: IPmcData,
body: IInventorySortRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.sortInventory(pmcData, body, sessionID); return this.inventoryController.sortInventory(pmcData, body, sessionID);
} }
public createMapMarker(pmcData: IPmcData, body: IInventoryCreateMarkerRequestData, sessionID: string): IItemEventRouterResponse public createMapMarker(
pmcData: IPmcData,
body: IInventoryCreateMarkerRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.createMapMarker(pmcData, body, sessionID); return this.inventoryController.createMapMarker(pmcData, body, sessionID);
} }
public deleteMapMarker(pmcData: IPmcData, body: IInventoryDeleteMarkerRequestData, sessionID: string): IItemEventRouterResponse public deleteMapMarker(
pmcData: IPmcData,
body: IInventoryDeleteMarkerRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.deleteMapMarker(pmcData, body, sessionID); return this.inventoryController.deleteMapMarker(pmcData, body, sessionID);
} }
public editMapMarker(pmcData: IPmcData, body: IInventoryEditMarkerRequestData, sessionID: string): IItemEventRouterResponse public editMapMarker(
pmcData: IPmcData,
body: IInventoryEditMarkerRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.editMapMarker(pmcData, body, sessionID); return this.inventoryController.editMapMarker(pmcData, body, sessionID);
} }
/** Handle OpenRandomLootContainer */ /** Handle OpenRandomLootContainer */
public openRandomLootContainer(pmcData: IPmcData, body: IOpenRandomLootContainerRequestData, sessionID: string): IItemEventRouterResponse public openRandomLootContainer(
pmcData: IPmcData,
body: IOpenRandomLootContainerRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.inventoryController.openRandomLootContainer(pmcData, body, sessionID); return this.inventoryController.openRandomLootContainer(pmcData, body, sessionID);
} }

View File

@ -13,16 +13,25 @@ export class ItemEventCallbacks
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("ItemEventRouter") protected itemEventRouter: ItemEventRouter @inject("ItemEventRouter") protected itemEventRouter: ItemEventRouter,
) )
{} {}
public handleEvents(url: string, info: IItemEventRouterRequest, sessionID: string): IGetBodyResponseData<IItemEventRouterResponse> public handleEvents(
url: string,
info: IItemEventRouterRequest,
sessionID: string,
): IGetBodyResponseData<IItemEventRouterResponse>
{ {
const eventResponse = this.itemEventRouter.handleEvents(info, sessionID); const eventResponse = this.itemEventRouter.handleEvents(info, sessionID);
const result = (eventResponse.warnings.length > 0) const result = (eventResponse.warnings.length > 0) ?
? this.httpResponse.getBody(eventResponse, this.getErrorCode(eventResponse.warnings), eventResponse.warnings[0].errmsg) // TODO: map 228 to its enum value this.httpResponse.getBody(
: this.httpResponse.getBody(eventResponse); eventResponse,
this.getErrorCode(eventResponse.warnings),
eventResponse.warnings[0].errmsg,
) // TODO: map 228 to its enum value
:
this.httpResponse.getBody(eventResponse);
return result; return result;
} }
@ -33,7 +42,6 @@ export class ItemEventCallbacks
{ {
return Number(warnings[0].code); return Number(warnings[0].code);
} }
return BackendErrorCodes.UNKNOWN_ERROR; return BackendErrorCodes.UNKNOWN_ERROR;
} }
} }

View File

@ -11,13 +11,13 @@ import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
import { Watermark } from "@spt-aki/utils/Watermark"; import { Watermark } from "@spt-aki/utils/Watermark";
@injectable() @injectable()
class LauncherCallbacks export class LauncherCallbacks
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("LauncherController") protected launcherController: LauncherController, @inject("LauncherController") protected launcherController: LauncherController,
@inject("SaveServer") protected saveServer: SaveServer, @inject("SaveServer") protected saveServer: SaveServer,
@inject("Watermark") protected watermark: Watermark @inject("Watermark") protected watermark: Watermark,
) )
{} {}
@ -26,42 +26,36 @@ class LauncherCallbacks
return this.httpResponse.noBody(this.launcherController.connect()); return this.httpResponse.noBody(this.launcherController.connect());
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public login(url: string, info: ILoginRequestData, sessionID: string): string public login(url: string, info: ILoginRequestData, sessionID: string): string
{ {
const output = this.launcherController.login(info); const output = this.launcherController.login(info);
return (!output) ? "FAILED" : output; return (!output) ? "FAILED" : output;
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public register(url: string, info: IRegisterData, sessionID: string): "FAILED" | "OK" public register(url: string, info: IRegisterData, sessionID: string): "FAILED" | "OK"
{ {
const output = this.launcherController.register(info); const output = this.launcherController.register(info);
return (!output) ? "FAILED" : "OK"; return (!output) ? "FAILED" : "OK";
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public get(url: string, info: ILoginRequestData, sessionID: string): string public get(url: string, info: ILoginRequestData, sessionID: string): string
{ {
const output = this.launcherController.find(this.launcherController.login(info)); const output = this.launcherController.find(this.launcherController.login(info));
return this.httpResponse.noBody(output); return this.httpResponse.noBody(output);
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public changeUsername(url: string, info: IChangeRequestData, sessionID: string): "FAILED" | "OK" public changeUsername(url: string, info: IChangeRequestData, sessionID: string): "FAILED" | "OK"
{ {
const output = this.launcherController.changeUsername(info); const output = this.launcherController.changeUsername(info);
return (!output) ? "FAILED" : "OK"; return (!output) ? "FAILED" : "OK";
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public changePassword(url: string, info: IChangeRequestData, sessionID: string): "FAILED" | "OK" public changePassword(url: string, info: IChangeRequestData, sessionID: string): "FAILED" | "OK"
{ {
const output = this.launcherController.changePassword(info); const output = this.launcherController.changePassword(info);
return (!output) ? "FAILED" : "OK"; return (!output) ? "FAILED" : "OK";
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public wipe(url: string, info: IRegisterData, sessionID: string): "FAILED" | "OK" public wipe(url: string, info: IRegisterData, sessionID: string): "FAILED" | "OK"
{ {
const output = this.launcherController.wipe(info); const output = this.launcherController.wipe(info);
@ -73,7 +67,6 @@ class LauncherCallbacks
return this.httpResponse.noBody(this.watermark.getVersionTag()); return this.httpResponse.noBody(this.watermark.getVersionTag());
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public ping(url: string, info: IEmptyRequestData, sessionID: string): string public ping(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.noBody("pong!"); return this.httpResponse.noBody("pong!");
@ -99,6 +92,3 @@ class LauncherCallbacks
return this.httpResponse.noBody(this.launcherController.getServerModsProfileUsed(sessionId)); return this.httpResponse.noBody(this.launcherController.getServerModsProfileUsed(sessionId));
} }
} }
export { LauncherCallbacks };

View File

@ -13,26 +13,31 @@ export class LocationCallbacks
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("LocationController") protected locationController: LocationController @inject("LocationController") protected locationController: LocationController,
) )
{} {}
/** Handle client/locations */ /** Handle client/locations */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getLocationData(
public getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse> url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<ILocationsGenerateAllResponse>
{ {
return this.httpResponse.getBody(this.locationController.generateAll(sessionID)); return this.httpResponse.getBody(this.locationController.generateAll(sessionID));
} }
/** Handle client/location/getLocalloot */ /** Handle client/location/getLocalloot */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getLocation(
public getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase> url: string,
info: IGetLocationRequestData,
sessionID: string,
): IGetBodyResponseData<ILocationBase>
{ {
return this.httpResponse.getBody(this.locationController.get(sessionID, info)); return this.httpResponse.getBody(this.locationController.get(sessionID, info));
} }
/** Handle client/location/getAirdropLoot */ /** Handle client/location/getAirdropLoot */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string public getAirdropLoot(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.noBody(this.locationController.getAirdropLoot()); return this.httpResponse.noBody(this.locationController.getAirdropLoot());

View File

@ -31,53 +31,50 @@ export class MatchCallbacks
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("JsonUtil") protected jsonUtil: JsonUtil, @inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("MatchController") protected matchController: MatchController, @inject("MatchController") protected matchController: MatchController,
@inject("DatabaseServer") protected databaseServer: DatabaseServer @inject("DatabaseServer") protected databaseServer: DatabaseServer,
) )
{} {}
/** Handle client/match/updatePing */ /** Handle client/match/updatePing */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData public updatePing(url: string, info: IUpdatePingRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// Handle client/match/exit // Handle client/match/exit
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public exitMatch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/match/group/exit_from_menu */ /** Handle client/match/group/exit_from_menu */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public exitToMenu(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public startGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData public stopGroupSearch(url: string, info: IEmptyRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/match/group/invite/send */ /** Handle client/match/group/invite/send */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string> public sendGroupInvite(url: string, info: ISendGroupInviteRequest, sessionID: string): IGetBodyResponseData<string>
{ {
return this.httpResponse.getBody("2427943f23698ay9f2863735"); return this.httpResponse.getBody("2427943f23698ay9f2863735");
} }
/** Handle client/match/group/invite/accept */ /** Handle client/match/group/invite/accept */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public acceptGroupInvite(
public acceptGroupInvite(url: string, info: IAcceptGroupInviteRequest, sessionID: string): IGetBodyResponseData<IAcceptGroupInviteResponse[]> url: string,
info: IAcceptGroupInviteRequest,
sessionID: string,
): IGetBodyResponseData<IAcceptGroupInviteResponse[]>
{ {
const result = []; const result = [];
result.push({}); result.push({});
@ -86,41 +83,40 @@ export class MatchCallbacks
} }
/** Handle client/match/group/invite/cancel */ /** Handle client/match/group/invite/cancel */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public cancelGroupInvite(
public cancelGroupInvite(url: string, info: ICancelGroupInviteRequest, sessionID: string): IGetBodyResponseData<boolean> url: string,
info: ICancelGroupInviteRequest,
sessionID: string,
): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/transfer */ /** Handle client/match/group/transfer */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean> public transferGroup(url: string, info: ITransferGroupRequest, sessionID: string): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/invite/cancel-all */ /** Handle client/match/group/invite/cancel-all */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData public cancelAllGroupInvite(url: string, info: any, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** @deprecated - not called on raid start/end or game start/exit */ /** @deprecated - not called on raid start/end or game start/exit */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData public putMetrics(url: string, info: IPutMetricsRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle raid/profile/list */ /** Handle raid/profile/list */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]> public getProfile(url: string, info: IGetProfileRequestData, sessionID: string): IGetBodyResponseData<IPmcData[]>
{ {
return this.httpResponse.getBody(this.matchController.getProfile(info)); return this.httpResponse.getBody(this.matchController.getProfile(info));
} }
// Handle client/match/available // Handle client/match/available
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean> public serverAvailable(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>
{ {
const output = this.matchController.getEnabled(); const output = this.matchController.getEnabled();
@ -129,13 +125,16 @@ export class MatchCallbacks
} }
/** Handle match/group/start_game */ /** Handle match/group/start_game */
public joinMatch(url: string, info: IJoinMatchRequestData, sessionID: string): IGetBodyResponseData<IJoinMatchResult> public joinMatch(
url: string,
info: IJoinMatchRequestData,
sessionID: string,
): IGetBodyResponseData<IJoinMatchResult>
{ {
return this.httpResponse.getBody(this.matchController.joinMatch(info, sessionID)); return this.httpResponse.getBody(this.matchController.joinMatch(info, sessionID));
} }
/** Handle client/getMetricsConfig */ /** Handle client/getMetricsConfig */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string> public getMetrics(url: string, info: any, sessionID: string): IGetBodyResponseData<string>
{ {
return this.httpResponse.getBody(this.jsonUtil.serialize(this.databaseServer.getTables().match.metrics)); return this.httpResponse.getBody(this.jsonUtil.serialize(this.databaseServer.getTables().match.metrics));
@ -146,7 +145,6 @@ export class MatchCallbacks
* Handle client/match/group/status * Handle client/match/group/status
* @returns * @returns
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any> public getGroupStatus(url: string, info: IGetGroupStatusRequestData, sessionID: string): IGetBodyResponseData<any>
{ {
return this.httpResponse.getBody(this.matchController.getGroupStatus(info)); return this.httpResponse.getBody(this.matchController.getGroupStatus(info));
@ -159,7 +157,6 @@ export class MatchCallbacks
} }
/** Handle client/match/group/delete */ /** Handle client/match/group/delete */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public deleteGroup(url: string, info: any, sessionID: string): INullResponseData public deleteGroup(url: string, info: any, sessionID: string): INullResponseData
{ {
this.matchController.deleteGroup(info); this.matchController.deleteGroup(info);
@ -167,14 +164,12 @@ export class MatchCallbacks
} }
// Handle client/match/group/leave // Handle client/match/group/leave
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean> public leaveGroup(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<boolean>
{ {
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/player/remove */ /** Handle client/match/group/player/remove */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData public removePlayerFromGroup(url: string, info: IRemovePlayerFromGroupRequest, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
@ -188,7 +183,11 @@ export class MatchCallbacks
} }
/** Handle client/raid/configuration */ /** Handle client/raid/configuration */
public getRaidConfiguration(url: string, info: IGetRaidConfigurationRequestData, sessionID: string): INullResponseData public getRaidConfiguration(
url: string,
info: IGetRaidConfigurationRequestData,
sessionID: string,
): INullResponseData
{ {
this.matchController.startOfflineRaid(info, sessionID); this.matchController.startOfflineRaid(info, sessionID);
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();

View File

@ -11,7 +11,7 @@ import { HttpFileUtil } from "@spt-aki/utils/HttpFileUtil";
import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil"; import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
@injectable() @injectable()
class ModCallbacks implements OnLoad export class ModCallbacks implements OnLoad
{ {
protected httpConfig: IHttpConfig; protected httpConfig: IHttpConfig;
@ -21,7 +21,7 @@ class ModCallbacks implements OnLoad
@inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil, @inject("HttpFileUtil") protected httpFileUtil: HttpFileUtil,
@inject("PostAkiModLoader") protected postAkiModLoader: PostAkiModLoader, @inject("PostAkiModLoader") protected postAkiModLoader: PostAkiModLoader,
@inject("LocalisationService") protected localisationService: LocalisationService, @inject("LocalisationService") protected localisationService: LocalisationService,
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer,
) )
{ {
this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP); this.httpConfig = this.configServer.getConfig(ConfigTypes.HTTP);
@ -40,6 +40,3 @@ class ModCallbacks implements OnLoad
return "aki-mods"; return "aki-mods";
} }
} }
export { ModCallbacks };

View File

@ -9,7 +9,8 @@ import { INoteActionData } from "@spt-aki/models/eft/notes/INoteActionData";
export class NoteCallbacks export class NoteCallbacks
{ {
constructor( constructor(
@inject("NoteController") protected noteController: NoteController) @inject("NoteController") protected noteController: NoteController,
)
{} {}
/** Handle AddNote event */ /** Handle AddNote event */

View File

@ -17,7 +17,8 @@ export class NotifierCallbacks
@inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper, @inject("HttpServerHelper") protected httpServerHelper: HttpServerHelper,
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("JsonUtil") protected jsonUtil: JsonUtil, @inject("JsonUtil") protected jsonUtil: JsonUtil,
@inject("NotifierController") protected notifierController: NotifierController) @inject("NotifierController") protected notifierController: NotifierController,
)
{} {}
/** /**
@ -26,7 +27,6 @@ export class NotifierCallbacks
* until we actually have something to send because otherwise we'd spam the client * until we actually have something to send because otherwise we'd spam the client
* and the client would abort the connection due to spam. * and the client would abort the connection due to spam.
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendNotification(sessionID: string, req: any, resp: any, data: any): void public sendNotification(sessionID: string, req: any, resp: any, data: any): void
{ {
const splittedUrl = req.url.split("/"); const splittedUrl = req.url.split("/");
@ -43,14 +43,17 @@ export class NotifierCallbacks
/** Handle push/notifier/get */ /** Handle push/notifier/get */
/** Handle push/notifier/getwebsocket */ /** Handle push/notifier/getwebsocket */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]> public getNotifier(url: string, info: any, sessionID: string): IGetBodyResponseData<any[]>
{ {
return this.httpResponse.emptyArrayResponse(); return this.httpResponse.emptyArrayResponse();
} }
/** Handle client/notifier/channel/create */ /** Handle client/notifier/channel/create */
public createNotifierChannel(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<INotifierChannel> public createNotifierChannel(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<INotifierChannel>
{ {
return this.httpResponse.getBody(this.notifierController.getChannel(sessionID)); return this.httpResponse.getBody(this.notifierController.getChannel(sessionID));
} }
@ -59,15 +62,17 @@ export class NotifierCallbacks
* Handle client/game/profile/select * Handle client/game/profile/select
* @returns ISelectProfileResponse * @returns ISelectProfileResponse
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public selectProfile(
public selectProfile(url: string, info: ISelectProfileRequestData, sessionID: string): IGetBodyResponseData<ISelectProfileResponse> url: string,
info: ISelectProfileRequestData,
sessionID: string,
): IGetBodyResponseData<ISelectProfileResponse>
{ {
return this.httpResponse.getBody({ return this.httpResponse.getBody({
status: "ok" status: "ok",
}); });
} }
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public notify(url: string, info: any, sessionID: string): string public notify(url: string, info: any, sessionID: string): string
{ {
return "NOTIFY"; return "NOTIFY";

View File

@ -15,17 +15,26 @@ export class PresetBuildCallbacks
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("PresetBuildController") protected presetBuildController: PresetBuildController) @inject("PresetBuildController") protected presetBuildController: PresetBuildController,
)
{} {}
/** Handle client/handbook/builds/my/list */ /** Handle client/handbook/builds/my/list */
public getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IUserBuilds> public getHandbookUserlist(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IUserBuilds>
{ {
return this.httpResponse.getBody(this.presetBuildController.getUserBuilds(sessionID)); return this.httpResponse.getBody(this.presetBuildController.getUserBuilds(sessionID));
} }
/** Handle SaveWeaponBuild event */ /** Handle SaveWeaponBuild event */
public saveWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public saveWeaponBuild(
pmcData: IPmcData,
body: IPresetBuildActionRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.presetBuildController.saveWeaponBuild(pmcData, body, sessionID); return this.presetBuildController.saveWeaponBuild(pmcData, body, sessionID);
} }
@ -37,19 +46,31 @@ export class PresetBuildCallbacks
} }
/** Handle RemoveWeaponBuild event*/ /** Handle RemoveWeaponBuild event*/
public removeWeaponBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public removeWeaponBuild(
pmcData: IPmcData,
body: IPresetBuildActionRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.presetBuildController.removeWeaponBuild(pmcData, body, sessionID); return this.presetBuildController.removeWeaponBuild(pmcData, body, sessionID);
} }
/** Handle SaveEquipmentBuild event */ /** Handle SaveEquipmentBuild event */
public saveEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public saveEquipmentBuild(
pmcData: IPmcData,
body: IPresetBuildActionRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.presetBuildController.saveEquipmentBuild(pmcData, body, sessionID); return this.presetBuildController.saveEquipmentBuild(pmcData, body, sessionID);
} }
/** Handle RemoveEquipmentBuild event*/ /** Handle RemoveEquipmentBuild event*/
public removeEquipmentBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public removeEquipmentBuild(
pmcData: IPmcData,
body: IPresetBuildActionRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.presetBuildController.removeEquipmentBuild(pmcData, body, sessionID); return this.presetBuildController.removeEquipmentBuild(pmcData, body, sessionID);
} }

View File

@ -7,9 +7,9 @@ import { OnLoad } from "@spt-aki/di/OnLoad";
export class PresetCallbacks implements OnLoad export class PresetCallbacks implements OnLoad
{ {
constructor( constructor(
@inject("PresetController") protected presetController: PresetController) @inject("PresetController") protected presetController: PresetController,
{ )
} {}
public async onLoad(): Promise<void> public async onLoad(): Promise<void>
{ {

View File

@ -24,7 +24,8 @@ export class ProfileCallbacks
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("TimeUtil") protected timeUtil: TimeUtil, @inject("TimeUtil") protected timeUtil: TimeUtil,
@inject("ProfileController") protected profileController: ProfileController) @inject("ProfileController") protected profileController: ProfileController,
)
{} {}
/** /**
@ -72,7 +73,11 @@ export class ProfileCallbacks
* Handle client/game/profile/nickname/change event * Handle client/game/profile/nickname/change event
* Client allows player to adjust their profile name * Client allows player to adjust their profile name
*/ */
public changeNickname(url: string, info: IProfileChangeNicknameRequestData, sessionID: string): IGetBodyResponseData<any> public changeNickname(
url: string,
info: IProfileChangeNicknameRequestData,
sessionID: string,
): IGetBodyResponseData<any>
{ {
const output = this.profileController.changeNickname(info, sessionID); const output = this.profileController.changeNickname(info, sessionID);
@ -88,14 +93,18 @@ export class ProfileCallbacks
return this.httpResponse.getBody({ return this.httpResponse.getBody({
status: 0, status: 0,
nicknamechangedate: this.timeUtil.getTimestamp() nicknamechangedate: this.timeUtil.getTimestamp(),
}); });
} }
/** /**
* Handle client/game/profile/nickname/validate * Handle client/game/profile/nickname/validate
*/ */
public validateNickname(url: string, info: IValidateNicknameRequestData, sessionID: string): IGetBodyResponseData<any> public validateNickname(
url: string,
info: IValidateNicknameRequestData,
sessionID: string,
): IGetBodyResponseData<any>
{ {
const output = this.profileController.validateNickname(info, sessionID); const output = this.profileController.validateNickname(info, sessionID);
@ -115,7 +124,6 @@ export class ProfileCallbacks
/** /**
* Handle client/game/profile/nickname/reserved * Handle client/game/profile/nickname/reserved
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string> public getReservedNickname(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<string>
{ {
return this.httpResponse.getBody("SPTarkov"); return this.httpResponse.getBody("SPTarkov");
@ -125,7 +133,11 @@ export class ProfileCallbacks
* Handle client/profile/status * Handle client/profile/status
* Called when creating a character when choosing a character face/voice * Called when creating a character when choosing a character face/voice
*/ */
public getProfileStatus(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<GetProfileStatusResponseData> public getProfileStatus(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<GetProfileStatusResponseData>
{ {
const response: GetProfileStatusResponseData = { const response: GetProfileStatusResponseData = {
maxPveCountExceeded: false, maxPveCountExceeded: false,
@ -141,8 +153,7 @@ export class ProfileCallbacks
location: "bigmap", location: "bigmap",
raidMode: "Online", raidMode: "Online",
mode: "deathmatch", mode: "deathmatch",
shortId: "xxx1x1" shortId: "xxx1x1",
}, },
{ {
profileid: `pmc${sessionID}`, profileid: `pmc${sessionID}`,
@ -150,9 +161,9 @@ export class ProfileCallbacks
status: "Free", status: "Free",
sid: "", sid: "",
ip: "", ip: "",
port: 0 port: 0,
} },
] ],
}; };
return this.httpResponse.getBody(response); return this.httpResponse.getBody(response);
@ -161,8 +172,11 @@ export class ProfileCallbacks
/** /**
* Handle client/profile/settings * Handle client/profile/settings
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getProfileSettings(
public getProfileSettings(url: string, info: IGetProfileSettingsRequest, sessionId: string): IGetBodyResponseData<string> url: string,
info: IGetProfileSettingsRequest,
sessionId: string,
): IGetBodyResponseData<string>
{ {
return this.httpResponse.emptyResponse(); return this.httpResponse.emptyResponse();
} }
@ -170,7 +184,11 @@ export class ProfileCallbacks
/** /**
* Handle client/game/profile/search * Handle client/game/profile/search
*/ */
public searchFriend(url: string, info: ISearchFriendRequestData, sessionID: string): IGetBodyResponseData<ISearchFriendResponse[]> public searchFriend(
url: string,
info: ISearchFriendRequestData,
sessionID: string,
): IGetBodyResponseData<ISearchFriendResponse[]>
{ {
return this.httpResponse.getBody(this.profileController.getFriends(info, sessionID)); return this.httpResponse.getBody(this.profileController.getFriends(info, sessionID));
} }
@ -186,7 +204,6 @@ export class ProfileCallbacks
/** /**
* Handle /launcher/profiles * Handle /launcher/profiles
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getAllMiniProfiles(url: string, info: IEmptyRequestData, sessionID: string): string public getAllMiniProfiles(url: string, info: IEmptyRequestData, sessionID: string): string
{ {
return this.httpResponse.noBody(this.profileController.getMiniProfiles()); return this.httpResponse.noBody(this.profileController.getMiniProfiles());

View File

@ -21,13 +21,18 @@ export class QuestCallbacks
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("QuestController") protected questController: QuestController, @inject("QuestController") protected questController: QuestController,
@inject("RepeatableQuestController") protected repeatableQuestController: RepeatableQuestController) @inject("RepeatableQuestController") protected repeatableQuestController: RepeatableQuestController,
)
{} {}
/** /**
* Handle RepeatableQuestChange event * Handle RepeatableQuestChange event
*/ */
public changeRepeatableQuest(pmcData: IPmcData, body: IRepeatableQuestChangeRequest, sessionID: string): IItemEventRouterResponse public changeRepeatableQuest(
pmcData: IPmcData,
body: IRepeatableQuestChangeRequest,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.repeatableQuestController.changeRepeatableQuest(pmcData, body, sessionID); return this.repeatableQuestController.changeRepeatableQuest(pmcData, body, sessionID);
} }
@ -41,14 +46,17 @@ export class QuestCallbacks
{ {
return this.questController.acceptRepeatableQuest(pmcData, body, sessionID); return this.questController.acceptRepeatableQuest(pmcData, body, sessionID);
} }
return this.questController.acceptQuest(pmcData, body, sessionID); return this.questController.acceptQuest(pmcData, body, sessionID);
} }
/** /**
* Handle QuestComplete event * Handle QuestComplete event
*/ */
public completeQuest(pmcData: IPmcData, body: ICompleteQuestRequestData, sessionID: string): IItemEventRouterResponse public completeQuest(
pmcData: IPmcData,
body: ICompleteQuestRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.questController.completeQuest(pmcData, body, sessionID); return this.questController.completeQuest(pmcData, body, sessionID);
} }
@ -56,7 +64,11 @@ export class QuestCallbacks
/** /**
* Handle QuestHandover event * Handle QuestHandover event
*/ */
public handoverQuest(pmcData: IPmcData, body: IHandoverQuestRequestData, sessionID: string): IItemEventRouterResponse public handoverQuest(
pmcData: IPmcData,
body: IHandoverQuestRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.questController.handoverQuest(pmcData, body, sessionID); return this.questController.handoverQuest(pmcData, body, sessionID);
} }
@ -72,7 +84,11 @@ export class QuestCallbacks
/** /**
* Handle client/repeatalbeQuests/activityPeriods * Handle client/repeatalbeQuests/activityPeriods
*/ */
public activityPeriods(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IPmcDataRepeatableQuest[]> public activityPeriods(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<IPmcDataRepeatableQuest[]>
{ {
return this.httpResponse.getBody(this.repeatableQuestController.getClientRepeatableQuests(info, sessionID)); return this.httpResponse.getBody(this.repeatableQuestController.getClientRepeatableQuests(info, sessionID));
} }

View File

@ -39,7 +39,7 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
@inject("RagfairServer") protected ragfairServer: RagfairServer, @inject("RagfairServer") protected ragfairServer: RagfairServer,
@inject("RagfairController") protected ragfairController: RagfairController, @inject("RagfairController") protected ragfairController: RagfairController,
@inject("RagfairTaxService") protected ragfairTaxService: RagfairTaxService, @inject("RagfairTaxService") protected ragfairTaxService: RagfairTaxService,
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer,
) )
{ {
this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR); this.ragfairConfig = this.configServer.getConfig(ConfigTypes.RAGFAIR);
@ -67,7 +67,6 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
return true; return true;
} }
return false; return false;
} }
@ -81,8 +80,11 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
} }
/** Handle client/ragfair/itemMarketPrice */ /** Handle client/ragfair/itemMarketPrice */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getMarketPrice(
public getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult> url: string,
info: IGetMarketPriceRequestData,
sessionID: string,
): IGetBodyResponseData<IGetItemPriceResult>
{ {
return this.httpResponse.getBody(this.ragfairController.getItemMinAvgMaxFleaPriceValues(info)); return this.httpResponse.getBody(this.ragfairController.getItemMinAvgMaxFleaPriceValues(info));
} }
@ -93,7 +95,7 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
return this.ragfairController.addPlayerOffer(pmcData, info, sessionID); return this.ragfairController.addPlayerOffer(pmcData, info, sessionID);
} }
/** \Handle RagFairRemoveOffer event */ /** Handle RagFairRemoveOffer event */
public removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse public removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse
{ {
return this.ragfairController.removeOffer(info.offerId, sessionID); return this.ragfairController.removeOffer(info.offerId, sessionID);
@ -109,23 +111,28 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
* Handle /client/items/prices * Handle /client/items/prices
* Called when clicking an item to list on flea * Called when clicking an item to list on flea
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars public getFleaPrices(
public getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>> url: string,
request: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<Record<string, number>>
{ {
return this.httpResponse.getBody(this.ragfairController.getAllFleaPrices()); return this.httpResponse.getBody(this.ragfairController.getAllFleaPrices());
} }
/** Handle client/reports/ragfair/send */ /** Handle client/reports/ragfair/send */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData public sendReport(url: string, info: ISendRagfairReportRequestData, sessionID: string): INullResponseData
{ {
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
public storePlayerOfferTaxAmount(url: string, request: IStorePlayerOfferTaxAmountRequestData, sessionId: string): INullResponseData public storePlayerOfferTaxAmount(
url: string,
request: IStorePlayerOfferTaxAmountRequestData,
sessionId: string,
): INullResponseData
{ {
this.ragfairTaxService.storeClientOfferTaxValue(sessionId, request); this.ragfairTaxService.storeClientOfferTaxValue(sessionId, request);
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
} }

View File

@ -10,7 +10,8 @@ import { ITraderRepairActionDataRequest } from "@spt-aki/models/eft/repair/ITrad
export class RepairCallbacks export class RepairCallbacks
{ {
constructor( constructor(
@inject("RepairController") protected repairController: RepairController) @inject("RepairController") protected repairController: RepairController,
)
{} {}
/** /**
@ -21,7 +22,11 @@ export class RepairCallbacks
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
public traderRepair(pmcData: IPmcData, traderRepairRequest: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse public traderRepair(
pmcData: IPmcData,
traderRepairRequest: ITraderRepairActionDataRequest,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.repairController.traderRepair(sessionID, traderRepairRequest, pmcData); return this.repairController.traderRepair(sessionID, traderRepairRequest, pmcData);
} }
@ -34,7 +39,11 @@ export class RepairCallbacks
* @param sessionID Session id * @param sessionID Session id
* @returns IItemEventRouterResponse * @returns IItemEventRouterResponse
*/ */
public repair(pmcData: IPmcData, repairRequest: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse public repair(
pmcData: IPmcData,
repairRequest: IRepairActionDataRequest,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.repairController.repairWithKit(sessionID, repairRequest, pmcData); return this.repairController.repairWithKit(sessionID, repairRequest, pmcData);
} }

View File

@ -14,7 +14,7 @@ export class SaveCallbacks implements OnLoad, OnUpdate
constructor( constructor(
@inject("SaveServer") protected saveServer: SaveServer, @inject("SaveServer") protected saveServer: SaveServer,
@inject("ConfigServer") protected configServer: ConfigServer @inject("ConfigServer") protected configServer: ConfigServer,
) )
{ {
this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE); this.coreConfig = this.configServer.getConfig(ConfigTypes.CORE);
@ -38,7 +38,6 @@ export class SaveCallbacks implements OnLoad, OnUpdate
this.saveServer.save(); this.saveServer.save();
return true; return true;
} }
return false; return false;
} }
} }

View File

@ -11,27 +11,39 @@ import { ISellScavItemsToFenceRequestData } from "@spt-aki/models/eft/trade/ISel
export class TradeCallbacks export class TradeCallbacks
{ {
constructor( constructor(
@inject("TradeController") protected tradeController: TradeController @inject("TradeController") protected tradeController: TradeController,
) )
{} {}
/** /**
* Handle client/game/profile/items/moving TradingConfirm event * Handle client/game/profile/items/moving TradingConfirm event
*/ */
public processTrade(pmcData: IPmcData, body: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse public processTrade(
pmcData: IPmcData,
body: IProcessBaseTradeRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
// body can be IProcessBuyTradeRequestData or IProcessSellTradeRequestData // body can be IProcessBuyTradeRequestData or IProcessSellTradeRequestData
return this.tradeController.confirmTrading(pmcData, body, sessionID); return this.tradeController.confirmTrading(pmcData, body, sessionID);
} }
/** Handle RagFairBuyOffer event */ /** Handle RagFairBuyOffer event */
public processRagfairTrade(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse public processRagfairTrade(
pmcData: IPmcData,
body: IProcessRagfairTradeRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.tradeController.confirmRagfairTrading(pmcData, body, sessionID); return this.tradeController.confirmRagfairTrading(pmcData, body, sessionID);
} }
/** Handle SellAllFromSavage event */ /** Handle SellAllFromSavage event */
public sellAllFromSavage(pmcData: IPmcData, body: ISellScavItemsToFenceRequestData, sessionID: string): IItemEventRouterResponse public sellAllFromSavage(
pmcData: IPmcData,
body: ISellScavItemsToFenceRequestData,
sessionID: string,
): IItemEventRouterResponse
{ {
return this.tradeController.sellScavItemsToFence(pmcData, body, sessionID); return this.tradeController.sellScavItemsToFence(pmcData, body, sessionID);
} }

View File

@ -12,10 +12,11 @@ import { HttpResponseUtil } from "@spt-aki/utils/HttpResponseUtil";
export class TraderCallbacks implements OnLoad, OnUpdate export class TraderCallbacks implements OnLoad, OnUpdate
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, // TODO: delay required
@inject("TraderController") protected traderController: TraderController) // TODO: delay required @inject("TraderController") protected traderController: TraderController,
{ )
} {}
public async onLoad(): Promise<void> public async onLoad(): Promise<void>
{ {
this.traderController.load(); this.traderController.load();
@ -32,7 +33,11 @@ export class TraderCallbacks implements OnLoad, OnUpdate
} }
/** Handle client/trading/api/traderSettings */ /** Handle client/trading/api/traderSettings */
public getTraderSettings(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase[]> public getTraderSettings(
url: string,
info: IEmptyRequestData,
sessionID: string,
): IGetBodyResponseData<ITraderBase[]>
{ {
return this.httpResponse.getBody(this.traderController.getAllTraders(sessionID)); return this.httpResponse.getBody(this.traderController.getAllTraders(sessionID));
} }

View File

@ -11,7 +11,7 @@ export class WeatherCallbacks
{ {
constructor( constructor(
@inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil,
@inject("WeatherController") protected weatherController: WeatherController @inject("WeatherController") protected weatherController: WeatherController,
) )
{} {}
@ -19,7 +19,6 @@ export class WeatherCallbacks
* Handle client/weather * Handle client/weather
* @returns IWeatherData * @returns IWeatherData
*/ */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData> public getWeather(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<IWeatherData>
{ {
return this.httpResponse.getBody(this.weatherController.generate()); return this.httpResponse.getBody(this.weatherController.generate());

View File

@ -9,7 +9,8 @@ import { IWishlistActionData } from "@spt-aki/models/eft/wishlist/IWishlistActio
export class WishlistCallbacks export class WishlistCallbacks
{ {
constructor( constructor(
@inject("WishlistController") protected wishlistController: WishlistController) @inject("WishlistController") protected wishlistController: WishlistController,
)
{} {}
/** Handle AddToWishList event */ /** Handle AddToWishList event */