Search in sources :

Example 1 with ConnectionHandler

use of fr.glowstoner.connectionsapi.network.ConnectionHandler in project FireAPI by FireBlade-Serv.

the class BungeeMain method onEnable.

@Override
public void onEnable() {
    super.getLogger().info("FireAPI actif !");
    this.sql.connection();
    this.sql.startSqlRefreshScheduler(1800L);
    this.sql.putConsole();
    this.rank = new FireRank(this.sql);
    super.getProxy().registerChannel("fireapi");
    this.log = new BigBrotherLoginGetter();
    try {
        this.log.load();
    } catch (Exception e1) {
        e1.printStackTrace();
    }
    try {
        ConnectionsAPI.init();
        Client c = new Client("62.4.31.183", 2566);
        c.start();
        this.c = c;
        ConnectionHandler ch = c;
        ch.eval();
        ch.sendPacket(new PacketLogin(this.log.getKey(), log.getPassword()));
        ch.sendPacket(new PacketVersion(VersionType.BUNGEECORD_VERSION));
        ch.sendPacket(new PacketCommand("name main-bungeecord"));
        BigBrotherConnectionCheck check = new BigBrotherConnectionCheck(this, BigBrotherConnectionCheckType.GLOBAL_CHECK, BigBrotherConnectionInfos.builder().id("main-bungeecord").key(this.log.getKey()).password(this.log.getPassword()).versionType(VersionType.BUNGEECORD_VERSION).build());
        check.startChecks();
        this.setChecker(check);
    } catch (Exception ex) {
        BigBrotherConnectionCheck check = new BigBrotherConnectionCheck(this, BigBrotherConnectionCheckType.ERROR_CHECK, BigBrotherConnectionInfos.builder().id("main-bungeecord").key(this.log.getKey()).password(this.log.getPassword()).versionType(VersionType.BUNGEECORD_VERSION).build());
        check.startChecks();
    }
    ConnectionsAPI.getListeners().registerClientListener(new ClientListener() {

        @Override
        public void onPacketReceive(Packet packet) {
            if (packet instanceof PacketExecute) {
                BungeeMain.super.getLogger().info("(BigBrother) Execution de la commande : " + ((PacketExecute) packet).getServerCommand() + ".");
                BungeeMain.super.getProxy().getPluginManager().dispatchCommand(BungeeMain.super.getProxy().getConsole(), ((PacketExecute) packet).getServerCommand());
            } else if (packet instanceof PacketPlayerPing) {
                PacketPlayerPing pp = (PacketPlayerPing) packet;
                BungeeMain.super.getProxy().getPlayer(pp.getName()).sendMessage(new TextComponent("§6[§ePing§6]§r Ton ping §eproxy§r est de §e" + BungeeMain.super.getProxy().getPlayer(pp.getName()).getPing() + " ms§r !"));
            } else if (packet instanceof PacketBigBrotherAC) {
                PacketBigBrotherAC gacp = (PacketBigBrotherAC) packet;
                if (gacp.getType().equals(BigBrotherTypeAC.CHEAT_DETECTION)) {
                    if (gacp.getTODO().equals(BigBrotherActionAC.INFORM_STAFF)) {
                        for (ProxiedPlayer ps : getProxy().getPlayers()) {
                            if (api.getRankSystem().hasRankAndSup(ps.getName(), Rank.ASSISTANT)) {
                                ps.sendMessage(new TextComponent("§c[BigBrother] [Cheat] §4" + gacp.getPlayerName() + " §r~ " + gacp.getMessage() + " §c" + gacp.getPing() + "ms"));
                            }
                        }
                    }
                }
            }
        }
    });
    this.friends = new FireFriends(this);
    this.friends.initFolder();
    try {
        this.friends.loadConfiguration();
    } catch (IOException e) {
        e.printStackTrace();
    }
    this.auth = new FireAuth(this);
    try {
        this.auth.loadConfiguration();
    } catch (IOException e) {
        e.printStackTrace();
    }
    this.chat = new FireChat(this);
    this.wl = new FireWL(this);
    this.wl.loadConfiguration();
    super.getLogger().info("Clé de sécurité utilisée : " + this.auth.getSecurityKey());
    PluginManager man = super.getProxy().getPluginManager();
    man.registerCommand(this, new CoinsCheckerCommand(this, "coins"));
    man.registerCommand(this, new Website("site"));
    man.registerCommand(this, new Discord("discord"));
    man.registerCommand(this, new FriendsCommand(this, "amis"));
    man.registerCommand(this, new FireRankCommand(this, "firerank"));
    man.registerCommand(this, new RegisterCommand(this, "register"));
    man.registerCommand(this, new LoginCommand(this, "login"));
    man.registerCommand(this, new FireWhiteListCommand("firewl", this));
    StaffChatCommand scc = new StaffChatCommand(this, "firestaffchat");
    man.registerCommand(this, scc);
    Events events = new Events(this, scc);
    man.registerListener(this, events);
    this.check.registerListener(events);
    api = this;
}
Also used : ProxiedPlayer(net.md_5.bungee.api.connection.ProxiedPlayer) PacketCommand(fr.glowstoner.connectionsapi.network.packets.command.PacketCommand) BigBrotherConnectionCheck(fr.glowstoner.fireapi.bigbrother.console.check.BigBrotherConnectionCheck) Website(fr.glowstoner.fireapi.bungeecord.commands.misc.Website) PacketVersion(fr.glowstoner.fireapi.bigbrother.console.packets.PacketVersion) RegisterCommand(fr.glowstoner.fireapi.bungeecord.commands.RegisterCommand) PacketPlayerPing(fr.glowstoner.fireapi.bigbrother.console.packets.ping.PacketPlayerPing) PluginManager(net.md_5.bungee.api.plugin.PluginManager) PacketExecute(fr.glowstoner.fireapi.bigbrother.console.packets.PacketExecute) Events(fr.glowstoner.fireapi.bungeecord.events.Events) FireRankCommand(fr.glowstoner.fireapi.bungeecord.commands.FireRankCommand) BigBrotherLoginGetter(fr.glowstoner.fireapi.bigbrother.console.login.BigBrotherLoginGetter) FireWL(fr.glowstoner.fireapi.wl.FireWL) Discord(fr.glowstoner.fireapi.bungeecord.commands.misc.Discord) Client(fr.glowstoner.connectionsapi.network.client.Client) FireRank(fr.glowstoner.fireapi.rank.FireRank) TextComponent(net.md_5.bungee.api.chat.TextComponent) Packet(fr.glowstoner.connectionsapi.network.packets.Packet) LoginCommand(fr.glowstoner.fireapi.bungeecord.commands.LoginCommand) FireAuth(fr.glowstoner.fireapi.bungeecord.auth.FireAuth) PacketLogin(fr.glowstoner.connectionsapi.network.packets.login.PacketLogin) IOException(java.io.IOException) IOException(java.io.IOException) ClientListener(fr.glowstoner.connectionsapi.network.events.ClientListener) StaffChatCommand(fr.glowstoner.fireapi.bungeecord.commands.StaffChatCommand) ConnectionHandler(fr.glowstoner.connectionsapi.network.ConnectionHandler) FriendsCommand(fr.glowstoner.fireapi.bungeecord.commands.FriendsCommand) FireFriends(fr.glowstoner.fireapi.bungeecord.friends.FireFriends) FireWhiteListCommand(fr.glowstoner.fireapi.bungeecord.commands.FireWhiteListCommand) FireChat(fr.glowstoner.fireapi.chat.FireChat) PacketBigBrotherAC(fr.glowstoner.fireapi.bigbrother.ac.packet.PacketBigBrotherAC) CoinsCheckerCommand(fr.glowstoner.fireapi.bungeecord.commands.CoinsCheckerCommand)

