@Override
	public void handleCommand(Command command) 
	{
		if (command == null)
		{
			TestLogger.getInstance().logMessage(TAG + ": Null Command received");
			return;
		}
		
		GameData game = command.getGameData();
		if (game == null)
		{
			TestLogger.getInstance().logMessage(TAG + ": Missing GameData");
			return;
		}
		
		if (game.getCurrentState() == GameState.WAIT_FOR_PLAYERS ||
				game.getCurrentState() == GameState.GAME_RUNNING)
		{
			InetAddress lAddress = (InetAddress)command.getProperty("address");

			@SuppressWarnings("unchecked")
			Map<String, ServerClient> lClients = (Map<String, ServerClient>)command.getProperty("clientInfo");
	
			if (lClients == null || lAddress == null)
			{
				TestLogger.getInstance().logMessage(TAG + ": Missing connection info");
				return;
			}
			
			char lId = (char)command.getProperty("id");
			if (game.playerExist(lId))
			{
				game.removePlayer(lId);				
				lClients.remove(lAddress.getHostAddress());
				game.returnPlayerId(Character.getNumericValue(lId));				
				
				if (!game.hasPlayers() || game.allPlayersDead()) 
				{
					game.reset();					
				}
			}
			else
			{
				TestLogger.getInstance().logMessage(TAG + ": Player does not exist");
			}
		}
		else // This shouldn't happen but just for debugging purposes
		{
			TestLogger.getInstance().logMessage(
					TAG + ": Player attempted to end game while game was not in " +
					GameState.WAIT_FOR_PLAYERS + " or " + GameState.GAME_RUNNING + "state");
		}
	}