addUserToLobby(userId, messageId, callback, callbackQueue) {

        this.log("addUserToLobby(userId): " + userId)
        this.log("addUserToLobby(messageId): " + messageId)

        if(this.hasUserInQueue(userId)) {

            // couple them
            let queueUser =  Object.assign({}, this.userInQueue)

            this.buildLobby(userId, queueUser.id)

            callback(queueUser.id, queueUser.messageId)

            return true

        }

        // put him in queue
        this.addUserToQueue(userId, messageId)

        callbackQueue()

        return false

    }
/**
     *
     * Add the user to lobby using callbacks to perform actions.
     *
     * @param userId
     * @param messageId
     * @param callback
     * @param callbackQueue
     * @returns {boolean}
     */
Add the user to lobby using callbacks to perform actions.
Add the user to lobby using callbacks to perform actions .
addUserToLobby(userId, messageId, callback, callbackQueue) {
        this.log("addUserToLobby(userId): " + userId)
        this.log("addUserToLobby(messageId): " + messageId)
        if(this.hasUserInQueue(userId)) {
            let queueUser =  Object.assign({}, this.userInQueue)
            this.buildLobby(userId, queueUser.id)
            callback(queueUser.id, queueUser.messageId)
            return true
        }
        this.addUserToQueue(userId, messageId)
        callbackQueue()
        return false
    }
addUserToLobby ( userId , messageId , callback , callbackQueue ) { this . log ( "addUserToLobby(userId): " + userId ) this . log ( "addUserToLobby(messageId): " + messageId ) if ( this . hasUserInQueue ( userId ) ) { let queueUser = Object . assign ( { } , this . userInQueue ) this . buildLobby ( userId , queueUser . id ) callback ( queueUser . id , queueUser . messageId ) return true } this . addUserToQueue ( userId , messageId ) callbackQueue ( ) return false }
Add the user to lobby using callbacks to perform actions.
Add the user to lobby using callbacks to perform actions .
// couple them // put him in queue