mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-27 20:59:12 +01:00
Work around windows bugs
This commit is contained in:
parent
ce8f1b44b6
commit
483fede234
@ -8,6 +8,7 @@ import io.netty.channel.ChannelFutureListener;
|
||||
import io.netty.channel.ChannelInitializer;
|
||||
import io.netty.channel.ChannelOption;
|
||||
import io.netty.channel.socket.nio.NioSocketChannel;
|
||||
import io.netty.util.internal.PlatformDependent;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@ -207,14 +208,18 @@ public final class UserConnection implements ProxiedPlayer
|
||||
}
|
||||
}
|
||||
};
|
||||
new Bootstrap()
|
||||
Bootstrap b = new Bootstrap()
|
||||
.channel( NioSocketChannel.class )
|
||||
.group( BungeeCord.getInstance().eventLoops )
|
||||
.handler( initializer )
|
||||
.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 )
|
||||
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000 ) // TODO: Configurable
|
||||
.remoteAddress( target.getAddress() )
|
||||
.connect().addListener( listener );
|
||||
.remoteAddress( target.getAddress() );
|
||||
// Windows is bugged, multi homed users will just have to live with random connecting IPs
|
||||
if ( !PlatformDependent.isWindows() )
|
||||
{
|
||||
b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 );
|
||||
}
|
||||
b.connect().addListener( listener );
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user