#2762: Work correctly with disabled timeout
This commit is contained in:
parent
3ce4132c58
commit
d3bd785289
@ -125,7 +125,8 @@ public class DownstreamBridge extends PacketHandler
|
|||||||
@Override
|
@Override
|
||||||
public void handle(KeepAlive alive) throws Exception
|
public void handle(KeepAlive alive) throws Exception
|
||||||
{
|
{
|
||||||
if ( server.getKeepAlives().size() < bungee.getConfig().getTimeout() / 50 ) // Allow a theoretical maximum of 1 keepalive per tick
|
int timeout = bungee.getConfig().getTimeout();
|
||||||
|
if ( timeout <= 0 || server.getKeepAlives().size() < timeout / 50 ) // Some people disable timeout, otherwise allow a theoretical maximum of 1 keepalive per tick
|
||||||
{
|
{
|
||||||
server.getKeepAlives().add( new KeepAliveData( alive.getRandomId(), System.currentTimeMillis() ) );
|
server.getKeepAlives().add( new KeepAliveData( alive.getRandomId(), System.currentTimeMillis() ) );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user