From 0e85e55ceda4e27cfdb81ff6e85aece4d0dc381b Mon Sep 17 00:00:00 2001 From: CWX Date: Sun, 21 Jul 2024 20:41:46 +0100 Subject: [PATCH] add missing props on models, add additional info to miniprofiles --- project/src/controllers/ProfileController.ts | 4 ++++ project/src/controllers/TradeController.ts | 2 +- project/src/models/eft/launcher/IMiniProfile.ts | 11 +++++------ project/src/models/eft/profile/ISptProfile.ts | 4 ++-- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/project/src/controllers/ProfileController.ts b/project/src/controllers/ProfileController.ts index a54d3b50..237ce166 100644 --- a/project/src/controllers/ProfileController.ts +++ b/project/src/controllers/ProfileController.ts @@ -95,6 +95,8 @@ export class ProfileController prevexp: 0, nextlvl: 0, maxlvl: maxlvl, + edition: profile.info?.edition ?? "", + profileId: profile.info?.id ?? "", sptData: this.profileHelper.getDefaultSptDataObject(), }; } @@ -112,6 +114,8 @@ export class ProfileController : this.profileHelper.getExperience(currlvl), nextlvl: nextlvl, maxlvl: maxlvl, + edition: profile.info?.edition ?? "", + profileId: profile.info?.id ?? "", sptData: profile.spt, }; } diff --git a/project/src/controllers/TradeController.ts b/project/src/controllers/TradeController.ts index c40e87f1..3aa369cb 100644 --- a/project/src/controllers/TradeController.ts +++ b/project/src/controllers/TradeController.ts @@ -54,7 +54,7 @@ export class TradeController @inject("HashUtil") protected hashUtil: HashUtil, @inject("ItemHelper") protected itemHelper: ItemHelper, @inject("ProfileHelper") protected profileHelper: ProfileHelper, - @inject("ragfairOfferHelper") protected ragfairOfferHelper: RagfairOfferHelper, + @inject("RagfairOfferHelper") protected ragfairOfferHelper: RagfairOfferHelper, @inject("TraderHelper") protected traderHelper: TraderHelper, @inject("RagfairServer") protected ragfairServer: RagfairServer, @inject("HttpResponseUtil") protected httpResponse: HttpResponseUtil, diff --git a/project/src/models/eft/launcher/IMiniProfile.ts b/project/src/models/eft/launcher/IMiniProfile.ts index 1cc470c8..3ab8297d 100644 --- a/project/src/models/eft/launcher/IMiniProfile.ts +++ b/project/src/models/eft/launcher/IMiniProfile.ts @@ -1,3 +1,5 @@ +import { Spt } from "../profile/ISptProfile" + export interface IMiniProfile { username: string @@ -8,10 +10,7 @@ export interface IMiniProfile prevexp: number nextlvl: number maxlvl: number - sptData: SPTData -} - -export interface SPTData -{ - version: string + edition: string + profileId: string + sptData: Spt } diff --git a/project/src/models/eft/profile/ISptProfile.ts b/project/src/models/eft/profile/ISptProfile.ts index 77d5107b..48a0ed82 100644 --- a/project/src/models/eft/profile/ISptProfile.ts +++ b/project/src/models/eft/profile/ISptProfile.ts @@ -213,11 +213,11 @@ export interface Spt /** What mods has this profile loaded at any point in time */ mods?: ModDetails[] /** What gifts has this profile received and how many */ - receivedGifts: ReceivedGift[] + receivedGifts?: ReceivedGift[] /** item TPLs blacklisted from being sold on flea for this profile */ blacklistedItemTpls?: string[] /** key: daily type */ - freeRepeatableRefreshUsedCount: Record + freeRepeatableRefreshUsedCount?: Record } export interface ModDetails