mirror of
https://github.com/SpigotMC/BungeeCord.git
synced 2024-11-24 11:15:47 +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 int playerLimit = -1;
|
||||||
private Collection<String> disabledCommands;
|
private Collection<String> disabledCommands;
|
||||||
private int throttle = 4000;
|
private int throttle = 4000;
|
||||||
|
private boolean ipFoward;
|
||||||
|
|
||||||
public void load()
|
public void load()
|
||||||
{
|
{
|
||||||
@ -56,6 +57,7 @@ public class Configuration
|
|||||||
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
||||||
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
||||||
throttle = adapter.getInt( "connection_throttle", throttle );
|
throttle = adapter.getInt( "connection_throttle", throttle );
|
||||||
|
ipFoward = adapter.getBoolean( "ip_forward", ipFoward);
|
||||||
|
|
||||||
disabledCommands = new CaseInsensitiveSet( (Collection<String>) adapter.getList( "disabled_commands", Arrays.asList( "find" ) ) );
|
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() );
|
this.vHost = new InetSocketAddress( handshake.getHost(), handshake.getPort() );
|
||||||
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
|
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 ) );
|
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
|
||||||
|
|
||||||
switch ( handshake.getRequestedProtocol() )
|
switch ( handshake.getRequestedProtocol() )
|
||||||
|
Loading…
Reference in New Issue
Block a user