From 5f31c3055ca97c07404f12f48d8b4a68cd6384d6 Mon Sep 17 00:00:00 2001 From: MobiusDevelopment Date: Mon, 3 Jul 2023 00:58:15 +0300 Subject: [PATCH] Addition of network configuration file. --- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 37 +++++--- .../dist/game/config/Network.ini | 46 ++++++++++ .../java/org/l2jmobius/Config.java | 82 +++++++++-------- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 88 ++++++++++--------- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 55 ++++++------ .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 57 ++++++------ .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 57 ++++++------ .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 47 +++++----- .../dist/game/config/Network.ini | 53 +++++++++++ .../dist/game/config/Server.ini | 48 ---------- .../java/org/l2jmobius/Config.java | 37 +++++--- 92 files changed, 2515 insertions(+), 2102 deletions(-) create mode 100644 L2J_Mobius_01.0_Ertheia/dist/game/config/Network.ini create mode 100644 L2J_Mobius_02.5_Underground/dist/game/config/Network.ini create mode 100644 L2J_Mobius_03.0_Helios/dist/game/config/Network.ini create mode 100644 L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini create mode 100644 L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini create mode 100644 L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini create mode 100644 L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini create mode 100644 L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini create mode 100644 L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini create mode 100644 L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini create mode 100644 L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini create mode 100644 L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini create mode 100644 L2J_Mobius_C6_Interlude/dist/game/config/Network.ini create mode 100644 L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini create mode 100644 L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Network.ini create mode 100644 L2J_Mobius_CT_2.6_HighFive/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_1.0/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Network.ini create mode 100644 L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Network.ini diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/config/Network.ini b/L2J_Mobius_01.0_Ertheia/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_01.0_Ertheia/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_01.0_Ertheia/dist/game/config/Server.ini b/L2J_Mobius_01.0_Ertheia/dist/game/config/Server.ini index 0d01ab8854..6b51d4a1cf 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/config/Server.ini +++ b/L2J_Mobius_01.0_Ertheia/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java index 4b2e5c2271..8f8a257d8f 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -767,16 +768,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -817,6 +808,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1362,16 +1367,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1473,6 +1468,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini b/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_02.5_Underground/dist/game/config/Server.ini b/L2J_Mobius_02.5_Underground/dist/game/config/Server.ini index 0a553fcfe1..588098b5b0 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/config/Server.ini +++ b/L2J_Mobius_02.5_Underground/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java index 1166dfa9f5..7781340c53 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -778,16 +779,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -828,6 +819,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1374,16 +1379,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1485,6 +1480,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini b/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_03.0_Helios/dist/game/config/Server.ini b/L2J_Mobius_03.0_Helios/dist/game/config/Server.ini index 37eecbe9c1..22eb7ec83d 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/config/Server.ini +++ b/L2J_Mobius_03.0_Helios/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java index c00e6cfa5b..351c8fba0c 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -779,16 +780,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -829,6 +820,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1387,16 +1392,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1498,6 +1493,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Server.ini b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Server.ini index 5a290ea9e0..9b67e641f1 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Server.ini +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java index 54e8552543..fa0cdbf705 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -766,16 +767,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -816,6 +807,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1374,16 +1379,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1485,6 +1480,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini b/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_05.0_Salvation/dist/game/config/Server.ini b/L2J_Mobius_05.0_Salvation/dist/game/config/Server.ini index 351db77ee2..4ff9e457b5 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/config/Server.ini +++ b/L2J_Mobius_05.0_Salvation/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java index 5372d44720..ab3d7bf714 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -765,16 +766,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -815,6 +806,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1373,16 +1378,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1484,6 +1479,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Server.ini b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Server.ini index be8f69bbbd..ff26a89f1d 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Server.ini +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java index 525e02c75b..c16fd7e8d8 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -765,16 +766,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -815,6 +806,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1380,16 +1385,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1491,6 +1486,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini b/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/config/Server.ini b/L2J_Mobius_06.0_Fafurion/dist/game/config/Server.ini index ea7a706047..13055df456 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/config/Server.ini +++ b/L2J_Mobius_06.0_Fafurion/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java index 06b4f4a63d..2afc519bf5 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -766,16 +767,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -816,6 +807,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1401,16 +1406,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1512,6 +1507,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Server.ini b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Server.ini index a7defe752a..818e4cb246 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Server.ini +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java index f2a4402cea..a8d7721d0e 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -772,16 +773,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -822,6 +813,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1409,16 +1414,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1520,6 +1515,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini b/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/config/Server.ini b/L2J_Mobius_08.2_Homunculus/dist/game/config/Server.ini index d4fef02bec..fbf65aa0d3 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/config/Server.ini +++ b/L2J_Mobius_08.2_Homunculus/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java index d762e22de4..6f5654be2f 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -763,16 +764,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -813,6 +804,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1400,16 +1405,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1511,6 +1506,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Server.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Server.ini index 5b6f5b59a8..921ed2c12f 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Server.ini +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java index c8f903fdd7..405b40d578 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -763,16 +764,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -813,6 +804,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1402,16 +1407,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1513,6 +1508,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini b/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/config/Server.ini b/L2J_Mobius_10.2_MasterClass/dist/game/config/Server.ini index d6ba95f7fa..7ec5a6009f 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/config/Server.ini +++ b/L2J_Mobius_10.2_MasterClass/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java index acbdf6d325..4e949724d9 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -763,16 +764,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -813,6 +804,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1403,16 +1408,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1514,6 +1509,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini b/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/config/Server.ini b/L2J_Mobius_10.3_MasterClass/dist/game/config/Server.ini index 52c74fc448..3fd4ec544b 100644 --- a/L2J_Mobius_10.3_MasterClass/dist/game/config/Server.ini +++ b/L2J_Mobius_10.3_MasterClass/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/Config.java b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/Config.java index f180ce26f8..bd1e1c024e 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -767,16 +768,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -817,6 +808,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Hardin (Agent of Chaos) // -------------------------------------------------- @@ -1538,6 +1543,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini new file mode 100644 index 0000000000..d2d9a6b335 --- /dev/null +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini @@ -0,0 +1,46 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java index 17a31584b6..d19fd89b0a 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java @@ -54,52 +54,51 @@ public class Config // -------------------------------------------------- // Files // -------------------------------------------------- - - // standard - private static final String FILTER_FILE = "./config/chatfilter.txt"; - private static final String HEXID_FILE = "./config/hexid.txt"; - // interface + public static final String CLASS_DAMAGE_CONFIG_FILE = "./config/custom/ClassDamage.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; - // main + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; + private static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; + + public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; + public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; + private static final String ACCESS_CONFIG_FILE = "./config/Access.ini"; private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini"; private static final String CLANHALL_CONFIG_FILE = "./config/Clanhall.ini"; private static final String CONQUERABLE_CLANHALL_CONFIG_FILE = "./config/ConquerableHallSiege.ini"; private static final String CRAFTING_CONFIG_FILE = "./config/Crafting.ini"; private static final String ENCHANT_CONFIG_FILE = "./config/Enchant.ini"; - public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; private static final String GENERAL_CONFIG_FILE = "./config/General.ini"; private static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; private static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini"; - private static final String OLYMP_CONFIG_FILE = "./config/Olympiad.ini"; - private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/FloodProtector.ini"; + private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; private static final String OTHER_CONFIG_FILE = "./config/Other.ini"; + private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/FloodProtector.ini"; private static final String PVP_CONFIG_FILE = "./config/PvP.ini"; private static final String RATES_CONFIG_FILE = "./config/Rates.ini"; private static final String SERVER_CONFIG_FILE = "./config/Server.ini"; private static final String SEVENSIGNS_CONFIG_FILE = "./config/SevenSigns.ini"; - public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; - // custom + private static final String BANK_CONFIG_FILE = "./config/custom/Bank.ini"; private static final String BOSS_ANNOUNCEMENTS_CONFIG_FILE = "./config/custom/BossAnnouncements.ini"; private static final String CANCEL_SKILL_RESTORE_BUFFS_CONFIG_FILE = "./config/custom/CancelSkillRestoreBuffs.ini"; private static final String CHAMPION_CONFIG_FILE = "./config/custom/Champion.ini"; - public static final String CLASS_DAMAGE_CONFIG_FILE = "./config/custom/ClassDamage.ini"; private static final String CUSTOM_AUTO_POTIONS_CONFIG_FILE = "./config/custom/AutoPotions.ini"; private static final String CUSTOM_CUSTOM_MAIL_MANAGER_CONFIG_FILE = "./config/custom/CustomMailManager.ini"; private static final String CUSTOM_FACTION_SYSTEM_CONFIG_FILE = "./config/custom/FactionSystem.ini"; - private static final String MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE = "./config/custom/MerchantZeroSellPrice.ini"; private static final String CUSTOM_RANDOM_SPAWNS_CONFIG_FILE = "./config/custom/RandomSpawns.ini"; + private static final String EVENT_REBIRTH_CONFIG_FILE = "./config/custom/Rebirth.ini"; + private static final String EVENT_WEDDING_CONFIG_FILE = "./config/custom/Wedding.ini"; + private static final String MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE = "./config/custom/MerchantZeroSellPrice.ini"; private static final String OFFLINE_CONFIG_FILE = "./config/custom/Offline.ini"; private static final String OTHER_CUSTOM_CONFIG_FILE = "./config/custom/Other.ini"; private static final String PC_BANG_POINT_CONFIG_FILE = "./config/custom/PcBang.ini"; private static final String PHYSICS_BALANCE_CONFIG_FILE = "./config/custom/PhysicsBalance.ini"; private static final String SCHEME_BUFFER_CONFIG_FILE = "./config/custom/SchemeBuffer.ini"; private static final String STARTING_LOCATION_CONFIG_FILE = "./config/custom/StartingLocation.ini"; - private static final String EVENT_REBIRTH_CONFIG_FILE = "./config/custom/Rebirth.ini"; - private static final String EVENT_WEDDING_CONFIG_FILE = "./config/custom/Wedding.ini"; - // login - private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; + + private static final String CHAT_FILTER_FILE = "./config/chatfilter.txt"; + private static final String HEXID_FILE = "./config/hexid.txt"; // -------------------------------------------------- // Variable Definitions @@ -1038,15 +1037,6 @@ public class Config public static String GAME_SERVER_LOGIN_HOST; public static String INTERNAL_HOSTNAME; public static String EXTERNAL_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - public static boolean FAILED_DECRYPTION_LOGGED; public static int REQUEST_ID; public static boolean ACCEPT_ALTERNATE_ID; public static File DATAPACK_ROOT; @@ -1078,6 +1068,16 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean FAILED_DECRYPTION_LOGGED; + public static int IP_UPDATE_TIME; public static boolean SHOW_LICENCE; public static boolean FORCE_GGAUTH; @@ -1122,15 +1122,6 @@ public class Config INTERNAL_HOSTNAME = serverConfig.getString("InternalHostname", "127.0.0.1"); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/"); DATABASE_LOGIN = serverConfig.getString("Login", "root"); @@ -1198,6 +1189,20 @@ public class Config PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; } + public static void loadNetworkConfig() + { + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + } + public static void loadRatesConfig() { final PropertiesParser ratesConfig = new PropertiesParser(RATES_CONFIG_FILE); @@ -2000,7 +2005,7 @@ public class Config public static void loadOlympConfig() { - final PropertiesParser olympiadConfig = new PropertiesParser(OLYMP_CONFIG_FILE); + final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE); OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true); ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 18); ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0); @@ -2748,7 +2753,7 @@ public class Config LineNumberReader lnr = null; try { - final File file = new File(FILTER_FILE); + final File file = new File(CHAT_FILTER_FILE); if (!file.exists()) { return; @@ -2769,7 +2774,7 @@ public class Config catch (Exception e) { e.printStackTrace(); - throw new Error("Failed to Load " + FILTER_FILE + " File."); + throw new Error("Failed to Load " + CHAT_FILTER_FILE + " File."); } finally { @@ -2901,6 +2906,7 @@ public class Config // Load network loadServerConfig(); + loadNetworkConfig(); // Head loadRatesConfig(); diff --git a/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini b/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_C6_Interlude/dist/game/config/Server.ini b/L2J_Mobius_C6_Interlude/dist/game/config/Server.ini index 336ce30474..36445306f4 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/config/Server.ini +++ b/L2J_Mobius_C6_Interlude/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java index 1c8442b67a..e2962d7132 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java @@ -68,53 +68,52 @@ public class Config // -------------------------------------------------- // Files // -------------------------------------------------- - - // standard - private static final String FILTER_FILE = "./config/chatfilter.txt"; - private static final String HEXID_FILE = "./config/hexid.txt"; - private static final String IPCONFIG_FILE = "./config/ipconfig.xml"; - // interface + public static final String CLASS_DAMAGE_CONFIG_FILE = "./config/custom/ClassDamage.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; - // main + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; + private static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; + + public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; + public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; + private static final String ACCESS_CONFIG_FILE = "./config/Access.ini"; private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini"; private static final String CLANHALL_CONFIG_FILE = "./config/Clanhall.ini"; private static final String CONQUERABLE_CLANHALL_CONFIG_FILE = "./config/ConquerableHallSiege.ini"; private static final String CRAFTING_CONFIG_FILE = "./config/Crafting.ini"; private static final String ENCHANT_CONFIG_FILE = "./config/Enchant.ini"; - public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; private static final String GENERAL_CONFIG_FILE = "./config/General.ini"; private static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; private static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini"; - private static final String OLYMP_CONFIG_FILE = "./config/Olympiad.ini"; - private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/FloodProtector.ini"; + private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; private static final String OTHER_CONFIG_FILE = "./config/Other.ini"; + private static final String PROTECT_FLOOD_CONFIG_FILE = "./config/FloodProtector.ini"; private static final String PVP_CONFIG_FILE = "./config/PvP.ini"; private static final String RATES_CONFIG_FILE = "./config/Rates.ini"; private static final String SERVER_CONFIG_FILE = "./config/Server.ini"; private static final String SEVENSIGNS_CONFIG_FILE = "./config/SevenSigns.ini"; - public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; - // custom + private static final String BANK_CONFIG_FILE = "./config/custom/Bank.ini"; private static final String BOSS_ANNOUNCEMENTS_CONFIG_FILE = "./config/custom/BossAnnouncements.ini"; private static final String CANCEL_SKILL_RESTORE_BUFFS_CONFIG_FILE = "./config/custom/CancelSkillRestoreBuffs.ini"; private static final String CHAMPION_CONFIG_FILE = "./config/custom/Champion.ini"; - public static final String CLASS_DAMAGE_CONFIG_FILE = "./config/custom/ClassDamage.ini"; private static final String CUSTOM_AUTO_POTIONS_CONFIG_FILE = "./config/custom/AutoPotions.ini"; private static final String CUSTOM_CUSTOM_MAIL_MANAGER_CONFIG_FILE = "./config/custom/CustomMailManager.ini"; private static final String CUSTOM_FACTION_SYSTEM_CONFIG_FILE = "./config/custom/FactionSystem.ini"; - private static final String MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE = "./config/custom/MerchantZeroSellPrice.ini"; private static final String CUSTOM_RANDOM_SPAWNS_CONFIG_FILE = "./config/custom/RandomSpawns.ini"; + private static final String EVENT_REBIRTH_CONFIG_FILE = "./config/custom/Rebirth.ini"; + private static final String EVENT_WEDDING_CONFIG_FILE = "./config/custom/Wedding.ini"; + private static final String MERCHANT_ZERO_SELL_PRICE_CONFIG_FILE = "./config/custom/MerchantZeroSellPrice.ini"; private static final String OFFLINE_CONFIG_FILE = "./config/custom/Offline.ini"; private static final String OTHER_CUSTOM_CONFIG_FILE = "./config/custom/Other.ini"; private static final String PC_BANG_POINT_CONFIG_FILE = "./config/custom/PcBang.ini"; private static final String PHYSICS_BALANCE_CONFIG_FILE = "./config/custom/PhysicsBalance.ini"; private static final String SCHEME_BUFFER_CONFIG_FILE = "./config/custom/SchemeBuffer.ini"; private static final String STARTING_LOCATION_CONFIG_FILE = "./config/custom/StartingLocation.ini"; - private static final String EVENT_REBIRTH_CONFIG_FILE = "./config/custom/Rebirth.ini"; - private static final String EVENT_WEDDING_CONFIG_FILE = "./config/custom/Wedding.ini"; - // login - private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; + + private static final String CHAT_FILTER_FILE = "./config/chatfilter.txt"; + private static final String HEXID_FILE = "./config/hexid.txt"; + private static final String IPCONFIG_FILE = "./config/ipconfig.xml"; // -------------------------------------------------- // Variable Definitions @@ -1085,16 +1084,6 @@ public class Config public static String GAME_SERVER_LOGIN_HOST; public static List GAME_SERVER_SUBNETS; public static List GAME_SERVER_HOSTS; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - public static boolean PACKET_ENCRYPTION; - public static boolean FAILED_DECRYPTION_LOGGED; public static int REQUEST_ID; public static boolean ACCEPT_ALTERNATE_ID; public static File DATAPACK_ROOT; @@ -1126,6 +1115,17 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + public static boolean SHOW_LICENCE; public static boolean FLOOD_PROTECTION; public static int FAST_CONNECTION_LIMIT; @@ -1163,16 +1163,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - PACKET_ENCRYPTION = serverConfig.getBoolean("PacketEncryption", false); - FAILED_DECRYPTION_LOGGED = serverConfig.getBoolean("FailedDecryptionLogged", true); DATABASE_DRIVER = serverConfig.getString("Driver", "org.mariadb.jdbc.Driver"); DATABASE_URL = serverConfig.getString("URL", "jdbc:mariadb://localhost/"); DATABASE_LOGIN = serverConfig.getString("Login", "root"); @@ -1240,6 +1230,21 @@ public class Config PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; } + public static void loadNetworkConfig() + { + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + } + public static void loadRatesConfig() { final PropertiesParser ratesConfig = new PropertiesParser(RATES_CONFIG_FILE); @@ -2060,7 +2065,7 @@ public class Config public static void loadOlympConfig() { - final PropertiesParser olympiadConfig = new PropertiesParser(OLYMP_CONFIG_FILE); + final PropertiesParser olympiadConfig = new PropertiesParser(OLYMPIAD_CONFIG_FILE); OLYMPIAD_ENABLED = olympiadConfig.getBoolean("OlympiadEnabled", true); ALT_OLY_START_TIME = olympiadConfig.getInt("AltOlyStartTime", 18); ALT_OLY_MIN = olympiadConfig.getInt("AltOlyMin", 0); @@ -2822,7 +2827,7 @@ public class Config LineNumberReader lnr = null; try { - final File file = new File(FILTER_FILE); + final File file = new File(CHAT_FILTER_FILE); if (!file.exists()) { return; @@ -2843,7 +2848,7 @@ public class Config catch (Exception e) { e.printStackTrace(); - throw new Error("Failed to Load " + FILTER_FILE + " File."); + throw new Error("Failed to Load " + CHAT_FILTER_FILE + " File."); } finally { @@ -2989,6 +2994,7 @@ public class Config // Load network loadServerConfig(); + loadNetworkConfig(); // Head loadRatesConfig(); diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini b/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/config/Server.ini b/L2J_Mobius_CT_0_Interlude/dist/game/config/Server.ini index 40c62563c2..30f8451bc3 100644 --- a/L2J_Mobius_CT_0_Interlude/dist/game/config/Server.ini +++ b/L2J_Mobius_CT_0_Interlude/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java index b67f60f3c4..ebe454d692 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java @@ -86,21 +86,25 @@ public class Config // -------------------------------------------------- // Config File Definitions // -------------------------------------------------- - public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; + public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; + private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini"; private static final String CH_SIEGE_CONFIG_FILE = "./config/ConquerableHallSiege.ini"; private static final String FEATURE_CONFIG_FILE = "./config/Feature.ini"; private static final String FLOOD_PROTECTOR_CONFIG_FILE = "./config/FloodProtector.ini"; private static final String GENERAL_CONFIG_FILE = "./config/General.ini"; + private static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; private static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini"; private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; private static final String NPC_CONFIG_FILE = "./config/NPC.ini"; private static final String PVP_CONFIG_FILE = "./config/PVP.ini"; private static final String RATES_CONFIG_FILE = "./config/Rates.ini"; private static final String SERVER_CONFIG_FILE = "./config/Server.ini"; + private static final String CHAT_FILTER_FILE = "./config/chatfilter.txt"; private static final String HEXID_FILE = "./config/hexid.txt"; private static final String IPCONFIG_FILE = "./config/ipconfig.xml"; @@ -861,16 +865,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -912,13 +906,18 @@ public class Config public static int PRECAUTIONARY_RESTART_DELAY; // -------------------------------------------------- - // MMO Settings + // Network Settings // -------------------------------------------------- - public static int MMO_SELECTOR_SLEEP_TIME; - public static int MMO_MAX_SEND_PER_PASS; - public static int MMO_MAX_READ_PER_PASS; - public static int MMO_HELPER_BUFFER_COUNT; - public static boolean MMO_TCP_NODELAY; + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; // -------------------------------------------------- // Vitality Settings @@ -1332,16 +1331,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1443,6 +1432,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Network.ini b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Server.ini b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Server.ini index 349db9ce14..307ca45c67 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Server.ini +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java index 3784ec5b52..6641f2189f 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/Config.java @@ -86,17 +86,20 @@ public class Config // -------------------------------------------------- // Config File Definitions // -------------------------------------------------- - public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; - public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; + public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; + public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String TW_CONFIG_FILE = "./config/TerritoryWar.ini"; + private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini"; private static final String CH_SIEGE_CONFIG_FILE = "./config/ConquerableHallSiege.ini"; private static final String FEATURE_CONFIG_FILE = "./config/Feature.ini"; private static final String FLOOD_PROTECTOR_CONFIG_FILE = "./config/FloodProtector.ini"; private static final String GENERAL_CONFIG_FILE = "./config/General.ini"; + private static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; private static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.ini"; private static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini"; private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; @@ -104,6 +107,7 @@ public class Config private static final String PVP_CONFIG_FILE = "./config/PVP.ini"; private static final String RATES_CONFIG_FILE = "./config/Rates.ini"; private static final String SERVER_CONFIG_FILE = "./config/Server.ini"; + private static final String CHAT_FILTER_FILE = "./config/chatfilter.txt"; private static final String HEXID_FILE = "./config/hexid.txt"; private static final String IPCONFIG_FILE = "./config/ipconfig.xml"; @@ -886,16 +890,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -937,13 +931,18 @@ public class Config public static int PRECAUTIONARY_RESTART_DELAY; // -------------------------------------------------- - // MMO Settings + // Network Settings // -------------------------------------------------- - public static int MMO_SELECTOR_SLEEP_TIME; - public static int MMO_MAX_SEND_PER_PASS; - public static int MMO_MAX_READ_PER_PASS; - public static int MMO_HELPER_BUFFER_COUNT; - public static boolean MMO_TCP_NODELAY; + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; // -------------------------------------------------- // Vitality Settings @@ -1385,16 +1384,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1496,6 +1485,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Network.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini index f5eb9c3ca0..e46a7cbe2a 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java index 152965f423..696e177c37 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/Config.java @@ -86,17 +86,20 @@ public class Config // -------------------------------------------------- // Config File Definitions // -------------------------------------------------- - public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; - public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; + public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; + public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String TW_CONFIG_FILE = "./config/TerritoryWar.ini"; + private static final String CHARACTER_CONFIG_FILE = "./config/Character.ini"; private static final String CH_SIEGE_CONFIG_FILE = "./config/ConquerableHallSiege.ini"; private static final String FEATURE_CONFIG_FILE = "./config/Feature.ini"; private static final String FLOOD_PROTECTOR_CONFIG_FILE = "./config/FloodProtector.ini"; private static final String GENERAL_CONFIG_FILE = "./config/General.ini"; + private static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; private static final String GRACIASEEDS_CONFIG_FILE = "./config/GraciaSeeds.ini"; private static final String GRANDBOSS_CONFIG_FILE = "./config/GrandBoss.ini"; private static final String LOGIN_CONFIG_FILE = "./config/LoginServer.ini"; @@ -104,6 +107,7 @@ public class Config private static final String PVP_CONFIG_FILE = "./config/PVP.ini"; private static final String RATES_CONFIG_FILE = "./config/Rates.ini"; private static final String SERVER_CONFIG_FILE = "./config/Server.ini"; + private static final String CHAT_FILTER_FILE = "./config/chatfilter.txt"; private static final String HEXID_FILE = "./config/hexid.txt"; private static final String IPCONFIG_FILE = "./config/ipconfig.xml"; @@ -891,16 +895,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -942,13 +936,18 @@ public class Config public static int PRECAUTIONARY_RESTART_DELAY; // -------------------------------------------------- - // MMO Settings + // Network Settings // -------------------------------------------------- - public static int MMO_SELECTOR_SLEEP_TIME; - public static int MMO_MAX_SEND_PER_PASS; - public static int MMO_MAX_READ_PER_PASS; - public static int MMO_HELPER_BUFFER_COUNT; - public static boolean MMO_TCP_NODELAY; + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; // -------------------------------------------------- // Vitality Settings @@ -1385,16 +1384,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1496,6 +1485,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini b/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_1.0/dist/game/config/Server.ini b/L2J_Mobius_Classic_1.0/dist/game/config/Server.ini index 45bc6cb74b..e4641ec915 100644 --- a/L2J_Mobius_Classic_1.0/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_1.0/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java index 268ae6a2ae..7128e1f89d 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -767,16 +768,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -817,6 +808,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1302,16 +1307,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1413,6 +1408,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Network.ini b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Server.ini b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Server.ini index 89c280035c..b496dab339 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java index 08e662e533..15d886e601 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -777,16 +778,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -827,6 +818,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1320,16 +1325,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1431,6 +1426,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Network.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini index fc99806f74..0de2f1d2f8 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java index 5ba1a7fe07..90b91cf368 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -780,16 +781,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -830,6 +821,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1323,16 +1328,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1434,6 +1429,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Network.ini b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Server.ini index bf3a916dc3..22da7056e2 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java index 577bccd2fd..628ced96a7 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -780,16 +781,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -830,6 +821,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1327,16 +1332,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1438,6 +1433,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Network.ini b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Server.ini index d0b71f054d..1d9fee26b7 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java index 577bccd2fd..628ced96a7 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -780,16 +781,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -830,6 +821,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1327,16 +1332,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1438,6 +1433,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Network.ini b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Server.ini index cd7b233867..6f590a77cf 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java index 577bccd2fd..628ced96a7 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -780,16 +781,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -830,6 +821,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1327,16 +1332,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1438,6 +1433,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Network.ini b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Server.ini index 300b5907ab..538e4b323a 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.9.5_Saviors/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/Config.java index 463aa23ea4..08b0948aaa 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -786,16 +787,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -836,6 +827,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1338,16 +1343,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1449,6 +1444,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Network.ini b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Server.ini index dfb4cd73f4..02b8634df5 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java index 3044e4ac50..ed48dace5d 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -780,16 +781,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -830,6 +821,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1331,16 +1336,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1442,6 +1437,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Network.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini index ca5e0686f6..5687b2dd36 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java index ef2625471f..9bcc1c7d05 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -785,16 +786,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -835,6 +826,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1338,16 +1343,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1449,6 +1444,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini index fcdf066d4b..8bac8947e7 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 691d3242a4..99b5ea724a 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -90,6 +90,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -787,16 +788,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -837,6 +828,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1331,16 +1336,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1442,6 +1437,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Network.ini b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Server.ini b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Server.ini index 5c5cb9fc93..d7deaa4615 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Server.ini +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java index 155dcac5ff..339153b07a 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/Config.java @@ -89,6 +89,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -796,16 +797,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -846,6 +837,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1363,16 +1368,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1474,6 +1469,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Network.ini b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Server.ini b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Server.ini index 2dd6d60e87..3a49f7b865 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Server.ini +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java index b12c304fcc..d9f44025ea 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/Config.java @@ -91,6 +91,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -799,16 +800,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -849,6 +840,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1382,16 +1387,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1493,6 +1488,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Network.ini b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Server.ini b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Server.ini index 57a87474e7..2ad6f2431c 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Server.ini +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java index 21a3f50f6f..b97b8dffa4 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/Config.java @@ -91,6 +91,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -803,16 +804,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -853,6 +844,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1412,16 +1417,6 @@ public class Config PORT_GAME = serverConfig.getInt("GameserverPort", 7777); GAME_SERVER_LOGIN_PORT = serverConfig.getInt("LoginPort", 9014); GAME_SERVER_LOGIN_HOST = serverConfig.getString("LoginHost", "127.0.0.1"); - CLIENT_READ_POOL_SIZE = serverConfig.getInt("ClientReadPoolSize", 100); - CLIENT_SEND_POOL_SIZE = serverConfig.getInt("ClientSendPoolSize", 25); - CLIENT_EXECUTE_POOL_SIZE = serverConfig.getInt("ClientExecutePoolSize", 50); - PACKET_QUEUE_LIMIT = serverConfig.getInt("PacketQueueLimit", 80); - PACKET_FLOOD_DISCONNECT = serverConfig.getBoolean("PacketFloodDisconnect", false); - PACKET_FLOOD_DROP = serverConfig.getBoolean("PacketFloodDrop", false); - PACKET_FLOOD_LOGGED = serverConfig.getBoolean("PacketFloodLogged", true); - TCP_NO_DELAY = serverConfig.getBoolean("TcpNoDelay", true); - 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"); @@ -1523,6 +1518,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets(); diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Network.ini b/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Network.ini new file mode 100644 index 0000000000..f0322485b9 --- /dev/null +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Network.ini @@ -0,0 +1,53 @@ +# --------------------------------------------------------------------------------------------------------------------------------- +# Network Settings +# These settings provide fine-grained control over the network behavior and packet handling within the server application. +# Adjusting these parameters can help optimize network performance and ensure secure communication between the server and clients. +# --------------------------------------------------------------------------------------------------------------------------------- + +# Client pool size for reading client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientReadPoolSize = 100 + +# Client pool size for sending server packets. +# Each pool is executed on a separate thread. +# Default: 25 +ClientSendPoolSize = 25 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 50 +ClientExecutePoolSize = 50 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: False +PacketFloodDisconnect = False + +# Drop packets when queue has reached the queue packet limit. +# Default: False +PacketFloodDrop = False + +# Log message when queue has reached the queue packet limit. +# Default: True +PacketFloodLogged = True + +# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. +# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). +# Data will be sent earlier, at the cost of an increase in bandwidth consumption. +# Default: True (disabled) +TcpNoDelay = True + +# Packet encryption. +# By default packets sent or received are encrypted using the Blowfish algorithm. +# Disabling this reduces the resources needed to process any packets transfered, +# also broadcasted packets do not need to be re-encrypted for each client sent. +# Retail: True +PacketEncryption = False + +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = True diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Server.ini b/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Server.ini index 2026a09fe0..27f9e6e08e 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Server.ini +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Server.ini @@ -31,54 +31,6 @@ GameserverHostname = 0.0.0.0 # Default: 7777 GameserverPort = 7777 -# Client pool size for reading client packets. -# Each pool is executed on a separate thread. -# Default: 100 -ClientReadPoolSize = 100 - -# Client pool size for sending server packets. -# Each pool is executed on a separate thread. -# Default: 25 -ClientSendPoolSize = 25 - -# Client pool size for executing client packets. -# Each pool is executed on a separate thread. -# Default: 50 -ClientExecutePoolSize = 50 - -# Expected client packet count queued by the server. -# Default: 80 -PacketQueueLimit = 80 - -# Disconnect client when queue has reached the queue packet limit. -# Default: False -PacketFloodDisconnect = False - -# Drop packets when queue has reached the queue packet limit. -# Default: False -PacketFloodDrop = False - -# Log message when queue has reached the queue packet limit. -# Default: True -PacketFloodLogged = True - -# Nagle's algorithm tries to conserve bandwidth by minimizing the number of segments that are sent. -# When applications wish to decrease network latency, they can disable Nagle's algorithm (by enabling TcpNoDelay). -# Data will be sent earlier, at the cost of an increase in bandwidth consumption. -# Default: True (disabled) -TcpNoDelay = True - -# Packet encryption. -# By default packets sent or received are encrypted using the Blowfish algorithm. -# Disabling this reduces the resources needed to process any packets transfered, -# also broadcasted packets do not need to be re-encrypted for each client sent. -# Retail: True -PacketEncryption = False - -# Log message when packet decryption has failed. -# Default: True -FailedDecryptionLogged = True - # --------------------------------------------------------------------------- # Database diff --git a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/Config.java b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/Config.java index 21a3f50f6f..b0a7f60104 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/Config.java @@ -91,6 +91,7 @@ public class Config // -------------------------------------------------- public static final String GEOENGINE_CONFIG_FILE = "./config/GeoEngine.ini"; public static final String INTERFACE_CONFIG_FILE = "./config/Interface.ini"; + public static final String NETWORK_CONFIG_FILE = "./config/Network.ini"; public static final String OLYMPIAD_CONFIG_FILE = "./config/Olympiad.ini"; public static final String SIEGE_CONFIG_FILE = "./config/Siege.ini"; public static final String FORTSIEGE_CONFIG_FILE = "./config/FortSiege.ini"; @@ -803,16 +804,6 @@ public class Config public static int LOGIN_TRY_BEFORE_BAN; public static int LOGIN_BLOCK_AFTER_BAN; public static String GAMESERVER_HOSTNAME; - public static int CLIENT_READ_POOL_SIZE; - public static int CLIENT_SEND_POOL_SIZE; - public static int CLIENT_EXECUTE_POOL_SIZE; - public static int PACKET_QUEUE_LIMIT; - public static boolean PACKET_FLOOD_DISCONNECT; - public static boolean PACKET_FLOOD_DROP; - public static boolean PACKET_FLOOD_LOGGED; - public static boolean TCP_NO_DELAY; - 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; @@ -853,6 +844,20 @@ public class Config public static int PRECAUTIONARY_RESTART_PERCENTAGE; public static int PRECAUTIONARY_RESTART_DELAY; + // -------------------------------------------------- + // Network Settings + // -------------------------------------------------- + public static int CLIENT_READ_POOL_SIZE; + public static int CLIENT_SEND_POOL_SIZE; + public static int CLIENT_EXECUTE_POOL_SIZE; + public static int PACKET_QUEUE_LIMIT; + public static boolean PACKET_FLOOD_DISCONNECT; + public static boolean PACKET_FLOOD_DROP; + public static boolean PACKET_FLOOD_LOGGED; + public static boolean TCP_NO_DELAY; + public static boolean PACKET_ENCRYPTION; + public static boolean FAILED_DECRYPTION_LOGGED; + // -------------------------------------------------- // Vitality Settings // -------------------------------------------------- @@ -1523,6 +1528,18 @@ public class Config PRECAUTIONARY_RESTART_PERCENTAGE = serverConfig.getInt("PrecautionaryRestartPercentage", 95); PRECAUTIONARY_RESTART_DELAY = serverConfig.getInt("PrecautionaryRestartDelay", 60) * 1000; + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 25); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 50); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", false); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); + PACKET_ENCRYPTION = networkConfig.getBoolean("PacketEncryption", false); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", true); + // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); GAME_SERVER_SUBNETS = ipcd.getSubnets();