snapshot_poker_phase5
This commit is contained in:
@@ -8,6 +8,11 @@ const {
|
||||
PokerEngineError
|
||||
} = require("./pokerEngine");
|
||||
|
||||
const {
|
||||
recordPokerActionProfile,
|
||||
recordPokerHandProfiles
|
||||
} = require("./pokerProfile");
|
||||
|
||||
/*
|
||||
* ============================================================
|
||||
* CONFIG
|
||||
@@ -1965,6 +1970,37 @@ function createPokerService({
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
* Profile/stat history is secondary to the authoritative
|
||||
* Poker state. A profile failure must never invalidate a
|
||||
* successfully committed table action or payout.
|
||||
*/
|
||||
|
||||
try {
|
||||
await recordPokerActionProfile(
|
||||
nextGame,
|
||||
userId,
|
||||
action
|
||||
);
|
||||
|
||||
if (
|
||||
nextGame.data.hand
|
||||
?.state ===
|
||||
"PAYOUT"
|
||||
) {
|
||||
await recordPokerHandProfiles(
|
||||
nextGame
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
catch (error) {
|
||||
console.error(
|
||||
`[PokerProfile] Failed to persist profile history for ${nextGame.gameId}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
|
||||
return clone(nextGame);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user