Example 2 with ConnectionHandler

use of fr.glowstoner.connectionsapi.network.ConnectionHandler in project FireAPI by FireBlade-Serv.

the class BukkitMain method onEnable.

@Override
public void onEnable() {
    super.getLogger().info("FireAPI actif !");
    sql = new FireSQL();
    this.sql.connection();
    this.sql.startSqlRefreshScheduler(1800L);
    this.sql.putConsole();
    rank = new FireRank(this.sql);
    this.chat = new FireChat(this);
    this.tag = new FireTag(this);
    this.tag.registerRanks();
    FireBukkitID id = new FireBukkitID(this);
    try {
        id.loadConfiguration();
    } catch (IOException | InvalidConfigurationException e1) {
        e1.printStackTrace();
    }
    this.id = id.getID();
    this.log = new BigBrotherLoginGetter();
    try {
        this.log.load();
    } catch (Exception e1) {
        e1.printStackTrace();
    }
    super.getLogger().info("ID serveur utilisé : " + this.id);
    this.injector = new FireInjector();
    this.ac = new BigBrotherAC(this);
    this.ac.init();
    this.ac.startKillAuraChecks((long) (30 * 20));
    try {
        ConnectionsAPI.init();
        Client c = new Client("62.4.31.183", 2566);
        c.start();
        this.c = c;
        ConnectionHandler ch = c;
        ch.eval();
        ch.sendPacket(new PacketLogin(this.log.getKey(), this.log.getPassword()));
        ch.sendPacket(new PacketVersion(VersionType.SPIGOT_VERSION));
        ch.sendPacket(new PacketCommand("name " + this.id));
        BigBrotherConnectionCheck check = new BigBrotherConnectionCheck(this, BigBrotherConnectionCheckType.GLOBAL_CHECK, BigBrotherConnectionInfos.builder().id(this.id).key(this.log.getKey()).password(this.log.getPassword()).versionType(VersionType.SPIGOT_VERSION).build());
        check.startChecks();
        this.setChecker(check);
    } catch (Exception ex) {
        BigBrotherConnectionCheck check = new BigBrotherConnectionCheck(this, BigBrotherConnectionCheckType.ERROR_CHECK, BigBrotherConnectionInfos.builder().id(this.id).key(this.log.getKey()).password(this.log.getPassword()).versionType(VersionType.SPIGOT_VERSION).build());
        check.startChecks();
    }
    ConnectionsAPI.getListeners().registerClientListener(new ClientListener() {

        @Override
        public void onPacketReceive(Packet packet) {
            if (packet instanceof PacketExecute) {
                BukkitMain.super.getServer().dispatchCommand(BukkitMain.super.getServer().getConsoleSender(), ((PacketExecute) packet).getServerCommand());
            } else if (packet instanceof PacketFriends) {
                PacketFriends pf = (PacketFriends) packet;
                if (pf.getAction() instanceof FriendsActionTransmetterGUI) {
                    FriendsActionTransmetterGUI fa = (FriendsActionTransmetterGUI) pf.getAction();
                    if (fa.to().equals(VersionType.SPIGOT_VERSION)) {
                        FriendsActionInventoryGUI faig = new FriendsActionInventoryGUI(fa.getName(), fa.getFriends(), fa.getConnected());
                        faig.initPlayer(BukkitMain.this);
                        faig.generateInventory();
                        faig.openInventory();
                    }
                }
            }
        }
    });
    Events events = new Events(this);
    super.getServer().getPluginManager().registerEvents(events, this);
    super.getServer().getPluginManager().registerEvents(new EventsAT(this), this);
    this.check.registerListener(events);
    super.getCommand("ping").setExecutor(new PingCommand(this));
    super.getCommand("at").setExecutor(new AdminToolsCmd(this));
    api = this;
}
Also used : EventsAT(be.goldocelot.admintools.EventsAT) PacketCommand(fr.glowstoner.connectionsapi.network.packets.command.PacketCommand) BigBrotherConnectionCheck(fr.glowstoner.fireapi.bigbrother.console.check.BigBrotherConnectionCheck) PacketVersion(fr.glowstoner.fireapi.bigbrother.console.packets.PacketVersion) FireSQL(fr.glowstoner.fireapi.sql.FireSQL) InvalidConfigurationException(org.bukkit.configuration.InvalidConfigurationException) PacketExecute(fr.glowstoner.fireapi.bigbrother.console.packets.PacketExecute) BigBrotherLoginGetter(fr.glowstoner.fireapi.bigbrother.console.login.BigBrotherLoginGetter) Client(fr.glowstoner.connectionsapi.network.client.Client) FireRank(fr.glowstoner.fireapi.rank.FireRank) Packet(fr.glowstoner.connectionsapi.network.packets.Packet) BigBrotherAC(fr.glowstoner.fireapi.bigbrother.ac.BigBrotherAC) FriendsActionInventoryGUI(fr.glowstoner.fireapi.bukkit.friends.FriendsActionInventoryGUI) FriendsActionTransmetterGUI(fr.glowstoner.fireapi.bungeecord.friends.packets.action.FriendsActionTransmetterGUI) FireBukkitID(fr.glowstoner.fireapi.bukkit.id.FireBukkitID) IOException(java.io.IOException) PacketLogin(fr.glowstoner.connectionsapi.network.packets.login.PacketLogin) PacketFriends(fr.glowstoner.fireapi.bungeecord.friends.packets.PacketFriends) IOException(java.io.IOException) InvalidConfigurationException(org.bukkit.configuration.InvalidConfigurationException) ClientListener(fr.glowstoner.connectionsapi.network.events.ClientListener) PingCommand(fr.glowstoner.fireapi.bukkit.commands.PingCommand) FireTag(fr.glowstoner.fireapi.bukkit.tag.FireTag) ConnectionHandler(fr.glowstoner.connectionsapi.network.ConnectionHandler) FireChat(fr.glowstoner.fireapi.chat.FireChat) AdminToolsCmd(be.goldocelot.admintools.AdminToolsCmd) FireInjector(fr.glowstoner.fireapi.bukkit.nms.packetlistener.FireInjector)

