From 5d20b6b7817c8d50d6bc770d03b216ddde629e8b Mon Sep 17 00:00:00 2001 From: Dev Date: Sat, 15 Jul 2023 11:00:35 +0100 Subject: [PATCH] Further comment improvements --- project/src/controllers/ProfileController.ts | 33 ++++++++++++++++--- project/src/controllers/QuestController.ts | 7 ++-- project/src/helpers/InventoryHelper.ts | 2 +- project/src/loaders/BundleLoader.ts | 6 +++- project/src/models/eft/profile/IAkiProfile.ts | 1 + 5 files changed, 41 insertions(+), 8 deletions(-) diff --git a/project/src/controllers/ProfileController.ts b/project/src/controllers/ProfileController.ts index de52b818..eb55c82b 100644 --- a/project/src/controllers/ProfileController.ts +++ b/project/src/controllers/ProfileController.ts @@ -49,6 +49,9 @@ export class ProfileController ) { } + /** + * Handle /launcher/profiles + */ public getMiniProfiles(): IMiniProfile[] { const miniProfiles: IMiniProfile[] = []; @@ -61,6 +64,9 @@ export class ProfileController return miniProfiles; } + /** + * Handle launcher/profile/info + */ public getMiniProfile(sessionID: string): any { const maxlvl = this.profileHelper.getMaxLevel(); @@ -100,11 +106,17 @@ export class ProfileController return result; } + /** + * Handle client/game/profile/list + */ public getCompleteProfile(sessionID: string): IPmcData[] { return this.profileHelper.getCompleteProfile(sessionID); } + /** + * Handle client/game/profile/create + */ public createProfile(info: IProfileCreateRequestData, sessionID: string): void { const account = this.saveServer.getProfile(sessionID).info; @@ -117,7 +129,7 @@ export class ProfileController this.saveServer.deleteProfileById(sessionID); } - // pmc + // PMC pmcData._id = `pmc${sessionID}`; pmcData.aid = sessionID; pmcData.savage = `scav${sessionID}`; @@ -181,11 +193,11 @@ export class ProfileController this.traderHelper.resetTrader(sessionID, traderID); } - // store minimal profile and reload it + // Store minimal profile and reload it this.saveServer.saveProfile(sessionID); this.saveServer.loadProfile(sessionID); - // completed account creation + // Completed account creation this.saveServer.getProfile(sessionID).info.wipe = false; this.saveServer.saveProfile(sessionID); } @@ -207,7 +219,7 @@ export class ProfileController /** * Generate a player scav object - * pmc profile MUST exist first before pscav can be generated + * PMC profile MUST exist first before pscav can be generated * @param sessionID * @returns IPmcData object */ @@ -216,6 +228,9 @@ export class ProfileController return this.playerScavGenerator.generate(sessionID); } + /** + * Handle client/game/profile/nickname/validate + */ public validateNickname(info: IValidateNicknameRequestData, sessionID: string): string { if (info.nickname.length < 3) @@ -231,6 +246,10 @@ export class ProfileController return "OK"; } + /** + * Handle client/game/profile/nickname/change event + * Client allows player to adjust their profile name + */ public changeNickname(info: IProfileChangeNicknameRequestData, sessionID: string): string { const output = this.validateNickname(info, sessionID); @@ -246,12 +265,18 @@ export class ProfileController return output; } + /** + * Handle client/game/profile/voice/change event + */ public changeVoice(info: IProfileChangeVoiceRequestData, sessionID: string): void { const pmcData = this.profileHelper.getPmcProfile(sessionID); pmcData.Info.Voice = info.voice; } + /** + * Handle client/game/profile/search + */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public getFriends(info: ISearchFriendRequestData, sessionID: string): ISearchFriendResponse[] { diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index 963f7433..557a1734 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -58,6 +58,7 @@ export class QuestController } /** + * Handle client/quest/list * Get all quests visible to player * Exclude quests with incomplete preconditions (level/loyalty) * @param sessionID session id @@ -237,6 +238,7 @@ export class QuestController } /** + * Handle QuestAccept event * Handle the client accepting a quest and starting it * Send starting rewards if any to player and * Send start notification if any to player @@ -359,9 +361,10 @@ export class QuestController } /** + * Handle QuestComplete event * Update completed quest in profile * Add newly unlocked quests to profile - * Also recalculate thier level due to exp rewards + * Also recalculate their level due to exp rewards * @param pmcData Player profile * @param body Completed quest request * @param sessionID Session id @@ -535,7 +538,7 @@ export class QuestController } /** - * + * Handle QuestHandover event * @param pmcData Player profile * @param handoverQuestRequest handover item request * @param sessionID Session id diff --git a/project/src/helpers/InventoryHelper.ts b/project/src/helpers/InventoryHelper.ts index 36d657d7..b5327864 100644 --- a/project/src/helpers/InventoryHelper.ts +++ b/project/src/helpers/InventoryHelper.ts @@ -454,7 +454,7 @@ export class InventoryHelper } /** - * Remove item from player inventory + * Remove item from player inventory + insured items array * @param pmcData Profile to remove item from * @param itemId Items id to remove * @param sessionID Session id diff --git a/project/src/loaders/BundleLoader.ts b/project/src/loaders/BundleLoader.ts index 0d891f62..2ecc8eac 100644 --- a/project/src/loaders/BundleLoader.ts +++ b/project/src/loaders/BundleLoader.ts @@ -34,6 +34,9 @@ export class BundleLoader ) { } + /** + * Handle singleplayer/bundles + */ public getBundles(local: boolean): BundleInfo[] { const result: BundleInfo[] = []; @@ -71,7 +74,8 @@ export class BundleLoader } } - public addBundle(key: string, b: BundleInfo): void { + public addBundle(key: string, b: BundleInfo): void + { this.bundles[key] = b; } } diff --git a/project/src/models/eft/profile/IAkiProfile.ts b/project/src/models/eft/profile/IAkiProfile.ts index 7156aa6d..794b1594 100644 --- a/project/src/models/eft/profile/IAkiProfile.ts +++ b/project/src/models/eft/profile/IAkiProfile.ts @@ -7,6 +7,7 @@ export interface IAkiProfile { info: Info characters: Characters + /** Clothing purchases */ suits: string[] weaponbuilds: WeaponBuild[] dialogues: Record