Skip to content
This repository has been archived by the owner on Jul 15, 2022. It is now read-only.

Commit

Permalink
SpigotMC#2494: Add an option to disable pings in log
Browse files Browse the repository at this point in the history
  • Loading branch information
NayXegp authored and md-5 committed Aug 28, 2018
1 parent 16b3490 commit ba07397
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions proxy/src/main/java/net/md_5/bungee/conf/Configuration.java
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public class Configuration implements ProxyConfig
* Whether we log proxy commands to the proxy log
*/
private boolean logCommands;
private boolean logPings = true;
private int playerLimit = -1;
private Collection<String> disabledCommands;
private int throttle = 4000;
Expand Down Expand Up @@ -82,6 +83,7 @@ public void load()
uuid = adapter.getString( "stats", uuid );
onlineMode = adapter.getBoolean( "online_mode", onlineMode );
logCommands = adapter.getBoolean( "log_commands", logCommands );
logPings = adapter.getBoolean( "log_pings", logPings );
playerLimit = adapter.getInt( "player_limit", playerLimit );
throttle = adapter.getInt( "connection_throttle", throttle );
ipForward = adapter.getBoolean( "ip_forward", ipForward );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,10 @@ public void handle(Handshake handshake) throws Exception
}

this.virtualHost = InetSocketAddress.createUnresolved( handshake.getHost(), handshake.getPort() );
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
if ( bungee.getConfig().isLogPings() )
{
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
}

bungee.getPluginManager().callEvent( new PlayerHandshakeEvent( InitialHandler.this, handshake ) );

Expand All @@ -306,6 +309,10 @@ public void handle(Handshake handshake) throws Exception
break;
case 2:
// Login
if ( !bungee.getConfig().isLogPings() )
{
bungee.getLogger().log( Level.INFO, "{0} has connected", this );
}
thisState = State.USERNAME;
ch.setProtocol( Protocol.LOGIN );

Expand Down

0 comments on commit ba07397

Please sign in to comment.