From 17215ba9d888dedf360189338ea0c4c64bf3b53e Mon Sep 17 00:00:00 2001 From: Dev Date: Thu, 31 Oct 2024 21:38:56 +0000 Subject: [PATCH] Stubbed out item pinning --- project/src/callbacks/InventoryCallbacks.ts | 10 ++++++++++ project/src/controllers/QuestController.ts | 17 +++++++++++++++++ .../src/models/eft/inventory/IPinItemRequest.ts | 7 +++++++ project/src/models/enums/ItemEventActions.ts | 1 + .../item_events/InventoryItemEventRouter.ts | 2 ++ 5 files changed, 37 insertions(+) create mode 100644 project/src/models/eft/inventory/IPinItemRequest.ts diff --git a/project/src/callbacks/InventoryCallbacks.ts b/project/src/callbacks/InventoryCallbacks.ts index 5014b2bc..b78b5d53 100644 --- a/project/src/callbacks/InventoryCallbacks.ts +++ b/project/src/callbacks/InventoryCallbacks.ts @@ -18,6 +18,7 @@ import { IInventoryTagRequestData } from "@spt/models/eft/inventory/IInventoryTa import { IInventoryToggleRequestData } from "@spt/models/eft/inventory/IInventoryToggleRequestData"; import { IInventoryTransferRequestData } from "@spt/models/eft/inventory/IInventoryTransferRequestData"; import { IOpenRandomLootContainerRequestData } from "@spt/models/eft/inventory/IOpenRandomLootContainerRequestData"; +import { IPinItemRequest } from "@spt/models/eft/inventory/IPinItemRequest"; import { IRedeemProfileRequestData } from "@spt/models/eft/inventory/IRedeemProfileRequestData"; import { ISetFavoriteItems } from "@spt/models/eft/inventory/ISetFavoriteItems"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; @@ -236,4 +237,13 @@ export class InventoryCallbacks { ): IItemEventRouterResponse { return this.questController.failQuest(pmcData, request, sessionID, output); } + + public pin( + pmcData: IPmcData, + request: IPinItemRequest, + sessionID: string, + output: IItemEventRouterResponse, + ): IItemEventRouterResponse { + return this.questController.pin(pmcData, request, sessionID, output); + } } diff --git a/project/src/controllers/QuestController.ts b/project/src/controllers/QuestController.ts index 328e804f..3548980e 100644 --- a/project/src/controllers/QuestController.ts +++ b/project/src/controllers/QuestController.ts @@ -8,6 +8,7 @@ import { IPmcData } from "@spt/models/eft/common/IPmcData"; import { IItem } from "@spt/models/eft/common/tables/IItem"; import { IQuest, IQuestCondition } from "@spt/models/eft/common/tables/IQuest"; import { IPmcDataRepeatableQuest, IRepeatableQuest } from "@spt/models/eft/common/tables/IRepeatableQuests"; +import { IPinItemRequest } from "@spt/models/eft/inventory/IPinItemRequest"; import { IItemEventRouterResponse } from "@spt/models/eft/itemEvent/IItemEventRouterResponse"; import { IAcceptQuestRequestData } from "@spt/models/eft/quests/IAcceptQuestRequestData"; import { ICompleteQuestRequestData } from "@spt/models/eft/quests/ICompleteQuestRequestData"; @@ -522,4 +523,20 @@ export class QuestController { return output; } + + /** + * Handle /client/game/profile/items/moving - PinLock + * @param pmcData + * @param request + * @param sessionID + * @param output + */ + public pin( + pmcData: IPmcData, + request: IPinItemRequest, + sessionID: string, + output: IItemEventRouterResponse, + ): IItemEventRouterResponse { + throw new Error("Method not implemented."); + } } diff --git a/project/src/models/eft/inventory/IPinItemRequest.ts b/project/src/models/eft/inventory/IPinItemRequest.ts new file mode 100644 index 00000000..156978f4 --- /dev/null +++ b/project/src/models/eft/inventory/IPinItemRequest.ts @@ -0,0 +1,7 @@ +export interface IPinItemRequest { + Action: "PinLock"; + /** Id of item being pinned */ + Item: string; + /** "Pinned"/"" */ + State: string; +} diff --git a/project/src/models/enums/ItemEventActions.ts b/project/src/models/enums/ItemEventActions.ts index d12efe6d..a64970a6 100644 --- a/project/src/models/enums/ItemEventActions.ts +++ b/project/src/models/enums/ItemEventActions.ts @@ -26,4 +26,5 @@ export enum ItemEventActions { REDEEM_PROFILE_REWARD = "RedeemProfileReward", SET_FAVORITE_ITEMS = "SetFavoriteItems", QUEST_FAIL = "QuestFail", + PIN = "PinLock", } diff --git a/project/src/routers/item_events/InventoryItemEventRouter.ts b/project/src/routers/item_events/InventoryItemEventRouter.ts index 2d34ce6b..a01a9158 100644 --- a/project/src/routers/item_events/InventoryItemEventRouter.ts +++ b/project/src/routers/item_events/InventoryItemEventRouter.ts @@ -94,6 +94,8 @@ export class InventoryItemEventRouter extends ItemEventRouterDefinition { return this.inventoryCallbacks.setFavoriteItem(pmcData, body, sessionID, output); case ItemEventActions.QUEST_FAIL: return this.inventoryCallbacks.failQuest(pmcData, body, sessionID, output); + case ItemEventActions.PIN: + return this.inventoryCallbacks.pin(pmcData, body, sessionID, output); default: throw new Error(`Unhandled event ${url} request: ${JSON.stringify(body)}`); }