Addition of FailedDecryptionLogged configuration.

This commit is contained in:
MobiusDevelopment
2023-03-16 01:23:28 +02:00
parent aa0f378c60
commit eb883e13bb
216 changed files with 1208 additions and 62 deletions
+4
View File
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -776,6 +776,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1370,6 +1371,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -463,6 +463,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -787,6 +787,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1382,6 +1383,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -471,6 +471,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
+4
View File
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -788,6 +788,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1395,6 +1396,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -471,6 +471,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -775,6 +775,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1382,6 +1383,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -471,6 +471,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
+4
View File
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -774,6 +774,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1381,6 +1382,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -475,6 +475,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -774,6 +774,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1388,6 +1389,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -475,6 +475,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
+4
View File
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -775,6 +775,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1409,6 +1410,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -477,6 +477,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -781,6 +781,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1417,6 +1418,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @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().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -772,6 +772,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1408,6 +1409,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -487,6 +487,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -772,6 +772,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1410,6 +1411,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -491,6 +491,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -772,6 +772,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1411,6 +1412,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @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().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -776,6 +776,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1435,6 +1436,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -499,6 +499,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
@@ -70,6 +70,10 @@ TcpNoDelay = True
# Default 800 # Default 800
ConnectionTimeout = 800 ConnectionTimeout = 800
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -1046,6 +1046,7 @@ public class Config
public static boolean PACKET_FLOOD_LOGGED; public static boolean PACKET_FLOOD_LOGGED;
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean FAILED_DECRYPTION_LOGGED;
public static int REQUEST_ID; public static int REQUEST_ID;
public static boolean ACCEPT_ALTERNATE_ID; public static boolean ACCEPT_ALTERNATE_ID;
public static File DATAPACK_ROOT; public static File DATAPACK_ROOT;
@@ -1129,6 +1130,7 @@ public class Config
PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true);
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/"); DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/");
DATABASE_LOGIN = serverConfig.getString("Login", "root"); DATABASE_LOGIN = serverConfig.getString("Login", "root");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = false;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -465,6 +465,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
+4
View File
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -1094,6 +1094,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static int REQUEST_ID; public static int REQUEST_ID;
public static boolean ACCEPT_ALTERNATE_ID; public static boolean ACCEPT_ALTERNATE_ID;
public static File DATAPACK_ROOT; public static File DATAPACK_ROOT;
@@ -1171,6 +1172,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/"); DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/");
DATABASE_LOGIN = serverConfig.getString("Login", "root"); DATABASE_LOGIN = serverConfig.getString("Login", "root");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }
@@ -182,6 +182,14 @@ public class NetClient
return _channel; return _channel;
} }
/**
* @return the network configurations of this client.
*/
public NetConfig getNetConfig()
{
return _netConfig;
}
/** /**
* @return the IP address of this client. * @return the IP address of this client.
*/ */
@@ -13,6 +13,7 @@ public class NetConfig
private boolean _packetFloodDisconnect = false; private boolean _packetFloodDisconnect = false;
private boolean _packetFloodDrop = false; private boolean _packetFloodDrop = false;
private boolean _packetFloodLogged = true; private boolean _packetFloodLogged = true;
private boolean _failedDecryptionLogged = true;
private boolean _tcpNoDelay = true; private boolean _tcpNoDelay = true;
/** /**
@@ -134,6 +135,23 @@ public class NetConfig
_packetFloodLogged = packetFloodLogged; _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. * @return if TCP_NODELAY (Nagle's Algorithm) is used.
*/ */
@@ -479,6 +479,7 @@ public class GameServer
server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED);
server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY);
server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT); server.getNetConfig().setConnectionTimeout(Config.CONNECTION_TIMEOUT);
server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED);
server.start(); server.start();
LoginServerThread.getInstance().start(); LoginServerThread.getInstance().start();
@@ -139,6 +139,7 @@ public class LoginServer
server.getNetConfig().setExecutePoolSize(2000); server.getNetConfig().setExecutePoolSize(2000);
server.getNetConfig().setPacketQueueLimit(10); server.getNetConfig().setPacketQueueLimit(10);
server.getNetConfig().setPacketFloodDisconnect(true); server.getNetConfig().setPacketFloodDisconnect(true);
server.getNetConfig().setFailedDecryptionLogged(false);
server.start(); server.start();
} }
+4
View File
@@ -74,6 +74,10 @@ ConnectionTimeout = 800
# Retail: True # Retail: True
PacketEncryption = False PacketEncryption = False
# Log message when packet decryption has failed.
# Default: True
FailedDecryptionLogged = True
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------
# Database # Database
@@ -869,6 +869,7 @@ public class Config
public static boolean TCP_NO_DELAY; public static boolean TCP_NO_DELAY;
public static int CONNECTION_TIMEOUT; public static int CONNECTION_TIMEOUT;
public static boolean PACKET_ENCRYPTION; public static boolean PACKET_ENCRYPTION;
public static boolean FAILED_DECRYPTION_LOGGED;
public static String DATABASE_DRIVER; public static String DATABASE_DRIVER;
public static String DATABASE_URL; public static String DATABASE_URL;
public static String DATABASE_LOGIN; public static String DATABASE_LOGIN;
@@ -1338,6 +1339,7 @@ public class Config
TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true);
CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800); CONNECTION_TIMEOUT = serverConfig.getInt("ConnectionTimeout", 800);
PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false);
FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true);
REQUEST_ID = serverConfig.getInt("RequestServerID", 0); REQUEST_ID = serverConfig.getInt("RequestServerID", 0);
ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true); ACCEPT_ALTERNATE_ID = serverConfig.getBoolean("AcceptAlternateID", true);
DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver");
@@ -57,9 +57,12 @@ public class ExecuteThread<E extends NetClient> implements Runnable
client.getEncryption().decrypt(data, 0, data.length); client.getEncryption().decrypt(data, 0, data.length);
} }
catch (Exception e) catch (Exception e)
{
if (client.getNetConfig().isFailedDecryptionLogged())
{ {
LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption."); LOGGER.warning("ExecuteThread: Problem with " + client + " data decryption.");
LOGGER.warning(CommonUtil.getStackTrace(e)); LOGGER.warning(CommonUtil.getStackTrace(e));
}
client.disconnect(); client.disconnect();
continue ITERATE; continue ITERATE;
} }

Some files were not shown because too many files have changed in this diff Show More