@EventHandler(priority = EventPriority.LOW) public void onConnection(LoginEvent event) { event.registerIntent((BungeeMain)Universal.get().getMethods().getPlugin()); Universal.get().getMethods().runAsync(() -> { String result = Universal.get().callConnection(event.getConnection().getName(), event.getConnection().getAddress().getAddress().getHostAddress()); if (result != null) { event.setCancelled(true); event.setCancelReason(result); } if (Universal.get().useRedis()) { RedisBungee.getApi().sendChannelMessage("AdvancedBanConnection", event.getConnection().getName() + "," + event.getConnection().getAddress().getAddress().getHostAddress()); } event.completeIntent((BungeeMain)Universal.get().getMethods().getPlugin()); }); }
@EventHandler(priority = EventPriority.HIGH) public void onPostLogin(LoginEvent loginEvent) { if (loginEvent.isCancelled() || isBlacklistEnabled()) { return; } PendingConnection connection = loginEvent.getConnection(); String playerName = connection.getName().toLowerCase(); loginEvent.registerIntent(plugin); Runnable task = () -> loadProfile(loginEvent, connection, playerName); ProxyServer.getInstance().getScheduler().runAsync(plugin, task); }
ProxiedPlayer player = plugin.getProxy().getPlayer(event.getConnection().getName()); if (jedis.sismember("proxy:" + s + ":usersOnline", event.getConnection().getUniqueId().toString())) { event.setCancelled(true); plugin.getUuidTranslator().persistInfo(event.getConnection().getName(), event.getConnection().getUniqueId(), pipeline); RedisUtil.createPlayer(event.getConnection(), pipeline, false);
e.getConnection().getUniqueId(), e.getConnection().getName(), e.getConnection().getVersion(), e.getConnection().getAddress().getAddress().getHostAddress(), e.getConnection().getAddress().getPort(), e.getConnection().isOnlineMode(), e.getConnection().isLegacy() ); if (!proxyConfig.getWhitelist().contains(e.getConnection().getName()) && !proxyConfig.getWhitelist().contains(e.getConnection().getUniqueId().toString()) && !ProxyServer.getInstance().getPluginManager().callEvent(permissionCheckEvent).hasPermission())