packages/server/lib/game-managers/pending-game-manager.js
function addPlayer(userId, callbacks) {
        let player = factory.addPlayer();
        if(!player) return null;

        self._callbacks.set(player, callbacks);

        // If the game didn't have an owner, it does now
        // This should only happen when the game is first created
        // and the initial player is added
        if(!owner)
            owner = player;

        self._users[userId] = { id: userId, player };

        return player;
    }
function addPlayer(userId, callbacks) {
        let player = factory.addPlayer();
        if(!player) return null;

        self._callbacks.set(player, callbacks);

        // If the game didn't have an owner, it does now
        // This should only happen when the game is first created
        // and the initial player is added
        if(!owner)
            owner = player;

        self._users[userId] = { id: userId, player };

        return player;
    }
function addPlayer ( userId , callbacks ) { let player = factory . addPlayer ( ) ; if ( ! player ) return null ; self . _callbacks . set ( player , callbacks ) ; // If the game didn't have an owner, it does now // This should only happen when the game is first created // and the initial player is added if ( ! owner ) owner = player ; self . _users [ userId ] = { id : userId , player } ; return player ; }
callback is used to send messages to the players in the game
callback is used to send messages to the players in the game