Addition of FailedDecryptionLogged configuration.
This commit is contained in:
@@ -781,6 +781,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;
|
||||
@@ -1417,6 +1418,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.
|
||||
*/
|
||||
|
@@ -483,6 +483,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