Config for dualbox check not to count offline traders.
This commit is contained in:
@@ -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();
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user