Example 3 with ConnectionHandler

use of fr.glowstoner.connectionsapi.network.ConnectionHandler in project FireAPI by FireBlade-Serv.

the class BigBrotherListener method onPacketReceive.

@Override
public void onPacketReceive(Packet packet) {
    try {
        ConnectionHandler server = packet.getConnection();
        String name = (server.getName().equals("default-name")) ? server.getIP() : server.getName();
        if (!(packet instanceof PacketPing)) {
            if (!(packet instanceof PacketSpyAction)) {
                System.out.println("[BigBrother] Packet reçu : " + name + " -> " + packet.getClass().getSimpleName());
            } else {
                System.out.println("[BigBrother] Packet reçu : " + name + " -> " + packet.getClass().getSimpleName() + " / " + ((PacketSpyAction) packet).getAction().name());
            }
        }
        if (server.isLogged().equals(LoginResult.NOT_LOGGED)) {
            if (packet instanceof PacketLogin) {
                PacketLogin pl = (PacketLogin) packet;
                try {
                    String cpass = pl.decryptPass(this.log.getKey());
                    System.out.println("[BigBrother] PacketLogin reçu, valeur du PASS (crypt) : " + pl.getCryptPassword());
                    System.out.println("[BigBrother] PacketLogin reçu, valeur du PASS (D_key) : " + cpass);
                    if (cpass.equals(this.log.getPassword())) {
                        server.sendPacket(new PacketText("[BigBrother] Connection réussie !"));
                        server.setLoginResult(LoginResult.LOGGED);
                        listeners.callOnConnectionSuccessfullServerListener(server);
                    } else {
                        server.sendMessage("[BigBrother] Mot de passe incorect !");
                        if (limit.containsKey(server)) {
                            limit.replace(server, limit.get(server) + 1);
                            if (limit.get(server) == 3) {
                                server.sendPacket(new PacketText("[BigBrother] Trop de tentatives ratées ! Déconnexion ..."));
                                server.close();
                            }
                        } else {
                            limit.put(server, 1);
                        }
                    }
                } catch (InvalidKeyException | NoSuchAlgorithmException | NoSuchPaddingException | IllegalBlockSizeException | BadPaddingException | IOException e) {
                    return;
                }
            } else {
                server.sendPacket(new PacketText("[BigBrother] Vous devez vous connecter !"));
                return;
            }
        }
        if (packet instanceof PacketCommand) {
            this.listeners.callOnCommandServerListener((PacketCommand) packet);
        } else if (packet instanceof PacketVersion) {
            PacketVersion ver = (PacketVersion) packet;
            if (!this.connectionstype.containsKey(VersionType.SPIGOT_VERSION)) {
                if (ver.getType().equals(VersionType.SPIGOT_VERSION)) {
                    List<ConnectionHandler> list = new CopyOnWriteArrayList<>();
                    list.add(server);
                    this.connectionstype.put(VersionType.SPIGOT_VERSION, list);
                }
            } else {
                if (ver.getType().equals(VersionType.SPIGOT_VERSION)) {
                    List<ConnectionHandler> list = this.connectionstype.get(VersionType.SPIGOT_VERSION);
                    list.add(server);
                    this.connectionstype.replace(VersionType.SPIGOT_VERSION, list);
                }
            }
            if (!this.connectionstype.containsKey(VersionType.BUNGEECORD_VERSION)) {
                if (ver.getType().equals(VersionType.BUNGEECORD_VERSION)) {
                    List<ConnectionHandler> list = new CopyOnWriteArrayList<>();
                    list.add(server);
                    this.connectionstype.put(VersionType.BUNGEECORD_VERSION, list);
                }
            } else {
                if (ver.getType().equals(VersionType.BUNGEECORD_VERSION)) {
                    List<ConnectionHandler> list = this.connectionstype.get(VersionType.BUNGEECORD_VERSION);
                    list.add(server);
                    this.connectionstype.replace(VersionType.BUNGEECORD_VERSION, list);
                }
            }
        } else if (packet instanceof PacketFriends) {
            PacketFriends pf = (PacketFriends) packet;
            if (pf.getAction() instanceof FriendsActionTransmetterGUI) {
                FriendsActionTransmetterGUI fa = (FriendsActionTransmetterGUI) pf.getAction();
                if (fa.to().equals(VersionType.SPIGOT_VERSION)) {
                    for (ConnectionHandler chs : this.connected) {
                        if (chs.getName().equals(fa.getServerDestination())) {
                            chs.sendPacket(packet);
                        }
                    }
                }
            }
        } else if (packet instanceof PacketPlayerPing) {
            PacketPlayerPing pp = (PacketPlayerPing) packet;
            if (pp.getState().equals(PingState.INIT_SERVER)) {
                pp.setState(PingState.BUNGEE_REQUEST);
                try {
                    this.getServerConnectionByNameUnsafe(VersionType.BUNGEECORD_VERSION, "main-bungeecord").sendPacket(pp);
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        } else if (packet instanceof PacketSpyAction) {
            PacketSpyAction spy = (PacketSpyAction) packet;
            Calendar cal = GregorianCalendar.getInstance();
            cal.setTime(new Date());
            if (this.gs.ifDataFileExists(spy.getPlayerName())) {
                this.gs.updateDataFile(spy.getPlayerName(), BigBrotherSpyUtils.mergeHistory(this.gs.getHistory(spy.getPlayerName()), spy));
            } else {
                BigBrotherSpyHistory gh = new BigBrotherSpyHistory(spy.getPlayerName(), spy.getIP(), BigBrotherSpyUtils.toFireCalendar(cal));
                gh.putMessage(BigBrotherSpyUtils.toFireCalendar(spy.getActionDate()), spy.getAction(), spy.getFormatedMsg(), spy.getRawMsg());
                this.gs.createNewDataFile(spy.getPlayerName(), gh);
            }
        } else if (packet instanceof PacketSpyHistoryGetter) {
            PacketSpyHistoryGetter get = (PacketSpyHistoryGetter) packet;
            if (get.getState().equals(BigBrotherSpyHistoryGetterState.REQUEST)) {
                get.setState(BigBrotherSpyHistoryGetterState.SEND);
                get.setHistory(this.gs.getHistory(get.getPlayerName()));
                server.sendPacket(get);
            }
        } else if (packet instanceof PacketBigBrotherAC) {
            PacketBigBrotherAC gacp = (PacketBigBrotherAC) packet;
            if (gacp.getType().equals(BigBrotherTypeAC.CHEAT_DETECTION)) {
                if (gacp.getTODO().equals(BigBrotherActionAC.INFORM_STAFF)) {
                    this.getServerConnectionByNameUnsafe(VersionType.BUNGEECORD_VERSION, "main-bungeecord").sendPacket(gacp);
                }
            }
        }
    } catch (Exception e) {
        return;
    }
}
Also used : PacketCommand(fr.glowstoner.connectionsapi.network.packets.command.PacketCommand) IllegalBlockSizeException(javax.crypto.IllegalBlockSizeException) PacketVersion(fr.glowstoner.fireapi.bigbrother.console.packets.PacketVersion) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) BadPaddingException(javax.crypto.BadPaddingException) PacketPlayerPing(fr.glowstoner.fireapi.bigbrother.console.packets.ping.PacketPlayerPing) List(java.util.List) CopyOnWriteArrayList(java.util.concurrent.CopyOnWriteArrayList) PacketText(fr.glowstoner.connectionsapi.network.packets.PacketText) FriendsActionTransmetterGUI(fr.glowstoner.fireapi.bungeecord.friends.packets.action.FriendsActionTransmetterGUI) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) BigBrotherSpyHistory(fr.glowstoner.fireapi.bigbrother.spy.BigBrotherSpyHistory) PacketPing(fr.glowstoner.connectionsapi.network.packets.PacketPing) PacketSpyAction(fr.glowstoner.fireapi.bigbrother.spy.packets.PacketSpyAction) NoSuchPaddingException(javax.crypto.NoSuchPaddingException) PacketLogin(fr.glowstoner.connectionsapi.network.packets.login.PacketLogin) IOException(java.io.IOException) InvalidKeyException(java.security.InvalidKeyException) PacketFriends(fr.glowstoner.fireapi.bungeecord.friends.packets.PacketFriends) Date(java.util.Date) NoSuchPaddingException(javax.crypto.NoSuchPaddingException) IllegalBlockSizeException(javax.crypto.IllegalBlockSizeException) IOException(java.io.IOException) BadPaddingException(javax.crypto.BadPaddingException) NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) InvalidKeyException(java.security.InvalidKeyException) ConnectionHandler(fr.glowstoner.connectionsapi.network.ConnectionHandler) PacketSpyHistoryGetter(fr.glowstoner.fireapi.bigbrother.spy.packets.PacketSpyHistoryGetter) PacketBigBrotherAC(fr.glowstoner.fireapi.bigbrother.ac.packet.PacketBigBrotherAC)

