@Override
	public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {

		if (!(sender instanceof Player)) {
			return true;
		}

		Player player = (Player)sender;

		if (HyperPVP.getGameSessions().containsKey(player.getName())) {
			sender.sendMessage(ChatColor.RED + "You are already in a game!");
			return true;
		}

		if (HyperPVP.isCycling()) {
			sender.sendMessage(ChatColor.RED + "You can't join while a game is cycling!");
			return true;
		}

		int rank = 1;

		try {
			rank = HyperPVP.getStorage().readInt32("SELECT rank FROM users WHERE username = '" + player.getName() + "'");	
		} catch (SQLException e) {
			rank = 1;
			e.printStackTrace();	
		}

		if (rank >= 6) {
			player.sendMessage("You don't have permission!");
			return true;
		}

		if (rank >= 3) {

			if (args.length == 1) {
				HyperPVP.getMap().joinGame(player, args[0]);
			} else {
				HyperPVP.getMap().joinGame(player, null);
			}

		} else {

			HyperPVP.getMap().joinGame(player, null);
		}

		return true;
	}