Changeset e007fcd for pages/api/poker


Ignore:
Timestamp:
07/16/22 21:31:18 (2 years ago)
Author:
anastasovv <simon@…>
Branches:
main
Children:
e903234
Parents:
55701f0
Message:

Now you need to activate your account via email & also added mail sending after server crash

Location:
pages/api/poker
Files:
2 edited

Legend:

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

    r55701f0 re007fcd  
    5454 */
    5555
    56 export function createTable(playerId, playerName, tableName) {
     56export function createTable(playerId, playerName, tableName, username) {
    5757    const tableId = uuidv4();
    5858
     
    7575            id: playerId,
    7676            table: tableId,
     77            username: username,
    7778            credits: 0,
    7879            status: '_1_just_entered',
  • pages/api/poker/index.js

    r55701f0 re007fcd  
    198198         * @param tableId
    199199         * @param displayName
    200          */
    201          if (req.query.action === 'join_a_table' && req.query?.session_id && req.query?.tableId && req.query?.displayName) {
     200         * @param username
     201         */
     202         if (req.query.action === 'join_a_table' && req.query?.session_id && req.query?.tableId && req.query?.displayName && req.query?.username) {
    202203            if (req.query.tableId.length > 0) {
    203204                const { success } = getTableAndPlayer(req.query.session_id);
     
    210211                            id: req.query.session_id,
    211212                            table: req.query.tableId,
     213                            username: req.query.username,
    212214                            credits: 0,
    213215                            status: '_1_just_entered',
     
    241243         * @param displayName
    242244         * @param tableName
    243          */
    244         if (req.query.action === 'create_a_table' && req.query?.session_id && req.query?.displayName && req.query?.tableName) {
     245         * @param username
     246         */
     247        if (req.query.action === 'create_a_table' && req.query?.session_id && req.query?.displayName && req.query?.tableName && req.query?.username) {
    245248            const { success } = getTableAndPlayer(req.query.session_id);
    246249
    247250            if (!success) {
    248                 createTable(req.query.session_id, req.query.displayName, req.query.tableName);
     251                createTable(req.query.session_id, req.query.displayName, req.query.tableName, req.query.username);
    249252            }
    250253
     
    305308                        success: true,
    306309                        displayName: postgreRes.data?.displayName,
     310                        username: postgreRes.data?.username,
    307311                        session_id: postgreRes.data?.session_id,
    308312                        credits: postgreRes.data?.credits,
Note: See TracChangeset for help on using the changeset viewer.