Changeset aac3b2b for pages/api/poker/index.js
- Timestamp:
- 07/07/22 23:53:57 (2 years ago)
- Branches:
- main
- Children:
- 95ce58b
- Parents:
- 189cd8f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
pages/api/poker/index.js
r189cd8f raac3b2b 47 47 }, 48 48 }], 49 onlyOnePlayerLeft: false, 49 50 winners: [], 50 51 splitWinners: false, … … 281 282 const { success, table } = getTableAndPlayer(req.query.session_id) 282 283 283 if (success && !table.started ) {284 if (success && !table.started && !table.ended && table.players.filter(e=>e.isSatDown===true).length >= 2) { 284 285 table.players.forEach(player => { 285 286 axios.get(`${process.env.HOME_URL}/api/postgre/?action=check_if_logged_in&session_id=${player.id}`).then(postgreRes => { … … 342 343 player.isFolded = true; 343 344 344 if (table.players[table.turnIdx] !== undefined && table.players[table.turnIdx] === player) { 345 setNextPlayerIdx(table.id); 345 if (table.started) { 346 if (table.players[table.turnIdx] !== undefined && table.players[table.turnIdx] === player) { 347 setNextPlayerIdx(table.id); 348 } 349 } 350 else { 351 table.players = table.players.filter(e=>e.isGhost === false); 346 352 } 347 353 }
Note:
See TracChangeset
for help on using the changeset viewer.