mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-27 20:59:12 +01:00
Add new ip forward method, must be manually enabled
This commit is contained in:
parent
4dff25f880
commit
e1f7b7b126
@ -44,6 +44,7 @@ public class Configuration
|
||||
private int playerLimit = -1;
|
||||
private Collection<String> disabledCommands;
|
||||
private int throttle = 4000;
|
||||
private boolean ipFoward;
|
||||
|
||||
public void load()
|
||||
{
|
||||
@ -56,6 +57,7 @@ public class Configuration
|
||||
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
||||
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
||||
throttle = adapter.getInt( "connection_throttle", throttle );
|
||||
ipFoward = adapter.getBoolean( "ip_forward", ipFoward);
|
||||
|
||||
disabledCommands = new CaseInsensitiveSet( (Collection<String>) adapter.getList( "disabled_commands", Arrays.asList( "find" ) ) );
|
||||
|
||||
|
@ -189,6 +189,11 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
||||
this.vHost = new InetSocketAddress( handshake.getHost(), handshake.getPort() );
|
||||
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
|
||||
|
||||
if ( BungeeCord.getInstance().config.isIpFoward() )
|
||||
{
|
||||
handshake.setHost( handshake.getHost() + "\00" + getAddress().getHostString() );
|
||||
}
|
||||
|
||||
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
|
||||
|
||||
switch ( handshake.getRequestedProtocol() )
|
||||
|
Loading…
Reference in New Issue
Block a user