Remove unsued properties + improved how user data is stored/generated

This commit is contained in:
Dev 2024-07-17 19:30:17 +01:00
parent 43d7e05f21
commit 4b8b3b77a7
2 changed files with 7 additions and 12 deletions

View File

@ -101,7 +101,7 @@ export class RagfairOfferGenerator
* @param items Items in the offer * @param items Items in the offer
* @param barterScheme Cost of item (currency or barter) * @param barterScheme Cost of item (currency or barter)
* @param loyalLevel Loyalty level needed to buy item * @param loyalLevel Loyalty level needed to buy item
* @param sellInOnePiece Set StackObjectsCount to 1 * @param isPackOffer Is offer being created flaged as a pack
* @returns IRagfairOffer * @returns IRagfairOffer
*/ */
protected createOffer( protected createOffer(
@ -110,7 +110,7 @@ export class RagfairOfferGenerator
items: Item[], items: Item[],
barterScheme: IBarterScheme[], barterScheme: IBarterScheme[],
loyalLevel: number, loyalLevel: number,
sellInOnePiece = false, isPackOffer = false,
): IRagfairOffer ): IRagfairOffer
{ {
const isTrader = this.ragfairServerHelper.isTrader(userID); const isTrader = this.ragfairServerHelper.isTrader(userID);
@ -148,12 +148,9 @@ export class RagfairOfferGenerator
startTime: time, startTime: time,
endTime: this.getOfferEndTime(userID, time), endTime: this.getOfferEndTime(userID, time),
loyaltyLevel: loyalLevel, loyaltyLevel: loyalLevel,
sellInOnePiece: sellInOnePiece, sellInOnePiece: isPackOffer,
priority: false,
locked: false, locked: false,
unlimitedCount: false, unlimitedCount: false,
notAvailable: false,
CurrentItemCount: itemRootCount,
}; };
this.offerCounter++; this.offerCounter++;
@ -184,9 +181,10 @@ export class RagfairOfferGenerator
const playerProfile = this.profileHelper.getPmcProfile(userID)!; const playerProfile = this.profileHelper.getPmcProfile(userID)!;
return { return {
id: playerProfile._id, id: playerProfile._id,
memberType: MemberCategory.DEFAULT, memberType: playerProfile.Info.MemberCategory,
selectedMemberCategory: playerProfile.Info.SelectedMemberCategory,
nickname: playerProfile.Info.Nickname, nickname: playerProfile.Info.Nickname,
rating: playerProfile.RagfairInfo.rating, rating: playerProfile.RagfairInfo.rating ?? 0,
isRatingGrowing: playerProfile.RagfairInfo.isRatingGrowing, isRatingGrowing: playerProfile.RagfairInfo.isRatingGrowing,
avatar: undefined, avatar: undefined,
aid: playerProfile.aid, aid: playerProfile.aid,

View File

@ -24,10 +24,6 @@ export interface IRagfairOffer
/** Rouble price */ /** Rouble price */
summaryCost: number summaryCost: number
user: IRagfairOfferUser user: IRagfairOfferUser
notAvailable: boolean
/** TODO - implement this value - not currently used */
CurrentItemCount: number
priority: boolean
} }
export interface OfferRequirement export interface OfferRequirement
@ -43,6 +39,7 @@ export interface IRagfairOfferUser
nickname?: string nickname?: string
rating?: number rating?: number
memberType: MemberCategory memberType: MemberCategory
selectedMemberCategory?: MemberCategory
avatar?: string avatar?: string
isRatingGrowing?: boolean isRatingGrowing?: boolean
aid?: number aid?: number