client/main.js
// Sends the server a command to create a new lobby
Sends the server a command to create a new lobby
Sends the server a command to create a new lobby
function createLobby() {
    console.log("Hide usernamepagecreate and reveal lobby page.")
    userName = userNameInputCreate.value
    var message = {
        command: "CREATE " + lobbyName + " " + userName 
    }
    socket.send(JSON.stringify(message))
    console.log("Sent CREATE <" + lobbyName + "> <" + userName + "> command to server.")
    usernamepagecreate.setAttribute("hidden", true)
    setLobbyNameField()
    lobbypage.removeAttribute("hidden")
}
function createLobby ( ) { console . log ( "Hide usernamepagecreate and reveal lobby page." ) userName = userNameInputCreate . value var message = { command : "CREATE " + lobbyName + " " + userName } socket . send ( JSON . stringify ( message ) ) console . log ( "Sent CREATE <" + lobbyName + "> <" + userName + "> command to server." ) usernamepagecreate . setAttribute ( "hidden" , true ) setLobbyNameField ( ) lobbypage . removeAttribute ( "hidden" ) }
Sends the server a command to create a new lobby
Sends the server a command to create a new lobby
// send CREATE <lobby name> <username> to server and get lobby back then render lobby page