Allow setting whether to bind to the local address.
This commit is contained in:
@@ -232,7 +232,7 @@ public final class UserConnection implements ProxiedPlayer
|
||||
.option( ChannelOption.CONNECT_TIMEOUT_MILLIS, 5000 ) // TODO: Configurable
|
||||
.remoteAddress( target.getAddress() );
|
||||
// Windows is bugged, multi homed users will just have to live with random connecting IPs
|
||||
if ( !PlatformDependent.isWindows() )
|
||||
if ( getPendingConnection().getListener().isSetLocalAddress() && !PlatformDependent.isWindows() )
|
||||
{
|
||||
b.localAddress( getPendingConnection().getListener().getHost().getHostString(), 0 );
|
||||
}
|
||||
|
@@ -212,8 +212,9 @@ public class YamlConfig implements ConfigurationAdapter
|
||||
{
|
||||
value = DefaultTabList.GLOBAL_PING;
|
||||
}
|
||||
boolean setLocalAddress = get( "bind_local_address", true, val );
|
||||
|
||||
ListenerInfo info = new ListenerInfo( address, motd, maxPlayers, tabListSize, defaultServer, fallbackServer, forceDefault, forced, value.clazz );
|
||||
ListenerInfo info = new ListenerInfo( address, motd, maxPlayers, tabListSize, defaultServer, fallbackServer, forceDefault, forced, value.clazz, setLocalAddress );
|
||||
ret.add( info );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user