diff --git a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_1.0_Ertheia/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java index 13d83a6dd0..7293a9b365 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/Config.java @@ -1036,6 +1036,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2423,6 +2424,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 6201400953..d754640714 100644 --- a/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_1.0_Ertheia/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -404,6 +404,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3940,16 +3941,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_2.5_Underground/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_2.5_Underground/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java index 115c276fe4..00b33207a5 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/Config.java @@ -1043,6 +1043,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2439,6 +2440,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 6831d4812b..057fcec7b5 100644 --- a/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_2.5_Underground/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -406,6 +406,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3946,16 +3947,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_3.0_Helios/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_3.0_Helios/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java index d956b059f9..b86a2c4b1d 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/Config.java @@ -1051,6 +1051,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2454,6 +2455,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 5e70c11fd8..0dc2b5badd 100644 --- a/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_3.0_Helios/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -408,6 +408,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3948,16 +3949,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_4.0_GrandCrusade/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java index 0e08e14d49..32520c030a 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/Config.java @@ -1044,6 +1044,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2440,6 +2441,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index c8a3994c0d..ee2a965440 100644 --- a/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_4.0_GrandCrusade/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -413,6 +413,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3939,16 +3940,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_CT_2.6_HighFive/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java index 9032d3aa0d..aad82b0fcb 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/Config.java @@ -1227,6 +1227,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2758,6 +2759,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index dcfe2daa10..da1f2edd65 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index 90ae3109da..85bc70f8d9 100644 --- a/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_CT_2.6_HighFive/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -408,6 +408,7 @@ public final class L2PcInstance extends L2Playable private final List _eventListeners = new CopyOnWriteArrayList<>(); private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3894,16 +3895,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_Classic_2.0_Saviors/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java index d3d342b6d1..0e75f4b06f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/Config.java @@ -989,6 +989,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2337,6 +2338,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index fd18661570..ce2b24f1a7 100644 --- a/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.0_Saviors/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -405,6 +405,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3915,16 +3916,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_Classic_2.1_Zaken/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java index 53e700c448..76970d0b48 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/Config.java @@ -993,6 +993,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2344,6 +2345,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index d11248c99b..c5273dd6d4 100644 --- a/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.1_Zaken/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -405,6 +405,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3916,16 +3917,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition() diff --git a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/DualboxCheck.ini b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/DualboxCheck.ini index 19cf3f4004..51168272f1 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/DualboxCheck.ini +++ b/L2J_Mobius_Classic_2.2_Antharas/dist/game/config/Custom/DualboxCheck.ini @@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0 # Default: 0 (unlimited) DualboxCheckMaxL2EventParticipantsPerIP = 0 +# Count offline traders as dualbox. +# Default: False +DualboxCountOfflineTraders = False + # Whitelist of the addresses for dualbox checks. # Format: Address1,Number1;Address2,Number2... # Network address can be number (127.0.0.1) or symbolic (localhost) formats. diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java index 53e700c448..76970d0b48 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/Config.java @@ -993,6 +993,7 @@ public final class Config public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP; public static int DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP; public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP; + public static boolean DUALBOX_COUNT_OFFLINE_TRADERS; public static Map DUALBOX_CHECK_WHITELIST; public static boolean ALLOW_CHANGE_PASSWORD; public static boolean ALLOW_HUMAN; @@ -2344,6 +2345,7 @@ public final class Config DUALBOX_CHECK_MAX_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0); DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0); DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 0); + DUALBOX_COUNT_OFFLINE_TRADERS = DualboxCheck.getBoolean("DualboxCountOfflineTraders", false); final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";"); DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length); for (String entry : dualboxCheckWhiteList) diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java index 4b77cc607e..a0c117672f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/instancemanager/AntiFeedManager.java @@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.atomic.AtomicInteger; import com.l2jmobius.Config; +import com.l2jmobius.gameserver.model.L2World; import com.l2jmobius.gameserver.model.actor.L2Character; import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance; import com.l2jmobius.gameserver.network.L2GameClient; @@ -158,9 +159,20 @@ public final class AntiFeedManager } final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode()); - final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger()); + if (!Config.DUALBOX_COUNT_OFFLINE_TRADERS) + { + final String address = client.getConnectionAddress().getHostAddress(); + for (L2PcInstance player : L2World.getInstance().getPlayers()) + { + if (((player.getClient() == null) || player.getClient().isDetached()) && player.getIPAddress().equals(address)) + { + connectionCount.decrementAndGet(); + } + } + } + if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0))) { connectionCount.incrementAndGet(); diff --git a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java index efcae6092f..1582c0394f 100644 --- a/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java +++ b/L2J_Mobius_Classic_2.2_Antharas/java/com/l2jmobius/gameserver/model/actor/instance/L2PcInstance.java @@ -405,6 +405,7 @@ public final class L2PcInstance extends L2Playable private int _pcCafePoints = 0; private L2GameClient _client; + private String _ip = "N/A"; private final String _accountName; private long _deleteTimer; @@ -3916,16 +3917,15 @@ public final class L2PcInstance extends L2Playable public void setClient(L2GameClient client) { _client = client; + if ((_client != null) && (_client.getConnectionAddress() != null)) + { + _ip = _client.getConnectionAddress().getHostAddress(); + } } public String getIPAddress() { - String ip = "N/A"; - if ((_client != null) && (_client.getConnectionAddress() != null)) - { - ip = _client.getConnectionAddress().getHostAddress(); - } - return ip; + return _ip; } public Location getCurrentSkillWorldPosition()