Config for dualbox check not to count offline traders.
This commit is contained in:
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -1036,6 +1036,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -404,6 +404,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3940,16 +3941,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -1043,6 +1043,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -406,6 +406,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3946,16 +3947,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -1051,6 +1051,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -408,6 +408,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3948,16 +3949,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -1044,6 +1044,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -413,6 +413,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3939,16 +3940,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -1227,6 +1227,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -408,6 +408,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private final List<IEventListener> _eventListeners = new CopyOnWriteArrayList<>();
|
private final List<IEventListener> _eventListeners = new CopyOnWriteArrayList<>();
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3894,16 +3895,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -989,6 +989,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -405,6 +405,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3915,16 +3916,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -993,6 +993,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -405,6 +405,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3916,16 +3917,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
@@ -14,6 +14,10 @@ DualboxCheckMaxOlympiadParticipantsPerIP = 0
|
|||||||
# Default: 0 (unlimited)
|
# Default: 0 (unlimited)
|
||||||
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
DualboxCheckMaxL2EventParticipantsPerIP = 0
|
||||||
|
|
||||||
|
# Count offline traders as dualbox.
|
||||||
|
# Default: False
|
||||||
|
DualboxCountOfflineTraders = False
|
||||||
|
|
||||||
# Whitelist of the addresses for dualbox checks.
|
# Whitelist of the addresses for dualbox checks.
|
||||||
# Format: Address1,Number1;Address2,Number2...
|
# Format: Address1,Number1;Address2,Number2...
|
||||||
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
# Network address can be number (127.0.0.1) or symbolic (localhost) formats.
|
||||||
|
|||||||
@@ -993,6 +993,7 @@ public final class Config
|
|||||||
public static int DUALBOX_CHECK_MAX_PLAYERS_PER_IP;
|
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_OLYMPIAD_PARTICIPANTS_PER_IP;
|
||||||
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
public static int DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP;
|
||||||
|
public static boolean DUALBOX_COUNT_OFFLINE_TRADERS;
|
||||||
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
public static Map<Integer, Integer> DUALBOX_CHECK_WHITELIST;
|
||||||
public static boolean ALLOW_CHANGE_PASSWORD;
|
public static boolean ALLOW_CHANGE_PASSWORD;
|
||||||
public static boolean ALLOW_HUMAN;
|
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_PLAYERS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxPlayersPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxOlympiadParticipantsPerIP", 0);
|
||||||
DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP = DualboxCheck.getInt("DualboxCheckMaxL2EventParticipantsPerIP", 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(";");
|
final String[] dualboxCheckWhiteList = DualboxCheck.getString("DualboxCheckWhitelist", "127.0.0.1,0").split(";");
|
||||||
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
DUALBOX_CHECK_WHITELIST = new HashMap<>(dualboxCheckWhiteList.length);
|
||||||
for (String entry : dualboxCheckWhiteList)
|
for (String entry : dualboxCheckWhiteList)
|
||||||
|
|||||||
+13
-1
@@ -21,6 +21,7 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.l2jmobius.Config;
|
import com.l2jmobius.Config;
|
||||||
|
import com.l2jmobius.gameserver.model.L2World;
|
||||||
import com.l2jmobius.gameserver.model.actor.L2Character;
|
import com.l2jmobius.gameserver.model.actor.L2Character;
|
||||||
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
import com.l2jmobius.gameserver.model.actor.instance.L2PcInstance;
|
||||||
import com.l2jmobius.gameserver.network.L2GameClient;
|
import com.l2jmobius.gameserver.network.L2GameClient;
|
||||||
@@ -158,9 +159,20 @@ public final class AntiFeedManager
|
|||||||
}
|
}
|
||||||
|
|
||||||
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
final Integer addrHash = Integer.valueOf(client.getConnectionAddress().hashCode());
|
||||||
|
|
||||||
final AtomicInteger connectionCount = event.computeIfAbsent(addrHash, k -> new AtomicInteger());
|
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)))
|
if ((connectionCount.get() + 1) <= (max + Config.DUALBOX_CHECK_WHITELIST.getOrDefault(addrHash, 0)))
|
||||||
{
|
{
|
||||||
connectionCount.incrementAndGet();
|
connectionCount.incrementAndGet();
|
||||||
|
|||||||
+6
-6
@@ -405,6 +405,7 @@ public final class L2PcInstance extends L2Playable
|
|||||||
private int _pcCafePoints = 0;
|
private int _pcCafePoints = 0;
|
||||||
|
|
||||||
private L2GameClient _client;
|
private L2GameClient _client;
|
||||||
|
private String _ip = "N/A";
|
||||||
|
|
||||||
private final String _accountName;
|
private final String _accountName;
|
||||||
private long _deleteTimer;
|
private long _deleteTimer;
|
||||||
@@ -3916,16 +3917,15 @@ public final class L2PcInstance extends L2Playable
|
|||||||
public void setClient(L2GameClient client)
|
public void setClient(L2GameClient client)
|
||||||
{
|
{
|
||||||
_client = client;
|
_client = client;
|
||||||
|
if ((_client != null) && (_client.getConnectionAddress() != null))
|
||||||
|
{
|
||||||
|
_ip = _client.getConnectionAddress().getHostAddress();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getIPAddress()
|
public String getIPAddress()
|
||||||
{
|
{
|
||||||
String ip = "N/A";
|
return _ip;
|
||||||
if ((_client != null) && (_client.getConnectionAddress() != null))
|
|
||||||
{
|
|
||||||
ip = _client.getConnectionAddress().getHostAddress();
|
|
||||||
}
|
|
||||||
return ip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Location getCurrentSkillWorldPosition()
|
public Location getCurrentSkillWorldPosition()
|
||||||
|
|||||||
Reference in New Issue
Block a user