#2494: Add an option to disable pings in log
This commit is contained in:
		| @@ -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; | ||||
| @@ -82,6 +83,7 @@ public class Configuration implements ProxyConfig | ||||
|         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 ); | ||||
|   | ||||
| @@ -293,7 +293,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection | ||||
|         } | ||||
|  | ||||
|         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 ) ); | ||||
|  | ||||
| @@ -306,6 +309,10 @@ public class InitialHandler extends PacketHandler implements PendingConnection | ||||
|                 break; | ||||
|             case 2: | ||||
|                 // Login | ||||
|                 if ( !bungee.getConfig().isLogPings() ) | ||||
|                 { | ||||
|                     bungee.getLogger().log( Level.INFO, "{0} has connected", this ); | ||||
|                 } | ||||
|                 thisState = State.USERNAME; | ||||
|                 ch.setProtocol( Protocol.LOGIN ); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 NayXegp
					NayXegp