|
1 | 1 | import type { HandlerContext } from '@/modules/core/handler'; |
2 | 2 | import { logFunctionStart, logFunctionEnd } from '@/modules/core/logger'; |
3 | 3 | import { createHand } from './handRepo'; |
4 | | -import { bulkCreateSeats, postBlind, dealHoleCards } from './seatsRepo'; |
| 4 | +import { bulkCreateSeats, postBlind } from './seatsRepo'; |
5 | 5 | import { createAction } from './actionsRepo'; |
6 | 6 | import { createMainPot } from './potsRepo'; |
7 | 7 | import { getRoom } from './roomRepo'; |
8 | | -import { createDeck, dealCards, cardsToString } from './cardUtils'; |
| 8 | +// TODO: Import poker-engine properly |
| 9 | +// import { startHand, type EngineConfig, type Seat } from '@gamehub/poker-engine'; |
9 | 10 |
|
10 | 11 | export async function startHandForRoom(context: HandlerContext, roomId: string): Promise<void> { |
11 | 12 | logFunctionStart('gameFlow.startHandForRoom', { roomId, userId: context.user.id }); |
@@ -45,16 +46,8 @@ export async function startHandForRoom(context: HandlerContext, roomId: string): |
45 | 46 | // Create main pot with all active seats |
46 | 47 | await createMainPot(hand.id, players.map((_, idx) => idx)); |
47 | 48 |
|
48 | | - // Deal hole cards to each player |
49 | | - const deck = createDeck(hand.deck_seed); |
50 | | - let remainingDeck = deck; |
51 | | - |
52 | | - for (let i = 0; i < players.length; i++) { |
53 | | - const { cards, remainingDeck: newDeck } = dealCards(remainingDeck, 2); |
54 | | - remainingDeck = newDeck; |
55 | | - const cardStrings = cards.map(card => cardsToString([card])); |
56 | | - await dealHoleCards(hand.id, i, cardStrings); |
57 | | - } |
| 49 | + // TODO: Use poker-engine to deal cards |
| 50 | + // For now, skip card dealing until poker-engine is properly integrated |
58 | 51 |
|
59 | 52 | // Post blinds and record actions |
60 | 53 | await postBlind(hand.id, sbPos, sb); |
|
0 commit comments