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
|
} else
|
||||||
{
|
{
|
||||||
|
user.getServer().setObsolete( true );
|
||||||
user.getTabListHandler().onServerChange();
|
user.getTabListHandler().onServerChange();
|
||||||
|
|
||||||
Scoreboard serverScoreboard = user.getServerSentScoreboard();
|
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() ) );
|
user.unsafe().sendPacket( new Respawn( login.getDimension(), login.getDifficulty(), login.getGameMode(), login.getLevelType() ) );
|
||||||
|
|
||||||
// Remove from old servers
|
// Remove from old servers
|
||||||
user.getServer().setObsolete( true );
|
|
||||||
user.getServer().disconnect( "Quitting" );
|
user.getServer().disconnect( "Quitting" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,14 +90,17 @@ public class DownstreamBridge extends PacketHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(PacketWrapper packet) throws Exception
|
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
||||||
{
|
{
|
||||||
if ( !server.isObsolete() )
|
return !server.isObsolete();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handle(PacketWrapper packet) throws Exception
|
||||||
{
|
{
|
||||||
con.getEntityRewrite().rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId() );
|
con.getEntityRewrite().rewriteClientbound( packet.buf, con.getServerEntityId(), con.getClientEntityId() );
|
||||||
con.sendPacket( packet );
|
con.sendPacket( packet );
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handle(KeepAlive alive) throws Exception
|
public void handle(KeepAlive alive) throws Exception
|
||||||
|
@ -66,10 +66,10 @@ public class HandlerBoss extends ChannelInboundHandlerAdapter
|
|||||||
if ( handler != null )
|
if ( handler != null )
|
||||||
{
|
{
|
||||||
PacketWrapper packet = (PacketWrapper) msg;
|
PacketWrapper packet = (PacketWrapper) msg;
|
||||||
boolean sendPacket = true;
|
boolean sendPacket = handler.shouldHandle( packet );
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if ( packet.packet != null )
|
if ( sendPacket && packet.packet != null )
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -8,6 +8,11 @@ public abstract class PacketHandler extends net.md_5.bungee.protocol.AbstractPac
|
|||||||
@Override
|
@Override
|
||||||
public abstract String toString();
|
public abstract String toString();
|
||||||
|
|
||||||
|
public boolean shouldHandle(PacketWrapper packet) throws Exception
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public void exception(Throwable t) throws Exception
|
public void exception(Throwable t) throws Exception
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user