Improvements to varous types throughout the codebase

Added quest type as enum for IQuest
Added missing values to QuestReward enum
This commit is contained in:
Dev 2023-07-18 16:53:15 +01:00
parent f28d6c2a6b
commit 3768742bc8
8 changed files with 37 additions and 9 deletions

View File

@ -3,6 +3,7 @@ import { inject, injectable } from "tsyringe";
import { GameController } from "../controllers/GameController"; import { GameController } from "../controllers/GameController";
import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData"; import { IEmptyRequestData } from "../models/eft/common/IEmptyRequestData";
import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse"; import { ICheckVersionResponse } from "../models/eft/game/ICheckVersionResponse";
import { ICurrentGroupResponse } from "../models/eft/game/ICurrentGroupResponse";
import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse"; import { IGameConfigResponse } from "../models/eft/game/IGameConfigResponse";
import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData"; import { IGameEmptyCrcRequestData } from "../models/eft/game/IGameEmptyCrcRequestData";
import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse"; import { IGameKeepAliveResponse } from "../models/eft/game/IGameKeepAliveResponse";
@ -88,7 +89,7 @@ class GameCallbacks
/** /**
* Handle client/match/group/current * Handle client/match/group/current
*/ */
public getCurrentGroup(url: string, info: IEmptyRequestData, sessionID: string): any 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));
} }

View File

@ -107,6 +107,7 @@ export class MatchCallbacks
return this.httpResponse.nullResponse(); return this.httpResponse.nullResponse();
} }
/** @deprecated - not called on raid start/end or game start/exit */
// eslint-disable-next-line @typescript-eslint/no-unused-vars // 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
{ {
@ -148,6 +149,7 @@ export class MatchCallbacks
} }
/** /**
* @deprecated - not called on raid start/end or game start/exit
* Handle client/match/group/status * Handle client/match/group/status
* @returns * @returns
*/ */

View File

@ -2,6 +2,7 @@ import { inject, injectable } from "tsyringe";
import { ItemHelper } from "../helpers/ItemHelper"; import { ItemHelper } from "../helpers/ItemHelper";
import { Product } from "../models/eft/common/tables/IBotBase"; import { Product } from "../models/eft/common/tables/IBotBase";
import { Upd } from "../models/eft/common/tables/IItem";
import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem"; import { ITemplateItem } from "../models/eft/common/tables/ITemplateItem";
import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase"; import { IHideoutScavCase } from "../models/eft/hideout/IHideoutScavCase";
import { BaseClasses } from "../models/enums/BaseClasses"; import { BaseClasses } from "../models/enums/BaseClasses";
@ -239,7 +240,7 @@ export class ScavCaseRewardGenerator
* @param item money or ammo item * @param item money or ammo item
* @param resultItem money or ammo item with a randomise stack size * @param resultItem money or ammo item with a randomise stack size
*/ */
protected addStackCountToAmmoAndMoney(item: ITemplateItem, resultItem: { _id: string; _tpl: string; upd: any; }, rarity: string): void protected addStackCountToAmmoAndMoney(item: ITemplateItem, resultItem: { _id: string; _tpl: string; upd: Upd; }, rarity: string): void
{ {
if (item._parent === BaseClasses.AMMO || item._parent === BaseClasses.MONEY) if (item._parent === BaseClasses.AMMO || item._parent === BaseClasses.MONEY)
{ {

View File

@ -244,7 +244,7 @@ export class HealthHelper
} }
} }
protected isEmpty(map: any): boolean protected isEmpty(map: Record<string, { Time: number }>): boolean
{ {
for (const key in map) for (const key in map)
{ {

View File

@ -1,9 +1,11 @@
import { QuestRewardType } from "../../../enums/QuestRewardType"; import { QuestRewardType } from "../../../enums/QuestRewardType";
import { QuestStatus } from "../../../enums/QuestStatus"; import { QuestStatus } from "../../../enums/QuestStatus";
import { QuestTypeEnum } from "../../../enums/QuestTypeEnum";
import { Item } from "./IItem"; import { Item } from "./IItem";
export interface IQuest export interface IQuest
{ {
/** SPT addition - human readable quest name */
QuestName?: string QuestName?: string
_id: string _id: string
canShowNotificationsInGame: boolean canShowNotificationsInGame: boolean
@ -15,9 +17,10 @@ export interface IQuest
traderId: string traderId: string
location: string location: string
image: string image: string
type: string type: QuestTypeEnum
isKey: boolean isKey: boolean
questStatus: any /** @deprecated - Likely not used, use 'status' instead */
questStatus: QuestStatus
restartable: boolean restartable: boolean
instantComplete: boolean instantComplete: boolean
secretQuest: boolean secretQuest: boolean
@ -25,9 +28,11 @@ export interface IQuest
successMessageText: string successMessageText: string
templateId: string templateId: string
rewards: Rewards rewards: Rewards
/** Becomes 'AppearStatus' inside client */
status: string | number status: string | number
KeyQuest: boolean KeyQuest: boolean
changeQuestMessageText: string changeQuestMessageText: string
/** "Pmc" or "Scav" */
side: string side: string
} }

View File

@ -1,8 +1,8 @@
import { Message } from "../profile/IAkiProfile"; import { IUserDialogInfo, Message } from "../profile/IAkiProfile";
export interface IGetMailDialogViewResponseData export interface IGetMailDialogViewResponseData
{ {
messages: Message[] messages: Message[]
profiles: any[] profiles: IUserDialogInfo[]
hasMessagesWithRewards: boolean hasMessagesWithRewards: boolean
} }

View File

@ -6,5 +6,7 @@ export enum QuestRewardType
TRADER_UNLOCK = "TraderUnlock", TRADER_UNLOCK = "TraderUnlock",
ITEM = "Item", ITEM = "Item",
ASSORTMENT_UNLOCK = "AssortmentUnlock", ASSORTMENT_UNLOCK = "AssortmentUnlock",
PRODUCTIONS_SCHEME = "ProductionScheme" PRODUCTIONS_SCHEME = "ProductionScheme",
TRADER_STANDING_RESET = "TraderStandingReset",
TRADER_STANDING_RESTORE = "TraderStandingRestore"
} }

View File

@ -0,0 +1,17 @@
export enum QuestTypeEnum
{
PICKUP = "PickUp",
ELIMINATION = "Elimination",
DISCOVER = "Discover",
COMPLETION = "Completion",
EXPLORATION = "Exploration",
LEVELLING = "Levelling",
EXPERIENCE = "Experience",
STANDING = "Standing",
LOYALTY = "Loyalty",
MERCHANT = "Merchant",
SKILL = "Skill",
MULTI = "Multi",
WEAPON_ASSEMBLY = "WeaponAssembly"
}