Addition of FailedDecryptionLogged configuration.
This commit is contained in:
		| @@ -74,6 +74,10 @@ ConnectionTimeout = 800 | ||||
| # Retail: True | ||||
| PacketEncryption = False | ||||
|  | ||||
| # Log message when packet decryption has failed. | ||||
| # Default: True | ||||
| FailedDecryptionLogged = True | ||||
|  | ||||
|  | ||||
| # --------------------------------------------------------------------------- | ||||
| # Database | ||||
|   | ||||
| @@ -772,6 +772,7 @@ public class Config | ||||
| 	public static boolean TCP_NO_DELAY; | ||||
| 	public static int CONNECTION_TIMEOUT; | ||||
| 	public static boolean PACKET_ENCRYPTION; | ||||
| 	public static boolean FAILED_DECRYPTION_LOGGED; | ||||
| 	public static String DATABASE_DRIVER; | ||||
| 	public static String DATABASE_URL; | ||||
| 	public static String DATABASE_LOGIN; | ||||
| @@ -1411,6 +1412,7 @@ public class Config | ||||
| 			TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); | ||||
| 			CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); | ||||
| 			PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); | ||||
| 			FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true); | ||||
| 			REQUEST_ID = serverConfig.getInt("RequestServerID", 0); | ||||
| 			ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); | ||||
| 			DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); | ||||
|   | ||||
| @@ -58,8 +58,11 @@ public class ExecuteThread<E extends NetClient> implements Runnable | ||||
| 						} | ||||
| 						catch (Exception e) | ||||
| 						{ | ||||
| 							LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); | ||||
| 							LOGGER.warning(CommonUtil.getStackTrace(e)); | ||||
| 							if (client.getNetConfig().isFailedDecryptionLogged()) | ||||
| 							{ | ||||
| 								LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); | ||||
| 								LOGGER.warning(CommonUtil.getStackTrace(e)); | ||||
| 							} | ||||
| 							client.disconnect(); | ||||
| 							continue ITERATE; | ||||
| 						} | ||||
|   | ||||
| @@ -182,6 +182,14 @@ public class NetClient | ||||
| 		return _channel; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * @return the network configurations of this client. | ||||
| 	 */ | ||||
| 	public NetConfig getNetConfig() | ||||
| 	{ | ||||
| 		return _netConfig; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * @return the IP address of this client. | ||||
| 	 */ | ||||
|   | ||||
| @@ -13,6 +13,7 @@ public class NetConfig | ||||
| 	private boolean _packetFloodDisconnect = false; | ||||
| 	private boolean _packetFloodDrop = false; | ||||
| 	private boolean _packetFloodLogged = true; | ||||
| 	private boolean _failedDecryptionLogged = true; | ||||
| 	private boolean _tcpNoDelay = true; | ||||
| 	 | ||||
| 	/** | ||||
| @@ -134,6 +135,23 @@ public class NetConfig | ||||
| 		_packetFloodLogged = packetFloodLogged; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * @return if failed decryption is logged. | ||||
| 	 */ | ||||
| 	public boolean isFailedDecryptionLogged() | ||||
| 	{ | ||||
| 		return _failedDecryptionLogged; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * Sets if failed decryption is logged. | ||||
| 	 * @param failedDecryptionLogged | ||||
| 	 */ | ||||
| 	public void setFailedDecryptionLogged(boolean failedDecryptionLogged) | ||||
| 	{ | ||||
| 		_failedDecryptionLogged = failedDecryptionLogged; | ||||
| 	} | ||||
| 	 | ||||
| 	/** | ||||
| 	 * @return if TCP_NODELAY (Nagle's Algorithm) is used. | ||||
| 	 */ | ||||
|   | ||||
| @@ -495,6 +495,7 @@ public class GameServer | ||||
| 		server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); | ||||
| 		server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); | ||||
| 		server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); | ||||
| 		server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); | ||||
| 		server.start(); | ||||
| 		 | ||||
| 		LoginServerThread.getInstance().start(); | ||||
|   | ||||
| @@ -139,6 +139,7 @@ public class LoginServer | ||||
| 		server.getNetConfig().setExecutePoolSize(2000); | ||||
| 		server.getNetConfig().setPacketQueueLimit(10); | ||||
| 		server.getNetConfig().setPacketFloodDisconnect(true); | ||||
| 		server.getNetConfig().setFailedDecryptionLogged(false); | ||||
| 		server.start(); | ||||
| 	} | ||||
| 	 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 MobiusDevelopment
					MobiusDevelopment