Fix scoreboards / tab lists getting out of sync due to race conditions / overlap.
This commit is contained in:
parent
afc02082e6
commit
0646a3090a
@ -207,6 +207,7 @@ public class ServerConnector extends PacketHandler
|
||||
}
|
||||
} else
|
||||
{
|
||||
user.getServer().setObsolete( true );
|
||||
user.getTabListHandler().onServerChange();
|
||||
|
||||
Scoreboard serverScoreboard = user.getServerSentScoreboard();
|
||||
@ -226,7 +227,6 @@ public class ServerConnector extends PacketHandler
|
||||
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getDifficulty(), login.getGameMode(), login.getLevelType() ) );
|
||||
|
||||
// Remove from old servers
|
||||
user.getServer().setObsolete( true );
|
||||
user.getServer().disconnect( "Quitting" );
|
||||
}
|
||||
|
||||
|
@ -89,14 +89,17 @@ public class DownstreamBridge extends PacketHandler
|
||||
bungee.getPluginManager().callEvent( serverDisconnectEvent );
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
||||
{
|
||||
return !server.isObsolete();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(PacketWrapper packet) throws Exception
|
||||
{
|
||||
if ( !server.isObsolete() )
|
||||
{
|
||||
con.getEntityRewrite().rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId() );
|
||||
con.sendPacket( packet );
|
||||
}
|
||||
con.getEntityRewrite().rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId() );
|
||||
con.sendPacket( packet );
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -451,7 +454,7 @@ public class DownstreamBridge extends PacketHandler
|
||||
con.getServer().sendData( "BungeeCord", b );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
throw CancelSendSignal.INSTANCE;
|
||||
}
|
||||
}
|
||||
|
@ -66,10 +66,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
||||
if ( handler != null )
|
||||
{
|
||||
PacketWrapper packet = (PacketWrapper) msg;
|
||||
boolean sendPacket = true;
|
||||
boolean sendPacket = handler.shouldHandle( packet );
|
||||
try
|
||||
{
|
||||
if ( packet.packet != null )
|
||||
if ( sendPacket && packet.packet != null )
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -8,6 +8,11 @@ public abstract class PacketHandler extends net.md_5.bungee.protocol.AbstractPac
|
||||
@Override
|
||||
public abstract String toString();
|
||||
|
||||
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public void exception(Throwable t) throws Exception
|
||||
{
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user