public void joinRoom(String message, String currentname, Socket socket){
	room = message.substring(6);
	if(roomlist.containsKey(room)){
	    roomnum = Integer.parseInt((roomlist.get(room)).toString());
	    //Checks if a user is in the room already
	    if((rooms.get(roomnum-1)).containsKey(currentname)){
		try{
		    DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
		    dout.writeUTF("You are already in the room " + room + ". You cannot rejoin a room you are already in.");
		} catch(IOException ie) {
		    System.out.println(ie);
		}

	    }
	    //Joins the room
	    else{
		try{
                    DataOutputStream dout = new DataOutputStream(socket.getOutputStream());
                    dout.writeUTF("join;" + room);
                } catch(IOException ie) {
                    System.out.println(ie);
                }

		//Adds the user to lists in the room
		(userroomlist.get(currentname)).add(room);
		(rooms.get(roomnum-1)).put(currentname, outputStreams.get(socket));

		//Notifies others that the user has joined
		sendToChannel(currentname + " has joined the channel " + room + "." , roomnum, currentname, socket, room);
		sendListChannel(roomnum, currentname, socket, room);
	    }
	}
	//The room does not exist, create it
	else if(!roomlist.containsKey(room)){
	    createRoom("/create " + room, socket);
	    joinRoom(message, currentname, socket);
	}
    }