mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-30 14:13:47 +01:00
Fix #671 - user timing out when connectNow is used.
This commit is contained in:
parent
a0d3bf97d1
commit
26863032a1
@ -177,6 +177,7 @@ public class ServerConnector extends PacketHandler
|
||||
// TODO: Move this to the connected() method of DownstreamBridge
|
||||
target.addPlayer( user );
|
||||
user.getPendingConnects().remove( target );
|
||||
user.setDimensionChange( false );
|
||||
|
||||
user.setServer( server );
|
||||
ch.getHandle().pipeline().get( HandlerBoss.class ).setHandler( new DownstreamBridge( bungee, user, server ) );
|
||||
@ -211,7 +212,7 @@ public class ServerConnector extends PacketHandler
|
||||
}
|
||||
|
||||
String message = bungee.getTranslation( "connect_kick" ) + target.getName() + ": " + event.getKickReason();
|
||||
if ( user.getServer() == null )
|
||||
if ( user.isDimensionChange() )
|
||||
{
|
||||
user.disconnect( message );
|
||||
} else
|
||||
|
@ -60,6 +60,9 @@ public final class UserConnection implements ProxiedPlayer
|
||||
@Setter
|
||||
private ServerConnection server;
|
||||
@Getter
|
||||
@Setter
|
||||
private boolean dimensionChange = true;
|
||||
@Getter
|
||||
private final Object switchMutex = new Object();
|
||||
@Getter
|
||||
private final Collection<ServerInfo> pendingConnects = new HashSet<>();
|
||||
@ -161,6 +164,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
|
||||
void sendDimensionSwitch()
|
||||
{
|
||||
dimensionChange = true;
|
||||
unsafe().sendPacket( PacketConstants.DIM1_SWITCH );
|
||||
unsafe().sendPacket( PacketConstants.DIM2_SWITCH );
|
||||
}
|
||||
@ -224,7 +228,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
connect( def, false );
|
||||
} else
|
||||
{
|
||||
if ( server == null )
|
||||
if ( dimensionChange )
|
||||
{
|
||||
disconnect( bungee.getTranslation( "fallback_kick" ) + future.cause().getClass().getName() );
|
||||
} else
|
||||
|
Loading…
Reference in New Issue
Block a user