Example 4 with ConnectionHandler

use of fr.glowstoner.connectionsapi.network.ConnectionHandler in project FireAPI by FireBlade-Serv.

the class BigBrotherConnectionCheck method connectionCheck.

public void connectionCheck() throws BigBrotherNotConnectedException {
    try {
        System.out.println("[FireAPI] Reconnection avec IP=" + this.client.getIP() + " et PORT=" + this.client.getPort());
        this.client = new Client(this.client.getIP(), this.client.getPort());
        this.client.start();
        ConnectionHandler ch = (ConnectionHandler) this.client;
        ch.sendPacket(new PacketLogin(this.infos.getKey(), this.infos.getPassword()));
        ch.sendPacket(new PacketVersion(this.infos.getVersionType()));
        ch.sendPacket(new PacketCommand("name " + this.infos.getId()));
        this.api.setClient((Client) ch);
        this.api.setChecker(this);
        this.callListener(ch);
    } catch (Exception ex) {
        throw new BigBrotherNotConnectedException("Erreur sur l'envoi d'un packet (connection protocol) " + "ErreurClass = " + ex.getClass().getSimpleName() + ", " + ex.getMessage());
    }
}
Also used : ConnectionHandler(fr.glowstoner.connectionsapi.network.ConnectionHandler) PacketCommand(fr.glowstoner.connectionsapi.network.packets.command.PacketCommand) PacketVersion(fr.glowstoner.fireapi.bigbrother.console.packets.PacketVersion) BigBrotherNotConnectedException(fr.glowstoner.fireapi.bigbrother.console.check.exceptions.BigBrotherNotConnectedException) PacketLogin(fr.glowstoner.connectionsapi.network.packets.login.PacketLogin) Client(fr.glowstoner.connectionsapi.network.client.Client) BigBrotherNotConnectedException(fr.glowstoner.fireapi.bigbrother.console.check.exceptions.BigBrotherNotConnectedException)

