public void run() {
		boolean running = true;
		String NextNick;
		
		while (running) {
			try {
				switch (Integer.parseInt(((String) in.readObject()))) {
					case 3: // Normal message
						System.out.println((String) in.readObject());
						break;
					case 4: // List users
						System.out.println("[Client] Current list of users:");
						while (!((NextNick = (String) in.readObject()).equalsIgnoreCase("5"))) {
							System.out.println("- " + NextNick);
						}
						System.out.println("[Client] End of list.");
						break;
					case 6: // Whisper
						System.out.println((String) in.readObject());
						break;
					case 9: // Exit
						System.out.println("[Client] Exiting");
						out.close();
						in.close();
						clientSocket.close();
						running = false;
						break;
					default: // Error
						System.out.println("[Client] Error");
				}
			} catch (NumberFormatException e) {
				e.printStackTrace();
			} catch (IOException e) {
				e.printStackTrace();
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			}
		}
	}