public static void commandHandler(String cmd) throws IOException {
		// switch(String) doesn't exist on JDK 6 (only 7)... Resorting to a series of ifelse statments
		if(cmd.contains("/query-for-peers")) {
			System.out.println("Querying directory server...");
			sendToDirectory("QUERY", null, null);
		} else if(cmd.contains("/go-online")) {
			System.out.println("Informing directory server...");
			String data[] = {"", ""};
			sendToDirectory("ONLINE", data, username);
			runChatServer();
		} else if(cmd.contains("/go-offline")) {
			System.out.println("Informing directory server...");
			sendToDirectory("OFFLINE", null, null);
			endChatServer();
		} else if(cmd.contains("/join-room")) {
			if(cmd.length() < 11) {
				System.out.println("Please specify a chat room to join");
			} else {
				
				for (String[] roomListing : rooms) {
					if(roomListing[0].equals(cmd.substring(11))) {
						System.out.println("Joining chat room \""+roomListing[0]+"\"...");
						System.out.println("Informing directory server...");
						String data[] = {"", cmd.substring(11)};
						sendToDirectory("JOINED", data, cmd.substring(11));
						consoleState = cmd.substring(11);
						joinChatServer(roomListing[1], Integer.parseInt(roomListing[2]));
						
					}
				}
				System.out.println("No room by that name!");
				
			}
		} else if(cmd.contains("/quit")) {
			System.out.println("Quitting!");
		} else if(cmd.contains("/test-rdt")) {
			System.out.println("Sending a payload > 58 bytes to directory server...");
			sendToDirectory("RDTCHECK", null, "AAAAAAAAAAAAAAAAAAABBBBBBBBBBCCCCCCCCCCCCCCCCCCCCCCCCCCCC");
		} else {
			System.out.println("You need to join a room before chatting!");
		}
	}