Example 5 with ConnectionHandler

use of fr.glowstoner.connectionsapi.network.ConnectionHandler in project FireAPI by FireBlade-Serv.

the class BigBrotherListener method refreshLists.

private void refreshLists() {
    List<ConnectionHandler> newl = this.connected;
    for (ConnectionHandler c : this.connected) {
        if (!c.isConnectedOrValid()) {
            newl.remove(c);
        }
    }
    this.connected = newl;
    for (List<ConnectionHandler> conlist : this.connectionstype.values()) {
        for (ConnectionHandler in : conlist) {
            if (!in.isConnectedOrValid()) {
                if (this.connectionstype.get(VersionType.BUNGEECORD_VERSION).contains(in)) {
                    List<ConnectionHandler> l = this.connectionstype.get(VersionType.BUNGEECORD_VERSION);
                    l.remove(in);
                    System.out.println("[BigBrother] Le serveur " + in.getName() + " à été retiré ! (BungeeCord)");
                    this.connectionstype.replace(VersionType.BUNGEECORD_VERSION, l);
                }
                if (this.connectionstype.get(VersionType.SPIGOT_VERSION).contains(in)) {
                    List<ConnectionHandler> l = this.connectionstype.get(VersionType.SPIGOT_VERSION);
                    l.remove(in);
                    System.out.println("[BigBrother] " + in.getName() + " à été retiré ! (Spigot)");
                    this.connectionstype.replace(VersionType.SPIGOT_VERSION, l);
                }
            }
        }
    }
}
Also used : ConnectionHandler(fr.glowstoner.connectionsapi.network.ConnectionHandler)

