#2494: Add an option to disable pings in log
This commit is contained in:
parent
16b3490576
commit
ba0739798a
@ -51,6 +51,7 @@ public class Configuration implements ProxyConfig
|
|||||||
* Whether we log proxy commands to the proxy log
|
* Whether we log proxy commands to the proxy log
|
||||||
*/
|
*/
|
||||||
private boolean logCommands;
|
private boolean logCommands;
|
||||||
|
private boolean logPings = true;
|
||||||
private int playerLimit = -1;
|
private int playerLimit = -1;
|
||||||
private Collection<String> disabledCommands;
|
private Collection<String> disabledCommands;
|
||||||
private int throttle = 4000;
|
private int throttle = 4000;
|
||||||
@ -82,6 +83,7 @@ public class Configuration implements ProxyConfig
|
|||||||
uuid = adapter.getString( "stats", uuid );
|
uuid = adapter.getString( "stats", uuid );
|
||||||
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
|
||||||
logCommands = adapter.getBoolean( "log_commands", logCommands );
|
logCommands = adapter.getBoolean( "log_commands", logCommands );
|
||||||
|
logPings = adapter.getBoolean( "log_pings", logPings );
|
||||||
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
playerLimit = adapter.getInt( "player_limit", playerLimit );
|
||||||
throttle = adapter.getInt( "connection_throttle", throttle );
|
throttle = adapter.getInt( "connection_throttle", throttle );
|
||||||
ipForward = adapter.getBoolean( "ip_forward", ipForward );
|
ipForward = adapter.getBoolean( "ip_forward", ipForward );
|
||||||
|
@ -293,7 +293,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() );
|
this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() );
|
||||||
|
if ( bungee.getConfig().isLogPings() )
|
||||||
|
{
|
||||||
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
|
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
|
||||||
|
}
|
||||||
|
|
||||||
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
|
bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );
|
||||||
|
|
||||||
@ -306,6 +309,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection
|
|||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
// Login
|
// Login
|
||||||
|
if ( !bungee.getConfig().isLogPings() )
|
||||||
|
{
|
||||||
|
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
|
||||||
|
}
|
||||||
thisState = State.USERNAME;
|
thisState = State.USERNAME;
|
||||||
ch.setProtocol( Protocol.LOGIN );
|
ch.setProtocol( Protocol.LOGIN );
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user