Exemplo n.º 1
0
 @Override
 public void handle(Packet0KeepAlive alive) throws Exception {
   if (alive.getRandomId() == con.getSentPingId()) {
     int newPing = (int) (System.currentTimeMillis() - con.getSentPingTime());
     bungee.getTabListHandler().onPingChange(con, newPing);
     con.setPing(newPing);
   }
 }
Exemplo n.º 2
0
  @Override
  public void disconnected(ChannelWrapper channel) throws Exception {
    // We lost connection to the client
    PlayerDisconnectEvent event = new PlayerDisconnectEvent(con);
    bungee.getPluginManager().callEvent(event);
    bungee.getTabListHandler().onDisconnect(con);
    BungeeCord.getInstance().removeConnection(con);

    if (con.getServer() != null) {
      con.getServer().disconnect("Quitting");
    }
  }
Exemplo n.º 3
0
  public UpstreamBridge(ProxyServer bungee, UserConnection con) {
    this.bungee = bungee;
    this.con = con;

    BungeeCord.getInstance().addConnection(con);
    bungee.getTabListHandler().onConnect(con);
    con.unsafe().sendPacket(BungeeCord.getInstance().registerChannels());

    TexturePackInfo texture = con.getPendingConnection().getListener().getTexturePack();
    if (texture != null) {
      con.setTexturePack(texture);
    }
  }