@Override
	public void run() 
	{
		// Send a message to the server to set the username
		try 
		{
			out.writeObject(new CallMe(gui.getUsername()));
			out.flush();
		} 
		catch (IOException e1) { e1.printStackTrace(); }
		
		// Read messages from the server
		while(true)
		{
			try 
			{
				message = (abstractMessage) in.readObject();
				
				// Receive message from the server and output to GUI
				if (message.getType() == abstractMessage.MESSAGETYPE.SCHAT)	 
				{
					SchatMessage serverMessage = (SchatMessage) message;
					gui.getChatWindow().append(serverMessage.getFrom() + ": " + serverMessage.getBody() + "\n");
				}
				
				// Booted by the server
				else if (message.getType() == abstractMessage.MESSAGETYPE.DEAD)	
				{
					disconnect();
				}
				
				// Update the list of users
				else if (message.getType() == abstractMessage.MESSAGETYPE.RESP) 
				{
					RespMessage msg = (RespMessage) message;
					System.out.println(msg.getPayload());
					gui.getConnectWindow().setText(msg.getPayload());
					gui.validate();
					gui.repaint();
					nClients = msg.getnUsers();
				}
				
				else if (message.getType() == abstractMessage.MESSAGETYPE.COMMAND)
				{
					CommandMessage cmd = (CommandMessage) message;
					
					if (cmd.id != 0)
					{
						gui.printToPlayArea(cmd.message);
					}
					
					// Only the host gets these messages
					if (cmd.command == 'P')
					{
						gui.printToPlayArea(players.get(cmd.id).printHand());
					}
					
					
					
				}
				
			} 
			catch (ClassNotFoundException | IOException e) 
			{
				e.printStackTrace();
			}
		}	
	}