diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Server.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Server.ini index de720042a0..50f69fca04 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Server.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java index 89bb4a61cd..2a4be6bec3 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/Config.java @@ -752,6 +752,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1396,7 +1397,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 2966100f2b..5e450575ca 100644 --- a/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_1.0_Ertheia/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -680,27 +680,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Server.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Server.ini index 5fc968d4c3..908d798510 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Server.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java index 2f12efa871..b09ed2e829 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/Config.java @@ -761,6 +761,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1406,7 +1407,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 979063963e..46cc1284e1 100644 --- a/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_2.5_Underground/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -713,27 +713,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Server.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Server.ini index d37a377bc7..e1aff779ad 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Server.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java index 900895b89f..56f580a8b5 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/Config.java @@ -762,6 +762,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1419,7 +1420,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 979063963e..46cc1284e1 100644 --- a/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_3.0_Helios/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -713,27 +713,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Server.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Server.ini index e946a2cb31..1aeb02e160 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Server.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java index d931237289..e48c400f59 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/Config.java @@ -749,6 +749,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1406,7 +1407,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 05fe0b8192..5c864212ed 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -713,27 +713,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_5.0_Salvation/dist/game/config/Server.ini b/L2J_Mobius_5.0_Salvation/dist/game/config/Server.ini index 6f77731773..02dccf0fbf 100644 --- a/L2J_Mobius_5.0_Salvation/dist/game/config/Server.ini +++ b/L2J_Mobius_5.0_Salvation/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java index 490936df8a..cc04253d88 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/Config.java @@ -744,6 +744,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1401,7 +1402,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 33c4b75ced..187f81cb74 100644 --- a/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_5.0_Salvation/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -711,27 +711,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Server.ini b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Server.ini index f3de20fc11..a58fc549b9 100644 --- a/L2J_Mobius_5.5_EtinasFate/dist/game/config/Server.ini +++ b/L2J_Mobius_5.5_EtinasFate/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java index 75277b0c54..6446aaf49b 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/Config.java @@ -744,6 +744,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1408,7 +1409,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index e6a24df7c6..3e3f9124bc 100644 --- a/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_5.5_EtinasFate/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -711,27 +711,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_6.0_Fafurion/dist/game/config/Server.ini b/L2J_Mobius_6.0_Fafurion/dist/game/config/Server.ini index 6bcfd7a4e4..05c426a3a5 100644 --- a/L2J_Mobius_6.0_Fafurion/dist/game/config/Server.ini +++ b/L2J_Mobius_6.0_Fafurion/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java index 725af92272..40020bb710 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/Config.java @@ -745,6 +745,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1430,7 +1431,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index e6a24df7c6..3e3f9124bc 100644 --- a/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_6.0_Fafurion/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -711,27 +711,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Server.ini b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Server.ini index ee0448aad8..7d7362ed45 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Server.ini +++ b/L2J_Mobius_7.0_PreludeOfWar/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java index d05cc7a12e..161b4aacf1 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/Config.java @@ -750,6 +750,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1441,7 +1442,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 1e1408f711..28ddc59c72 100644 --- a/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_7.0_PreludeOfWar/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -738,27 +738,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini index 0e4f2fa4bd..0b6151070d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 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 92ee9a3744..4fb04b31d2 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 @@ -751,6 +751,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1337,7 +1338,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 8b66b25696..71213f252d 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -696,27 +696,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Server.ini index b4b7ef6732..4c0548da1d 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java index b7f4c6e50a..726d1750b4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/Config.java @@ -751,6 +751,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1341,7 +1342,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 07f50261ef..296300f511 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -696,27 +696,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Server.ini index 7501a6e53c..3b9aa1bcd8 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java index b7f4c6e50a..726d1750b4 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/Config.java @@ -751,6 +751,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1341,7 +1342,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 6404d6922c..e2998a791a 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -698,27 +698,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Server.ini index 170cc74b69..ef351b585a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.3_SevenSigns/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java index 2b713e7438..0eebf93719 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/Config.java @@ -751,6 +751,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1341,7 +1342,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 6404d6922c..e2998a791a 100644 --- a/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.3_SevenSigns/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -698,27 +698,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Server.ini b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Server.ini index 546e2fd8ef..4c1f46e67d 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java index c5234476ac..ca3a8abffd 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/Config.java @@ -751,6 +751,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1346,7 +1347,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 6404d6922c..e2998a791a 100644 --- a/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_2.4_SecretOfEmpire/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -698,27 +698,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini index 81e8ec2dc1..20632ac4bb 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_3.0_TheKamael/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 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 03d6a70896..bf16f17bae 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 @@ -755,6 +755,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1354,7 +1355,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 10c01ed90f..24a68760df 100644 --- a/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_3.0_TheKamael/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -718,27 +718,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); } diff --git a/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini b/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini index d1fa573611..190cc64742 100644 --- a/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini +++ b/L2J_Mobius_Classic_Interlude/dist/game/config/Server.ini @@ -162,11 +162,15 @@ RestartOnDeadlock = False # --------------------------------------------------------------------------- # Check if hardware information is sent upon login. -# Players without hardware information are kicked from the game. # WARNING: To receive hardware information from client, l2.ini NetSendHardWare must be set to true. # Default: False EnableHardwareInfo = False +# Players without hardware information are kicked from the game. +# Automatically set to True when MaxPlayersPerHWID > 0. +# Default: False +KickMissingHWID = False + # Maximum number of players per HWID allowed to enter game. # Default: 0 (unlimited) MaxPlayersPerHWID = 0 diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java index 5a747cc991..28885cb00b 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/Config.java @@ -760,6 +760,7 @@ public class Config public static int BACKUP_DAYS; public static int MAXIMUM_ONLINE_USERS; public static boolean HARDWARE_INFO_ENABLED; + public static boolean KICK_MISSING_HWID; public static int MAX_PLAYERS_PER_HWID; public static Pattern CHARNAME_TEMPLATE_PATTERN; public static String PET_NAME_TEMPLATE; @@ -1355,7 +1356,12 @@ public class Config MAX_CHARACTERS_NUMBER_PER_ACCOUNT = serverSettings.getInt("CharMaxNumber", 7); MAXIMUM_ONLINE_USERS = serverSettings.getInt("MaximumOnlineUsers", 100); HARDWARE_INFO_ENABLED = serverSettings.getBoolean("EnableHardwareInfo", false); + KICK_MISSING_HWID = serverSettings.getBoolean("KickMissingHWID", false); MAX_PLAYERS_PER_HWID = serverSettings.getInt("MaxPlayersPerHWID", 0); + if (MAX_PLAYERS_PER_HWID > 0) + { + KICK_MISSING_HWID = true; + } final String[] protocols = serverSettings.getString("AllowedProtocolRevisions", "603;606;607").split(";"); PROTOCOL_LIST = new ArrayList<>(protocols.length); for (String protocol : protocols) diff --git a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java index 8d2846eeff..f10cc991d4 100644 --- a/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java +++ b/L2J_Mobius_Classic_Interlude/java/org/l2jmobius/gameserver/network/clientpackets/EnterWorld.java @@ -696,27 +696,24 @@ public class EnterWorld implements IClientIncomingPacket } // Check max players. - if (Config.MAX_PLAYERS_PER_HWID > 0) + if (Config.KICK_MISSING_HWID && (hwInfo == null)) { - if (hwInfo == null) + Disconnection.of(client).defaultSequence(false); + } + else if (Config.MAX_PLAYERS_PER_HWID > 0) + { + int count = 0; + for (PlayerInstance plr : World.getInstance().getPlayers()) + { + if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) + { + count++; + } + } + if (count >= Config.MAX_PLAYERS_PER_HWID) { Disconnection.of(client).defaultSequence(false); } - else - { - int count = 0; - for (PlayerInstance plr : World.getInstance().getPlayers()) - { - if ((plr.isOnlineInt() == 1) && (plr.getClient().getHardwareInfo().equals(hwInfo))) - { - count++; - } - } - if (count >= Config.MAX_PLAYERS_PER_HWID) - { - Disconnection.of(client).defaultSequence(false); - } - } } }, 5000); }