client/main.js
// Sends the server a command to join a lobby
Sends the server a command to join a lobby
Sends the server a command to join a lobby
function joinLobby() {
    console.log("Hide usernamepagejoin and reveal waiting page.")
    userName = userNameInput.value
    var message = {
        command: "JOIN " + lobbyName + " " + userName 
    }
    socket.send(JSON.stringify(message))
    console.log("Sent JOIN <" + lobbyName + "> <" + userName + "> command to server.")
    usernamepagejoin.setAttribute("hidden", true)
    setLobbyNameField()
    waitingpage.removeAttribute("hidden")
}
function joinLobby ( ) { console . log ( "Hide usernamepagejoin and reveal waiting page." ) userName = userNameInput . value var message = { command : "JOIN " + lobbyName + " " + userName } socket . send ( JSON . stringify ( message ) ) console . log ( "Sent JOIN <" + lobbyName + "> <" + userName + "> command to server." ) usernamepagejoin . setAttribute ( "hidden" , true ) setLobbyNameField ( ) waitingpage . removeAttribute ( "hidden" ) }
Sends the server a command to join a lobby
Sends the server a command to join a lobby
// send JOIN <lobby name> <username> to server and get lobby back then render lobby page