diff --git a/project/src/controllers/RagfairController.ts b/project/src/controllers/RagfairController.ts index 427f0e87..f85423c2 100644 --- a/project/src/controllers/RagfairController.ts +++ b/project/src/controllers/RagfairController.ts @@ -26,6 +26,7 @@ import { IRemoveOfferRequestData } from "@spt/models/eft/ragfair/IRemoveOfferReq import { ISearchRequestData } from "@spt/models/eft/ragfair/ISearchRequestData"; import { IProcessBuyTradeRequestData } from "@spt/models/eft/trade/IProcessBuyTradeRequestData"; import { ConfigTypes } from "@spt/models/enums/ConfigTypes"; +import { FleaOfferType } from "@spt/models/enums/FleaOfferType"; import { MemberCategory } from "@spt/models/enums/MemberCategory"; import { IRagfairConfig } from "@spt/models/spt/config/IRagfairConfig"; import { ILogger } from "@spt/models/spt/utils/ILogger"; @@ -422,6 +423,8 @@ export class RagfairController return this.httpResponse.appendErrorToOutput(output, validationMessage); } + const typeOfOffer = this.getOfferType(offerRequest); + // Find items to be listed on flea from player inventory const { items: itemsInInventoryToList, errorMessage: itemsInInventoryError } = this.getItemsToListOnFleaFromInventory(pmcData, offerRequest.items); @@ -508,6 +511,24 @@ export class RagfairController return output; } + protected getOfferType(offerRequest: IAddOfferRequestData): FleaOfferType + { + if (offerRequest.items.length == 1 && !offerRequest.sellInOnePiece) + { + return FleaOfferType.SINGLE; + } + else if (offerRequest.items.length > 1 && !offerRequest.sellInOnePiece) + { + return FleaOfferType.MULTI; + } + else if (offerRequest.sellInOnePiece) + { + return FleaOfferType.PACK; + } + + return FleaOfferType.UNKNOWN; + } + /** * Charge player a listing fee for using flea, pulls charge from data previously sent by client * @param sessionID Player id diff --git a/project/src/models/enums/FleaOfferType.ts b/project/src/models/enums/FleaOfferType.ts new file mode 100644 index 00000000..6b9f9e6a --- /dev/null +++ b/project/src/models/enums/FleaOfferType.ts @@ -0,0 +1,7 @@ +export enum FleaOfferType +{ + SINGLE, + MULTI, + PACK, + UNKNOWN, +}