Additional code comments

This commit is contained in:
Dev 2023-07-15 14:49:25 +01:00
parent 5e3d3f5bd7
commit 295ed59739
28 changed files with 153 additions and 75 deletions

View File

@ -179,12 +179,14 @@ export class DialogueCallbacks implements OnUpdate
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/friend/delete */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number> public sendMessage(url: string, request: ISendMessageRequest, sessionID: string): IGetBodyResponseData<number>
{ {

View File

@ -48,7 +48,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutUpgrade * Handle HideoutUpgrade event
*/ */
public upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse public upgrade(pmcData: IPmcData, body: IHideoutUpgradeRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -56,7 +56,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutUpgradeComplete * Handle HideoutUpgradeComplete event
*/ */
public upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse public upgradeComplete(pmcData: IPmcData, body: IHideoutUpgradeCompleteRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -72,7 +72,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutTakeItemsFromAreaSlots * Handle HideoutTakeItemsFromAreaSlots event
*/ */
public takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse public takeItemsFromAreaSlots(pmcData: IPmcData, body: IHideoutTakeItemOutRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -80,7 +80,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutToggleArea * Handle HideoutToggleArea event
*/ */
public toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse public toggleArea(pmcData: IPmcData, body: IHideoutToggleAreaRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -88,7 +88,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutSingleProductionStart * Handle HideoutSingleProductionStart event
*/ */
public singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse public singleProductionStart(pmcData: IPmcData, body: IHideoutSingleProductionStartRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -96,7 +96,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutScavCaseProductionStart * Handle HideoutScavCaseProductionStart event
*/ */
public scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse public scavCaseProductionStart(pmcData: IPmcData, body: IHideoutScavCaseStartRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -112,7 +112,7 @@ export class HideoutCallbacks implements OnUpdate
} }
/** /**
* Handle HideoutTakeProduction * Handle HideoutTakeProduction event
*/ */
public takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse public takeProduction(pmcData: IPmcData, body: IHideoutTakeProductionRequestData, sessionID: string): IItemEventRouterResponse
{ {

View File

@ -20,6 +20,7 @@ export class InraidCallbacks
/** /**
* Handle client/location/getLocalloot * Handle client/location/getLocalloot
* Store active map in profile + applicationContext
* @param url * @param url
* @param info register player request * @param info register player request
* @param sessionID Session id * @param sessionID Session id

View File

@ -66,6 +66,7 @@ export class InventoryCallbacks
return this.inventoryController.transferItem(pmcData, body, sessionID); return this.inventoryController.transferItem(pmcData, body, sessionID);
} }
/** Handle Swap */
// TODO: how is this triggered // TODO: how is this triggered
public swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse public swapItem(pmcData: IPmcData, body: IInventorySwapRequestData, sessionID: string): IItemEventRouterResponse
{ {
@ -97,11 +98,13 @@ export class InventoryCallbacks
return this.inventoryController.examineItem(pmcData, body, sessionID); return this.inventoryController.examineItem(pmcData, body, sessionID);
} }
/** 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 */
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);
@ -122,6 +125,7 @@ export class InventoryCallbacks
return this.inventoryController.editMapMarker(pmcData, body, sessionID); return this.inventoryController.editMapMarker(pmcData, body, sessionID);
} }
/** 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

@ -19,18 +19,21 @@ export class LocationCallbacks
) )
{ } { }
/** Handle client/locations */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse> public getLocationData(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ILocationsGenerateAllResponse>
{ {
return this.httpResponse.getBody(this.locationController.generateAll()); return this.httpResponse.getBody(this.locationController.generateAll());
} }
/** Handle client/location/getLocalloot */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase> public getLocation(url: string, info: IGetLocationRequestData, sessionID: string): IGetBodyResponseData<ILocationBase>
{ {
return this.httpResponse.getBody(this.locationController.get(info.locationId)); return this.httpResponse.getBody(this.locationController.get(info.locationId));
} }
/** Handle client/location/getAirdropLoot */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {

View File

@ -37,6 +37,7 @@ export class MatchCallbacks
) )
{ } { }
/** Handle client/match/updatePing */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {
@ -50,6 +51,7 @@ export class MatchCallbacks
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/match/group/exit_from_menu */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {
@ -68,6 +70,7 @@ export class MatchCallbacks
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle client/match/group/invite/send */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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>
{ {
@ -97,6 +100,7 @@ export class MatchCallbacks
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/invite/cancel-all */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {
@ -109,6 +113,7 @@ export class MatchCallbacks
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** Handle raid/profile/list */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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[]>
{ {
@ -129,12 +134,13 @@ export class MatchCallbacks
return this.httpResponse.getBody(output); return this.httpResponse.getBody(output);
} }
// 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 */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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>
{ {
@ -151,11 +157,13 @@ export class MatchCallbacks
return this.httpResponse.getBody(this.matchController.getGroupStatus(info)); return this.httpResponse.getBody(this.matchController.getGroupStatus(info));
} }
/** Handle client/match/group/create */
public createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any> public createGroup(url: string, info: ICreateGroupRequestData, sessionID: string): IGetBodyResponseData<any>
{ {
return this.httpResponse.getBody(this.matchController.createGroup(sessionID, info)); return this.httpResponse.getBody(this.matchController.createGroup(sessionID, info));
} }
/** Handle client/match/group/delete */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {
@ -170,18 +178,21 @@ export class MatchCallbacks
return this.httpResponse.getBody(true); return this.httpResponse.getBody(true);
} }
/** Handle client/match/group/player/remove */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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();
} }
/** Handle client/match/offline/end */
public endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData public endOfflineRaid(url: string, info: IEndOfflineRaidRequestData, sessionID: string): INullResponseData
{ {
this.matchController.endOfflineRaid(info, sessionID); this.matchController.endOfflineRaid(info, sessionID);
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** 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);

View File

@ -12,16 +12,19 @@ export class NoteCallbacks
@inject("NoteController") protected noteController: NoteController) @inject("NoteController") protected noteController: NoteController)
{ } { }
/** Handle AddNote event */
public addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse public addNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse
{ {
return this.noteController.addNote(pmcData, body, sessionID); return this.noteController.addNote(pmcData, body, sessionID);
} }
/** Handle EditNote event */
public editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse public editNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse
{ {
return this.noteController.editNote(pmcData, body, sessionID); return this.noteController.editNote(pmcData, body, sessionID);
} }
/** Handle DeleteNote event */
public deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse public deleteNote(pmcData: IPmcData, body: INoteActionData, sessionID: string): IItemEventRouterResponse
{ {
return this.noteController.deleteNote(pmcData, body, sessionID); return this.noteController.deleteNote(pmcData, body, sessionID);

View File

@ -39,12 +39,15 @@ export class NotifierCallbacks
.then((text) => this.httpServerHelper.sendTextJson(resp, text)); .then((text) => this.httpServerHelper.sendTextJson(resp, text));
} }
/** Handle push/notifier/get */
/** Handle push/notifier/getwebsocket */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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 */
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));

View File

@ -19,16 +19,19 @@ export class PresetBuildCallbacks
@inject("PresetBuildController") protected presetBuildController: PresetBuildController) @inject("PresetBuildController") protected presetBuildController: PresetBuildController)
{ } { }
/** Handle client/handbook/builds/my/list */
public getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<WeaponBuild[]> public getHandbookUserlist(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<WeaponBuild[]>
{ {
return this.httpResponse.getBody(this.presetBuildController.getUserBuilds(sessionID)); return this.httpResponse.getBody(this.presetBuildController.getUserBuilds(sessionID));
} }
/** Handle SaveBuild event */
public saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse
{ {
return this.presetBuildController.saveBuild(pmcData, body, sessionID); return this.presetBuildController.saveBuild(pmcData, body, sessionID);
} }
/** Handle RemoveBuild event*/
public removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse
{ {
return this.presetBuildController.removeBuild(pmcData, body, sessionID); return this.presetBuildController.removeBuild(pmcData, body, sessionID);

View File

@ -52,42 +52,6 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
return "aki-ragfair"; return "aki-ragfair";
} }
public search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>
{
return this.httpResponse.getBody(this.ragfairController.getOffers(sessionID, info));
}
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>
{
return this.httpResponse.getBody(this.ragfairController.getItemMinAvgMaxFleaPriceValues(info));
}
public addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse
{
return this.ragfairController.addPlayerOffer(pmcData, info, sessionID);
}
public removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse
{
return this.ragfairController.removeOffer(info.offerId, sessionID);
}
public extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse
{
return this.ragfairController.extendOffer(info, sessionID);
}
/**
* Handle /client/items/prices
* Called when clicking an item to list on flea
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>
{
return this.httpResponse.getBody(this.ragfairController.getAllFleaPrices());
}
public async onUpdate(timeSinceLastRun: number): Promise<boolean> public async onUpdate(timeSinceLastRun: number): Promise<boolean>
{ {
if (timeSinceLastRun > this.ragfairConfig.runIntervalSeconds) if (timeSinceLastRun > this.ragfairConfig.runIntervalSeconds)
@ -104,6 +68,51 @@ export class RagfairCallbacks implements OnLoad, OnUpdate
return false; return false;
} }
/**
* Handle client/ragfair/search
* Handle client/ragfair/find
*/
public search(url: string, info: ISearchRequestData, sessionID: string): IGetBodyResponseData<IGetOffersResult>
{
return this.httpResponse.getBody(this.ragfairController.getOffers(sessionID, info));
}
/** Handle client/ragfair/itemMarketPrice */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getMarketPrice(url: string, info: IGetMarketPriceRequestData, sessionID: string): IGetBodyResponseData<IGetItemPriceResult>
{
return this.httpResponse.getBody(this.ragfairController.getItemMinAvgMaxFleaPriceValues(info));
}
/** Handle RagFairAddOffer event */
public addOffer(pmcData: IPmcData, info: IAddOfferRequestData, sessionID: string): IItemEventRouterResponse
{
return this.ragfairController.addPlayerOffer(pmcData, info, sessionID);
}
/** \Handle RagFairRemoveOffer event */
public removeOffer(pmcData: IPmcData, info: IRemoveOfferRequestData, sessionID: string): IItemEventRouterResponse
{
return this.ragfairController.removeOffer(info.offerId, sessionID);
}
/** Handle RagFairRenewOffer event */
public extendOffer(pmcData: IPmcData, info: IExtendOfferRequestData, sessionID: string): IItemEventRouterResponse
{
return this.ragfairController.extendOffer(info, sessionID);
}
/**
* Handle /client/items/prices
* Called when clicking an item to list on flea
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public getFleaPrices(url: string, request: IEmptyRequestData, sessionID: string): IGetBodyResponseData<Record<string, number>>
{
return this.httpResponse.getBody(this.ragfairController.getAllFleaPrices());
}
/** Handle client/reports/ragfair/send */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {

View File

@ -16,26 +16,28 @@ export class RepairCallbacks
{ } { }
/** /**
* Handle TraderRepair event
* use trader to repair item * use trader to repair item
* @param pmcData * @param pmcData Player profile
* @param body * @param traderRepairRequest Request object
* @param sessionID * @param sessionID Session id
* @returns * @returns IItemEventRouterResponse
*/ */
public traderRepair(pmcData: IPmcData, body: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse public traderRepair(pmcData: IPmcData, traderRepairRequest: ITraderRepairActionDataRequest, sessionID: string): IItemEventRouterResponse
{ {
return this.repairController.traderRepair(sessionID, body, pmcData); return this.repairController.traderRepair(sessionID, traderRepairRequest, pmcData);
} }
/** /**
* Handle Repair event
* Use repair kit to repair item * Use repair kit to repair item
* @param pmcData * @param pmcData Player profile
* @param body * @param repairRequest Request object
* @param sessionID * @param sessionID Session id
* @returns * @returns IItemEventRouterResponse
*/ */
public repair(pmcData: IPmcData, body: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse public repair(pmcData: IPmcData, repairRequest: IRepairActionDataRequest, sessionID: string): IItemEventRouterResponse
{ {
return this.repairController.repairWithKit(sessionID, body, pmcData); return this.repairController.repairWithKit(sessionID, repairRequest, pmcData);
} }
} }

View File

@ -17,7 +17,7 @@ export class TradeCallbacks
{ } { }
/** /**
* Handle client/game/profile/items/moving TradingConfirm * 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
{ {
@ -25,6 +25,7 @@ export class TradeCallbacks
return this.tradeController.confirmTrading(pmcData, body, sessionID); return this.tradeController.confirmTrading(pmcData, body, sessionID);
} }
/** 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);

View File

@ -31,17 +31,20 @@ export class TraderCallbacks implements OnLoad, OnUpdate
return "aki-traders"; return "aki-traders";
} }
/** 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));
} }
/** Handle client/trading/api/getTrader */
public getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase> public getTrader(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderBase>
{ {
const traderID = url.replace("/client/trading/api/getTrader/", ""); const traderID = url.replace("/client/trading/api/getTrader/", "");
return this.httpResponse.getBody(this.traderController.getTrader(sessionID, traderID)); return this.httpResponse.getBody(this.traderController.getTrader(sessionID, traderID));
} }
/** Handle client/trading/api/getTraderAssort */
public getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort> public getAssort(url: string, info: IEmptyRequestData, sessionID: string): IGetBodyResponseData<ITraderAssort>
{ {
const traderID = url.replace("/client/trading/api/getTraderAssort/", ""); const traderID = url.replace("/client/trading/api/getTraderAssort/", "");

View File

@ -12,11 +12,13 @@ export class WishlistCallbacks
@inject("WishlistController") protected wishlistController: WishlistController) @inject("WishlistController") protected wishlistController: WishlistController)
{ } { }
/** Handle AddToWishList event */
public addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse public addToWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse
{ {
return this.wishlistController.addToWishList(pmcData, body, sessionID); return this.wishlistController.addToWishList(pmcData, body, sessionID);
} }
/** Handle RemoveFromWishList event */
public removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse public removeFromWishlist(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse
{ {
return this.wishlistController.removeFromWishList(pmcData, body, sessionID); return this.wishlistController.removeFromWishList(pmcData, body, sessionID);

View File

@ -61,6 +61,7 @@ export class BotController
} }
/** /**
* Handle singleplayer/settings/bot/difficulty
* Get the core.json difficulty settings from database\bots * Get the core.json difficulty settings from database\bots
* @returns IBotCore * @returns IBotCore
*/ */

View File

@ -88,6 +88,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutUpgrade event
* Start a hideout area upgrade * Start a hideout area upgrade
* @param pmcData Player profile * @param pmcData Player profile
* @param request upgrade start request * @param request upgrade start request
@ -158,6 +159,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutUpgradeComplete event
* Complete a hideout area upgrade * Complete a hideout area upgrade
* @param pmcData Player profile * @param pmcData Player profile
* @param request Completed upgrade request * @param request Completed upgrade request
@ -259,6 +261,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutTakeItemsFromAreaSlots event
* Remove item from hideout area and place into player inventory * Remove item from hideout area and place into player inventory
* @param pmcData Player profile * @param pmcData Player profile
* @param request Take item out of area request * @param request Take item out of area request
@ -333,6 +336,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutToggleArea event
* Toggle area on/off * Toggle area on/off
* @param pmcData Player profile * @param pmcData Player profile
* @param request Toggle area request * @param request Toggle area request
@ -356,6 +360,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutSingleProductionStart event
* Start production for an item from hideout area * Start production for an item from hideout area
* @param pmcData Player profile * @param pmcData Player profile
* @param body Start prodution of single item request * @param body Start prodution of single item request
@ -392,6 +397,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutScavCaseProductionStart event
* Handles event after clicking 'start' on the scav case hideout page * Handles event after clicking 'start' on the scav case hideout page
* @param pmcData player profile * @param pmcData player profile
* @param body client request object * @param body client request object
@ -486,6 +492,7 @@ export class HideoutController
} }
/** /**
* Handle HideoutTakeProduction event
* Take completed item out of hideout area and place into player inventory * Take completed item out of hideout area and place into player inventory
* @param pmcData Player profile * @param pmcData Player profile
* @param request Remove production from area request * @param request Remove production from area request

View File

@ -74,6 +74,7 @@ export class InraidController
} }
/** /**
* Handle raid/profile/save
* Save profile state to disk * Save profile state to disk
* Handles pmc/pscav * Handles pmc/pscav
* @param offraidData post-raid request data * @param offraidData post-raid request data

View File

@ -778,6 +778,7 @@ export class InventoryController
} }
/** /**
* Handle OpenRandomLootContainer event
* Handle event fired when a container is unpacked (currently only the halloween pumpkin) * Handle event fired when a container is unpacked (currently only the halloween pumpkin)
* @param pmcData Profile data * @param pmcData Profile data
* @param body open loot container request data * @param body open loot container request data

View File

@ -44,7 +44,14 @@ export class LocationController
this.airdropConfig = this.configServer.getConfig(ConfigTypes.AIRDROP); this.airdropConfig = this.configServer.getConfig(ConfigTypes.AIRDROP);
} }
/* get a location with generated loot data */ /* */
/**
* Handle client/location/getLocalloot
* Get a location (map) with generated loot data
* @param location Map to generate loot for
* @returns ILocationBase
*/
public get(location: string): ILocationBase public get(location: string): ILocationBase
{ {
const name = location.toLowerCase().replace(" ", ""); const name = location.toLowerCase().replace(" ", "");
@ -140,6 +147,7 @@ export class LocationController
} }
/** /**
* Handle client/location/getAirdropLoot
* Get loot for an airdop container * Get loot for an airdop container
* Generates it randomly based on config/airdrop.json values * Generates it randomly based on config/airdrop.json values
* @returns Array of LootItem objects * @returns Array of LootItem objects

View File

@ -57,6 +57,7 @@ export class MatchController
return this.matchConfig.enabled; return this.matchConfig.enabled;
} }
/** Handle raid/profile/list */
public getProfile(info: IGetProfileRequestData): IPmcData[] public getProfile(info: IGetProfileRequestData): IPmcData[]
{ {
if (info.profileId.includes("pmcAID")) if (info.profileId.includes("pmcAID"))
@ -72,16 +73,20 @@ export class MatchController
return []; return [];
} }
/** Handle client/match/group/create */
public createGroup(sessionID: string, info: ICreateGroupRequestData): any public createGroup(sessionID: string, info: ICreateGroupRequestData): any
{ {
return this.matchLocationService.createGroup(sessionID, info); return this.matchLocationService.createGroup(sessionID, info);
} }
/** Handle client/match/group/delete */
public deleteGroup(info: any): void public deleteGroup(info: any): void
{ {
this.matchLocationService.deleteGroup(info); this.matchLocationService.deleteGroup(info);
} }
/** Handle match/group/start_game */
// eslint-disable-next-line @typescript-eslint/no-unused-vars
public joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult public joinMatch(info: IJoinMatchRequestData, sessionId: string): IJoinMatchResult
{ {
const output: IJoinMatchResult = { const output: IJoinMatchResult = {
@ -109,22 +114,24 @@ export class MatchController
return output; return output;
} }
/** Handle client/match/group/status */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // eslint-disable-next-line @typescript-eslint/no-unused-vars
public getGroupStatus(info: IGetGroupStatusRequestData): any public getGroupStatus(info: IGetGroupStatusRequestData): any
{ {
return { return {
"players": [], players: [],
maxPveCountExceeded: false maxPveCountExceeded: false
}; };
} }
/** /**
* Handle /client/raid/configuration * Handle /client/raid/configuration
* @param request * @param request Raid config request
* @param sessionID * @param sessionID Session id
*/ */
public startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void public startOfflineRaid(request: IGetRaidConfigurationRequestData, sessionID: string): void
{ {
// Store request data for access during bot generation
this.applicationContext.addValue(ContextVariableType.RAID_CONFIGURATION, request); this.applicationContext.addValue(ContextVariableType.RAID_CONFIGURATION, request);
//TODO: add code to strip PMC of equipment now they've started the raid //TODO: add code to strip PMC of equipment now they've started the raid
@ -156,6 +163,7 @@ export class MatchController
return botDifficulty; return botDifficulty;
} }
/** Handle client/match/offline/end */
public endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void public endOfflineRaid(info: IEndOfflineRaidRequestData, sessionId: string): void
{ {
const pmcData: IPmcData = this.profileHelper.getPmcProfile(sessionId); const pmcData: IPmcData = this.profileHelper.getPmcProfile(sessionId);

View File

@ -78,6 +78,7 @@ export class NotifierController
return `${this.httpServerHelper.getBackendUrl()}/notifierServer/get/${sessionID}`; return `${this.httpServerHelper.getBackendUrl()}/notifierServer/get/${sessionID}`;
} }
/** Handle client/notifier/channel/create */
public getChannel(sessionID: string): INotifierChannel public getChannel(sessionID: string): INotifierChannel
{ {
return { return {

View File

@ -22,12 +22,13 @@ export class PresetBuildController
) )
{ } { }
/** Handle client/handbook/builds/my/list */
public getUserBuilds(sessionID: string): WeaponBuild[] public getUserBuilds(sessionID: string): WeaponBuild[]
{ {
return Object.values(this.saveServer.getProfile(sessionID).weaponbuilds); return Object.values(this.saveServer.getProfile(sessionID).weaponbuilds);
} }
/** Handle SaveBuild event */
public saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public saveBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse
{ {
delete body.Action; delete body.Action;
@ -47,7 +48,8 @@ export class PresetBuildController
output.profileChanges[sessionID].builds.push(body); output.profileChanges[sessionID].builds.push(body);
return output; return output;
} }
/** Handle RemoveBuild event*/
public removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse public removeBuild(pmcData: IPmcData, body: IPresetBuildActionRequestData, sessionID: string): IItemEventRouterResponse
{ {
const savedBuilds = this.saveServer.getProfile(sessionID).weaponbuilds; const savedBuilds = this.saveServer.getProfile(sessionID).weaponbuilds;

View File

@ -34,6 +34,7 @@ export class RepairController
{ } { }
/** /**
* Handle TraderRepair event
* Repair with trader * Repair with trader
* @param sessionID session id * @param sessionID session id
* @param body endpoint request data * @param body endpoint request data
@ -67,6 +68,7 @@ export class RepairController
} }
/** /**
* Handle Repair event
* Repair with repair kit * Repair with repair kit
* @param sessionID session id * @param sessionID session id
* @param body endpoint request data * @param body endpoint request data

View File

@ -45,12 +45,13 @@ class TradeController
this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER); this.traderConfig = this.configServer.getConfig(ConfigTypes.TRADER);
} }
/** Handle TradingConfirm event */
public confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse public confirmTrading(pmcData: IPmcData, request: IProcessBaseTradeRequestData, sessionID: string): IItemEventRouterResponse
{ {
return this.confirmTradingInternal(pmcData, request, sessionID, this.traderConfig.purchasesAreFoundInRaid); return this.confirmTradingInternal(pmcData, request, sessionID, this.traderConfig.purchasesAreFoundInRaid);
} }
// Ragfair trading /** Handle RagFairBuyOffer event */
public confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse public confirmRagfairTrading(pmcData: IPmcData, body: IProcessRagfairTradeRequestData, sessionID: string): IItemEventRouterResponse
{ {
let output = this.eventOutputHolder.getOutput(sessionID); let output = this.eventOutputHolder.getOutput(sessionID);

View File

@ -108,6 +108,7 @@ export class TraderController
} }
/** /**
* Handle client/trading/api/traderSettings
* Return an array of all traders * Return an array of all traders
* @param sessionID Session id * @param sessionID Session id
* @returns array if ITraderBase objects * @returns array if ITraderBase objects
@ -155,11 +156,13 @@ export class TraderController
return 0; return 0;
} }
/** Handle client/trading/api/getTrader */
public getTrader(sessionID: string, traderID: string): ITraderBase public getTrader(sessionID: string, traderID: string): ITraderBase
{ {
return this.traderHelper.getTrader(sessionID, traderID); return this.traderHelper.getTrader(sessionID, traderID);
} }
/** Handle client/trading/api/getTraderAssort */
public getAssort(sessionId: string, traderId: string): ITraderAssort public getAssort(sessionId: string, traderId: string): ITraderAssort
{ {
return this.traderAssortHelper.getAssort(sessionId, traderId); return this.traderAssortHelper.getAssort(sessionId, traderId);

View File

@ -21,6 +21,7 @@ export class WeatherController
this.weatherConfig = this.configServer.getConfig(ConfigTypes.WEATHER); this.weatherConfig = this.configServer.getConfig(ConfigTypes.WEATHER);
} }
/** Handle client/weather */
public generate(): IWeatherData public generate(): IWeatherData
{ {
let result: IWeatherData = { let result: IWeatherData = {

View File

@ -13,10 +13,7 @@ export class WishlistController
) )
{ } { }
/* Adding item to wishlist /** Handle AddToWishList */
* input: playerProfileData, Request body
* output: OK (saved profile)
* */
public addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse public addToWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse
{ {
for (const item in pmcData.WishList) for (const item in pmcData.WishList)
@ -33,10 +30,7 @@ export class WishlistController
return this.eventOutputHolder.getOutput(sessionID); return this.eventOutputHolder.getOutput(sessionID);
} }
/* Removing item to wishlist /** Handle RemoveFromWishList event */
* input: playerProfileData, Request body
* output: OK (saved profile)
* */
public removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse public removeFromWishList(pmcData: IPmcData, body: IWishlistActionData, sessionID: string): IItemEventRouterResponse
{ {
for (let i = 0; i < pmcData.WishList.length; i++) for (let i = 0; i < pmcData.WishList.length; i++)

View File

@ -125,6 +125,7 @@ export class Watermark
} }
/** /**
* Handle singleplayer/settings/version
* Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used * Get text shown in game on screen, can't be translated as it breaks bsgs client when certian characters are used
* @returns string * @returns string
*/ */
@ -138,19 +139,19 @@ export class Watermark
} }
/** Set window title */ /** Set window title */
public setTitle(): void protected setTitle(): void
{ {
process.title = this.versionLabel; process.title = this.versionLabel;
} }
/** Reset console cursor to top */ /** Reset console cursor to top */
public resetCursor(): void protected resetCursor(): void
{ {
process.stdout.write("\u001B[2J\u001B[0;0f"); process.stdout.write("\u001B[2J\u001B[0;0f");
} }
/** Draw the watermark */ /** Draw the watermark */
public draw(): void protected draw(): void
{ {
const result = []; const result = [];