diff --git a/src/lib/minigames/poker/stats.ts b/src/lib/minigames/poker/stats.ts index 0e62d0b..74d363c 100644 --- a/src/lib/minigames/poker/stats.ts +++ b/src/lib/minigames/poker/stats.ts @@ -31,6 +31,13 @@ export interface PokerStats { xpEarned: number; } +/** + * XP rework in progress: when false, finished games still record placements, + * hands won, and best chips, but xpEarned is untouched and no XP push fires. + * Flip to true to resume placement-based XP payouts. + */ +export const POKER_XP_ENABLED = false; + /** * XP per placement, scaled by table size: * 1st = 40x, 2nd = 20x, 3rd = 10x, 4th = 5x (times playerCount). @@ -105,7 +112,7 @@ export async function awardPokerGameResult( const xpByUser: Record = {}; for (const result of results) { - const xp = xpForPlacement(result.placement, playerCount); + const xp = POKER_XP_ENABLED ? xpForPlacement(result.placement, playerCount) : 0; xpByUser[result.userId] = xp; try { @@ -123,7 +130,10 @@ export async function awardPokerGameResult( } const current = readPokerStats(profile); - const next = computePokerStatsDelta(current, result, playerCount); + const delta = computePokerStatsDelta(current, result, playerCount); + const next: PokerStats = POKER_XP_ENABLED + ? delta + : { ...delta, xpEarned: current.xpEarned }; const progression = (profile.progression ?? {}) as Record; const minigames = (progression.minigames ?? {}) as Record; @@ -143,11 +153,13 @@ export async function awardPokerGameResult( depth: 0, }); - broadcastToUser("profile-update", result.userId, { - reason: "xp", - xpGained: xp, - profileId: profile.id, - }); + if (xp > 0) { + broadcastToUser("profile-update", result.userId, { + reason: "xp", + xpGained: xp, + profileId: profile.id, + }); + } } catch (error) { const message = error instanceof Error ? error.message : String(error); payload.logger.error(