Aggregations

ConnectionHandler (fr.glowstoner.connectionsapi.network.ConnectionHandler)8 PacketCommand (fr.glowstoner.connectionsapi.network.packets.command.PacketCommand)5 PacketLogin (fr.glowstoner.connectionsapi.network.packets.login.PacketLogin)5 Client (fr.glowstoner.connectionsapi.network.client.Client)4 PacketVersion (fr.glowstoner.fireapi.bigbrother.console.packets.PacketVersion)4 IOException (java.io.IOException)4 PacketExecute (fr.glowstoner.fireapi.bigbrother.console.packets.PacketExecute)3 ClientListener (fr.glowstoner.connectionsapi.network.events.ClientListener)2 Packet (fr.glowstoner.connectionsapi.network.packets.Packet)2 PacketBigBrotherAC (fr.glowstoner.fireapi.bigbrother.ac.packet.PacketBigBrotherAC)2 BigBrotherConnectionCheck (fr.glowstoner.fireapi.bigbrother.console.check.BigBrotherConnectionCheck)2 BigBrotherLoginGetter (fr.glowstoner.fireapi.bigbrother.console.login.BigBrotherLoginGetter)2 PacketPlayerPing (fr.glowstoner.fireapi.bigbrother.console.packets.ping.PacketPlayerPing)2 PacketFriends (fr.glowstoner.fireapi.bungeecord.friends.packets.PacketFriends)2 FriendsActionTransmetterGUI (fr.glowstoner.fireapi.bungeecord.friends.packets.action.FriendsActionTransmetterGUI)2 FireChat (fr.glowstoner.fireapi.chat.FireChat)2 FireRank (fr.glowstoner.fireapi.rank.FireRank)2 AdminToolsCmd (be.goldocelot.admintools.AdminToolsCmd)1 EventsAT (be.goldocelot.admintools.EventsAT)1 PacketPing (fr.glowstoner.connectionsapi.network.packets.PacketPing)1