use of fr.glowstoner.fireapi.bigbrother.console.check.exceptions.BigBrotherNotConnectedException 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());
}
}
Aggregations