Ignore:
Timestamp:
07/12/22 00:13:20 (23 months ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
e9f11ac
Parents:
95ce58b
Message:

Roulette rethought with 1 second update calls

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pages/api/poker/index.js

    r95ce58b rd0ef259  
    256256        /**
    257257         * /---------------------- GET ----------------------/
    258          * Creates the table and enters the user inside
     258         * Updates the state periodically
    259259         * @action update_state
    260260         * @param session_id
     
    265265            const { success, table, player } = getTableAndPlayer(session_id);
    266266
    267             if (table.started && !table.ended) {
     267            if (success && table.started && !table.ended) {
    268268                const d = Date.now();
    269269
     
    272272                        table.players[table.turnIdx].isFolded = true;
    273273
     274                        table.lastActivity = Date.now();
    274275                        setNextPlayerIdx(table.id);
    275276                    }
Note: See TracChangeset for help on using the changeset viewer.