From 900674e1776036c64b46c58ebe12cdd08d5420df Mon Sep 17 00:00:00 2001 From: MobiusDevelopment Date: Wed, 12 Jul 2023 01:15:21 +0300 Subject: [PATCH] LoginServer should also use the Network.ini configuration file. --- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 8 ++-- .../java/org/l2jmobius/Config.java | 4 +- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 5 +- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- .../dist/game/config/Network.ini | 12 ++--- .../dist/login/config/Network.ini | 46 +++++++++++++++++++ .../java/org/l2jmobius/Config.java | 15 +++++- .../org/l2jmobius/gameserver/GameServer.java | 2 +- .../l2jmobius/loginserver/LoginServer.java | 15 +++--- 153 files changed, 2247 insertions(+), 457 deletions(-) create mode 100644 L2J_Mobius_01.0_Ertheia/dist/login/config/Network.ini create mode 100644 L2J_Mobius_02.5_Underground/dist/login/config/Network.ini create mode 100644 L2J_Mobius_03.0_Helios/dist/login/config/Network.ini create mode 100644 L2J_Mobius_04.0_GrandCrusade/dist/login/config/Network.ini create mode 100644 L2J_Mobius_05.0_Salvation/dist/login/config/Network.ini create mode 100644 L2J_Mobius_05.5_EtinasFate/dist/login/config/Network.ini create mode 100644 L2J_Mobius_06.0_Fafurion/dist/login/config/Network.ini create mode 100644 L2J_Mobius_07.0_PreludeOfWar/dist/login/config/Network.ini create mode 100644 L2J_Mobius_08.2_Homunculus/dist/login/config/Network.ini create mode 100644 L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/login/config/Network.ini create mode 100644 L2J_Mobius_10.2_MasterClass/dist/login/config/Network.ini create mode 100644 L2J_Mobius_10.3_MasterClass/dist/login/config/Network.ini create mode 100644 L2J_Mobius_C6_Interlude/dist/login/config/Network.ini create mode 100644 L2J_Mobius_CT_0_Interlude/dist/login/config/Network.ini create mode 100644 L2J_Mobius_CT_2.4_Epilogue/dist/login/config/Network.ini create mode 100644 L2J_Mobius_CT_2.6_HighFive/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_1.0/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.0_Saviors/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.5_Zaken/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.7_Antharas/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.8_SevenSigns/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.9.5_Saviors/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_3.0_TheKamael/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Classic_Interlude/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Essence_5.2_FrostLord/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Essence_6.2_Vanguard/dist/login/config/Network.ini create mode 100644 L2J_Mobius_Essence_6.3_Crusader/dist/login/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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_01.0_Ertheia/dist/game/config/Network.ini +++ b/L2J_Mobius_01.0_Ertheia/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_01.0_Ertheia/dist/login/config/Network.ini b/L2J_Mobius_01.0_Ertheia/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_01.0_Ertheia/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 c9f17471ec..fe34fb02ce 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/Config.java @@ -817,9 +817,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1474,9 +1474,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3614,6 +3614,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java index 08cf7fdee5..0c423d6c19 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/gameserver/GameServer.java @@ -462,8 +462,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_01.0_Ertheia/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini b/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini +++ b/L2J_Mobius_02.5_Underground/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_02.5_Underground/dist/login/config/Network.ini b/L2J_Mobius_02.5_Underground/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_02.5_Underground/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 41087a686b..c882af4f92 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/Config.java @@ -828,9 +828,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1486,9 +1486,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3640,6 +3640,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java index bf20c50def..12892188d2 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/gameserver/GameServer.java @@ -470,8 +470,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_02.5_Underground/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_02.5_Underground/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini b/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini +++ b/L2J_Mobius_03.0_Helios/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_03.0_Helios/dist/login/config/Network.ini b/L2J_Mobius_03.0_Helios/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_03.0_Helios/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 3f40bc8ba6..33a8f667c5 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/Config.java @@ -829,9 +829,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1499,9 +1499,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3662,6 +3662,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/GameServer.java index bf20c50def..12892188d2 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/gameserver/GameServer.java @@ -470,8 +470,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_03.0_Helios/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_03.0_Helios/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini +++ b/L2J_Mobius_04.0_GrandCrusade/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_04.0_GrandCrusade/dist/login/config/Network.ini b/L2J_Mobius_04.0_GrandCrusade/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_04.0_GrandCrusade/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 c4afb1e5f5..bd5bdae9e4 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -816,9 +816,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1486,9 +1486,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3636,6 +3636,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java index 7c5c8ae2d2..dff3464061 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/gameserver/GameServer.java @@ -470,8 +470,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_04.0_GrandCrusade/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini b/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini +++ b/L2J_Mobius_05.0_Salvation/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_05.0_Salvation/dist/login/config/Network.ini b/L2J_Mobius_05.0_Salvation/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_05.0_Salvation/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 3ee637d093..7582062a52 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/Config.java @@ -815,9 +815,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1485,9 +1485,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3645,6 +3645,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java index f720f73e48..e383a9727c 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/gameserver/GameServer.java @@ -474,8 +474,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_05.0_Salvation/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini +++ b/L2J_Mobius_05.5_EtinasFate/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_05.5_EtinasFate/dist/login/config/Network.ini b/L2J_Mobius_05.5_EtinasFate/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_05.5_EtinasFate/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 df92b2f6e1..31ac3c2096 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/Config.java @@ -815,9 +815,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1492,9 +1492,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3657,6 +3657,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java index f720f73e48..e383a9727c 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/gameserver/GameServer.java @@ -474,8 +474,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_05.5_EtinasFate/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini b/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini +++ b/L2J_Mobius_06.0_Fafurion/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_06.0_Fafurion/dist/login/config/Network.ini b/L2J_Mobius_06.0_Fafurion/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_06.0_Fafurion/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 ea002445eb..8eded79f33 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/Config.java @@ -816,9 +816,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1513,9 +1513,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3699,6 +3699,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java index 9073e4ef38..503610c4c6 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/gameserver/GameServer.java @@ -476,8 +476,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_06.0_Fafurion/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_07.0_PreludeOfWar/dist/login/config/Network.ini b/L2J_Mobius_07.0_PreludeOfWar/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_07.0_PreludeOfWar/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 3eef3af20c..27939dd675 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -822,9 +822,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1521,9 +1521,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3715,6 +3715,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java index 1a1b20df72..85e74c9324 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/gameserver/GameServer.java @@ -482,8 +482,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_07.0_PreludeOfWar/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini b/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini +++ b/L2J_Mobius_08.2_Homunculus/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_08.2_Homunculus/dist/login/config/Network.ini b/L2J_Mobius_08.2_Homunculus/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_08.2_Homunculus/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 e34c8653f8..cd55db8013 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/Config.java @@ -813,9 +813,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1512,9 +1512,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3690,6 +3690,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/GameServer.java index 5fc7825ca4..939963fd52 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/gameserver/GameServer.java @@ -486,8 +486,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_08.2_Homunculus/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/login/config/Network.ini b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 fa0e2d7fda..90ae439155 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/Config.java @@ -813,9 +813,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1514,9 +1514,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3694,6 +3694,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/GameServer.java index 183066734d..28cedcd6ae 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/gameserver/GameServer.java @@ -490,8 +490,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_09.2_ReturnOfTheQueenAnt/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini b/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini +++ b/L2J_Mobius_10.2_MasterClass/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_10.2_MasterClass/dist/login/config/Network.ini b/L2J_Mobius_10.2_MasterClass/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_10.2_MasterClass/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 badeaff6f6..02649b0140 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/Config.java @@ -813,9 +813,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1515,9 +1515,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3696,6 +3696,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/GameServer.java index 3df1019b65..75f22ac4b8 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/gameserver/GameServer.java @@ -494,8 +494,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_10.2_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini b/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini +++ b/L2J_Mobius_10.3_MasterClass/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_10.3_MasterClass/dist/login/config/Network.ini b/L2J_Mobius_10.3_MasterClass/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_10.3_MasterClass/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 897fd1221f..bca79f3d15 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/Config.java @@ -817,9 +817,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Hardin (Agent of Chaos) @@ -1549,9 +1549,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3754,6 +3754,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/GameServer.java index d40592ee04..df98a562a4 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/gameserver/GameServer.java @@ -498,8 +498,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_10.3_MasterClass/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini index 8f766dcb14..e4ea7b3ae8 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini +++ b/L2J_Mobius_C4_ScionsOfDestiny/dist/game/config/Network.ini @@ -35,12 +35,12 @@ PacketFloodDrop = False # Default: True PacketFloodLogged = True +# Log message when packet decryption has failed. +# Default: True +FailedDecryptionLogged = 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 26f98c0c66..37386155f0 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/Config.java @@ -1074,8 +1074,8 @@ public class Config 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 boolean TCP_NO_DELAY; public static int IP_UPDATE_TIME; public static boolean SHOW_LICENCE; @@ -1197,8 +1197,8 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } public static void loadRatesConfig() diff --git a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java index 1221df5404..8cce2a9c07 100644 --- a/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_C4_ScionsOfDestiny/java/org/l2jmobius/gameserver/GameServer.java @@ -464,8 +464,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini b/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini +++ b/L2J_Mobius_C6_Interlude/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_C6_Interlude/dist/login/config/Network.ini b/L2J_Mobius_C6_Interlude/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_C6_Interlude/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java index d703ca420e..521429343f 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/Config.java @@ -1121,9 +1121,9 @@ public class Config 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 TCP_NO_DELAY; public static boolean SHOW_LICENCE; public static boolean FLOOD_PROTECTION; @@ -1238,9 +1238,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } public static void loadRatesConfig() @@ -3048,6 +3048,7 @@ public class Config else if (SERVER_MODE == ServerMode.LOGIN) { loadLoginStartConfig(); + loadNetworkConfig(); } else { diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java index c6459e368b..00647c9cb7 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/gameserver/GameServer.java @@ -478,8 +478,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java index a7033374f8..5ccc960e10 100644 --- a/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_C6_Interlude/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini b/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini +++ b/L2J_Mobius_CT_0_Interlude/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_CT_0_Interlude/dist/login/config/Network.ini b/L2J_Mobius_CT_0_Interlude/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_CT_0_Interlude/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 a0b250d3f8..a53af2c159 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/Config.java @@ -914,9 +914,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1438,9 +1438,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3085,6 +3085,17 @@ public class Config NORMAL_CONNECTION_TIME = loginConfig.getInt("NormalConnectionTime", 700); FAST_CONNECTION_TIME = loginConfig.getInt("FastConnectionTime", 350); MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/GameServer.java index c7cb9431b0..e0d6fe5060 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/gameserver/GameServer.java @@ -444,8 +444,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_CT_0_Interlude/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Network.ini +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_CT_2.4_Epilogue/dist/login/config/Network.ini b/L2J_Mobius_CT_2.4_Epilogue/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_CT_2.4_Epilogue/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 f30085569b..a816b889a3 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 @@ -939,9 +939,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1491,9 +1491,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3201,6 +3201,17 @@ public class Config NORMAL_CONNECTION_TIME = loginConfig.getInt("NormalConnectionTime", 700); FAST_CONNECTION_TIME = loginConfig.getInt("FastConnectionTime", 350); MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/GameServer.java index f2ad1bf205..e6abda4f45 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/gameserver/GameServer.java @@ -474,8 +474,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_CT_2.4_Epilogue/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Network.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/login/config/Network.ini b/L2J_Mobius_CT_2.6_HighFive/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_CT_2.6_HighFive/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 2dff060aa3..781c20170b 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 @@ -944,9 +944,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1491,9 +1491,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3208,6 +3208,17 @@ public class Config NORMAL_CONNECTION_TIME = loginConfig.getInt("NormalConnectionTime", 700); FAST_CONNECTION_TIME = loginConfig.getInt("FastConnectionTime", 350); MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/GameServer.java index 91e72c4099..294e8728e0 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/gameserver/GameServer.java @@ -476,8 +476,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini b/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_1.0/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_1.0/dist/login/config/Network.ini b/L2J_Mobius_Classic_1.0/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_1.0/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 6e9edb57e3..11bb4b7ddb 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/Config.java @@ -817,9 +817,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1414,9 +1414,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3491,6 +3491,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/GameServer.java index 9c294a9e3c..36a2b56f9a 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/gameserver/GameServer.java @@ -457,8 +457,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_1.0/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_1.0/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/login/config/Network.ini b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 02025197b5..8b5fcbe0d5 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 @@ -827,9 +827,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1432,9 +1432,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3537,6 +3537,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/GameServer.java index e079635023..c6fc8e3548 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/gameserver/GameServer.java @@ -465,8 +465,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_1.5_AgeOfSplendor/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/login/config/Network.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 080a0eb9d4..bb18e2a026 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 @@ -830,9 +830,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1435,9 +1435,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3543,6 +3543,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/GameServer.java index 74b7911485..9e1da41989 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/GameServer.java @@ -471,8 +471,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_2.5_Zaken/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_2.5_Zaken/dist/login/config/Network.ini b/L2J_Mobius_Classic_2.5_Zaken/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_2.5_Zaken/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 d962ed392c..ca42d94c73 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 @@ -830,9 +830,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1439,9 +1439,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3549,6 +3549,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/GameServer.java index 74b7911485..9e1da41989 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/gameserver/GameServer.java @@ -471,8 +471,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_2.5_Zaken/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_2.7_Antharas/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_2.7_Antharas/dist/login/config/Network.ini b/L2J_Mobius_Classic_2.7_Antharas/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_2.7_Antharas/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 d962ed392c..ca42d94c73 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 @@ -830,9 +830,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1439,9 +1439,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3549,6 +3549,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/GameServer.java index 6aa3f024d4..a1476e4a0d 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/gameserver/GameServer.java @@ -473,8 +473,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_2.7_Antharas/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/dist/login/config/Network.ini b/L2J_Mobius_Classic_2.8_SevenSigns/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_2.8_SevenSigns/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 d962ed392c..ca42d94c73 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 @@ -830,9 +830,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1439,9 +1439,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3549,6 +3549,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java index 674f77fc88..93c6d6100f 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/gameserver/GameServer.java @@ -475,8 +475,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_2.8_SevenSigns/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- 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 @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/dist/login/config/Network.ini b/L2J_Mobius_Classic_2.9.5_Saviors/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_2.9.5_Saviors/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 48b48c24a5..650705bd05 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 @@ -836,9 +836,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1450,9 +1450,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3571,6 +3571,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/GameServer.java index bf40293575..1793eacdcd 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/gameserver/GameServer.java @@ -479,8 +479,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_2.9.5_Saviors/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/login/config/Network.ini b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 0f5a3d482c..3ad659e06d 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 @@ -830,9 +830,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1443,9 +1443,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3557,6 +3557,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java index 8b0d4f2cab..0f51253eee 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/gameserver/GameServer.java @@ -477,8 +477,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_2.9_SecretOfEmpire/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/login/config/Network.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 f5fc7fe5c3..7228c594b9 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 @@ -835,9 +835,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1450,9 +1450,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3571,6 +3571,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java index 02f74b2b90..8105ecf99d 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/GameServer.java @@ -483,8 +483,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Classic_Interlude/dist/login/config/Network.ini b/L2J_Mobius_Classic_Interlude/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Classic_Interlude/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index b58f0f1825..37dcd472bd 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -837,9 +837,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1443,9 +1443,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3546,6 +3546,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/GameServer.java index 0240819746..7b70d9962d 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/GameServer.java @@ -467,8 +467,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Network.ini +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/login/config/Network.ini b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 64655a4198..19d36921f0 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 @@ -846,9 +846,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1475,9 +1475,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3625,6 +3625,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java index ec7ea0393e..7a1fb9a00c 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/gameserver/GameServer.java @@ -503,8 +503,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Essence_4.2_DwellingOfSpirits/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Network.ini +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Essence_5.2_FrostLord/dist/login/config/Network.ini b/L2J_Mobius_Essence_5.2_FrostLord/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Essence_5.2_FrostLord/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 cb03b3da52..cd34ee1b57 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 @@ -849,9 +849,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1494,9 +1494,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3741,6 +3741,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/GameServer.java index 28006b54f2..29f9791c18 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/gameserver/GameServer.java @@ -515,8 +515,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Essence_5.2_FrostLord/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Network.ini +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Essence_6.2_Vanguard/dist/login/config/Network.ini b/L2J_Mobius_Essence_6.2_Vanguard/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Essence_6.2_Vanguard/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 60fb16886a..93e8eff82d 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 @@ -853,9 +853,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1524,9 +1524,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3800,6 +3800,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/GameServer.java index da08bfcc45..eeb255482e 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/gameserver/GameServer.java @@ -525,8 +525,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Essence_6.2_Vanguard/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); } 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 index 0d36490c18..410a71e907 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Network.ini +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/game/config/Network.ini @@ -35,12 +35,6 @@ PacketFloodDrop = False # 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, @@ -51,3 +45,9 @@ PacketEncryption = False # Log message when packet decryption has failed. # Default: True FailedDecryptionLogged = 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 diff --git a/L2J_Mobius_Essence_6.3_Crusader/dist/login/config/Network.ini b/L2J_Mobius_Essence_6.3_Crusader/dist/login/config/Network.ini new file mode 100644 index 0000000000..c2b1e8836c --- /dev/null +++ b/L2J_Mobius_Essence_6.3_Crusader/dist/login/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: 100 +ClientSendPoolSize = 100 + +# Client pool size for executing client packets. +# Each pool is executed on a separate thread. +# Default: 100 +ClientExecutePoolSize = 100 + +# Expected client packet count queued by the server. +# Default: 80 +PacketQueueLimit = 80 + +# Disconnect client when queue has reached the queue packet limit. +# Default: True +PacketFloodDisconnect = True + +# 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 + +# Log message when packet decryption has failed. +# Default: False +FailedDecryptionLogged = False + +# 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 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 7c1c733507..3e18db5d4b 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 @@ -853,9 +853,9 @@ public class Config 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 TCP_NO_DELAY; // -------------------------------------------------- // Vitality Settings @@ -1534,9 +1534,9 @@ public class Config 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); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); // Hosts and Subnets final IPConfigData ipcd = new IPConfigData(); @@ -3810,6 +3810,17 @@ public class Config MAX_CONNECTION_PER_IP = loginConfig.getInt("MaxConnectionPerIP", 50); ENABLE_CMD_LINE_LOGIN = loginConfig.getBoolean("EnableCmdLineLogin", false); ONLY_CMD_LINE_LOGIN = loginConfig.getBoolean("OnlyCmdLineLogin", false); + + final PropertiesParser networkConfig = new PropertiesParser(NETWORK_CONFIG_FILE); + CLIENT_READ_POOL_SIZE = networkConfig.getInt("ClientReadPoolSize", 100); + CLIENT_SEND_POOL_SIZE = networkConfig.getInt("ClientSendPoolSize", 100); + CLIENT_EXECUTE_POOL_SIZE = networkConfig.getInt("ClientExecutePoolSize", 100); + PACKET_QUEUE_LIMIT = networkConfig.getInt("PacketQueueLimit", 80); + PACKET_FLOOD_DISCONNECT = networkConfig.getBoolean("PacketFloodDisconnect", true); + PACKET_FLOOD_DROP = networkConfig.getBoolean("PacketFloodDrop", false); + PACKET_FLOOD_LOGGED = networkConfig.getBoolean("PacketFloodLogged", true); + FAILED_DECRYPTION_LOGGED = networkConfig.getBoolean("FailedDecryptionLogged", false); + TCP_NO_DELAY = networkConfig.getBoolean("TcpNoDelay", true); } else { diff --git a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/GameServer.java b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/GameServer.java index da08bfcc45..eeb255482e 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/GameServer.java +++ b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/gameserver/GameServer.java @@ -525,8 +525,8 @@ public class GameServer server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); - server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); LoginServerThread.getInstance().start(); diff --git a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/loginserver/LoginServer.java b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/loginserver/LoginServer.java index acbc036834..e74cd7e893 100644 --- a/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/loginserver/LoginServer.java +++ b/L2J_Mobius_Essence_6.3_Crusader/java/org/l2jmobius/loginserver/LoginServer.java @@ -135,12 +135,15 @@ public class LoginServer final NetServer server = new NetServer<>(Config.LOGIN_BIND_ADDRESS, Config.PORT_LOGIN, new LoginPacketHandler(), LoginClient::new); server.setName(getClass().getSimpleName()); - server.getNetConfig().setReadPoolSize(2000); - server.getNetConfig().setSendPoolSize(2000); - server.getNetConfig().setExecutePoolSize(2000); - server.getNetConfig().setPacketQueueLimit(10); - server.getNetConfig().setPacketFloodDisconnect(true); - server.getNetConfig().setFailedDecryptionLogged(false); + server.getNetConfig().setReadPoolSize(Config.CLIENT_READ_POOL_SIZE); + server.getNetConfig().setSendPoolSize(Config.CLIENT_SEND_POOL_SIZE); + server.getNetConfig().setExecutePoolSize(Config.CLIENT_EXECUTE_POOL_SIZE); + server.getNetConfig().setPacketQueueLimit(Config.PACKET_QUEUE_LIMIT); + server.getNetConfig().setPacketFloodDisconnect(Config.PACKET_FLOOD_DISCONNECT); + server.getNetConfig().setPacketFloodDrop(Config.PACKET_FLOOD_DROP); + server.getNetConfig().setPacketFloodLogged(Config.PACKET_FLOOD_LOGGED); + server.getNetConfig().setFailedDecryptionLogged(Config.FAILED_DECRYPTION_LOGGED); + server.getNetConfig().setTcpNoDelay(Config.TCP_NO_DELAY); server.start(); }