diff --git a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java index 6b888c851..d93efd874 100644 --- a/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java +++ b/proxy/src/main/java/net/md_5/bungee/connection/UpstreamBridge.java @@ -122,10 +122,11 @@ public class UpstreamBridge extends PacketHandler @Override public void handle(KeepAlive alive) throws Exception { - KeepAliveData keepAliveData = con.getServer().getKeepAlives().poll(); + KeepAliveData keepAliveData = con.getServer().getKeepAlives().peek(); if ( keepAliveData != null && alive.getRandomId() == keepAliveData.getId() ) { + Preconditions.checkState( keepAliveData == con.getServer().getKeepAlives().poll(), "keepalive queue mismatch" ); int newPing = (int) ( System.currentTimeMillis() - keepAliveData.getTime() ); con.getTabListHandler().onPingChange( newPing ); con.setPing( newPing );