Dualbox and offline traders

Support for the latest build of L2J Server, get help here with installations, upgrades, problems.
Do not post bugs reports here, use viewforum.php?f=77 instead.
There is no support for other server builds than the official provided by l2jserver.com
Forum rules
READ NOW: L2j Forums Rules of Conduct
Post Reply
HanNaGamSa
Posts: 22
Joined: Mon Jun 09, 2014 4:55 pm

Dualbox and offline traders

Post by HanNaGamSa »

I've searched with this topic already. There was a topic but couldn't have the answer I anticipated.
So I ask it.

Now, dualbox counts offline traders too.
So, if you allow only 2 chars per an IP, you can only have an active char in live server what if you have already an offline trader.

But I wanna make the dualbox will whitelist offline traders.

Waiting for ur replies. thanks.
User avatar
UnAfraid
L2j Veteran
L2j Veteran
Posts: 4199
Joined: Mon Jul 23, 2007 4:25 pm
Location: Bulgaria
Contact:

Re: Dualbox and offline traders

Post by UnAfraid »

Then make it like player logged out when activating offline mode.
Image
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Dualbox and offline traders

Post by Zoey76 »

I think it's possible and there should be a config for this, I'll check now.
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
User avatar
Zoey76
L2j Inner Circle
L2j Inner Circle
Posts: 7008
Joined: Tue Aug 11, 2009 3:36 am

Re: Dualbox and offline traders

Post by Zoey76 »

Check this
Gist by: Zoey76
diff --git a/L2J_Server/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java b/L2J_Server/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java
index 640e00e..1e6ccb4 100644
--- a/L2J_Server/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java
+++ b/L2J_Server/java/com/l2jserver/gameserver/instancemanager/AntiFeedManager.java
@@ -147,6 +147,11 @@
return false; // unable to determine IP address
}
+ if (max <= 0)
+ {
+ return true;
+ }
+
final Map<Integer, AtomicInteger> event = _eventIPs.get(eventId);
if (event == null)
{
diff --git a/L2J_Server/java/com/l2jserver/gameserver/model/entity/L2Event.java b/L2J_Server/java/com/l2jserver/gameserver/model/entity/L2Event.java
index cddc1da..1800e05 100644
--- a/L2J_Server/java/com/l2jserver/gameserver/model/entity/L2Event.java
+++ b/L2J_Server/java/com/l2jserver/gameserver/model/entity/L2Event.java
@@ -262,7 +262,7 @@
return;
}
- if ((Config.L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP == 0) || AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.L2EVENT_ID, player, Config.L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP))
+ if (AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.L2EVENT_ID, player, Config.L2JMOD_DUALBOX_CHECK_MAX_L2EVENT_PARTICIPANTS_PER_IP))
{
_registeredPlayers.add(player);
}
diff --git a/L2J_Server/java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java b/L2J_Server/java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java
index 508f0d1..e7dd73a 100644
--- a/L2J_Server/java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java
+++ b/L2J_Server/java/com/l2jserver/gameserver/model/olympiad/OlympiadManager.java
@@ -535,7 +535,7 @@
return false;
}
- if ((Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP > 0) && !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.OLYMPIAD_ID, noble, Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP))
+ if (!AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.OLYMPIAD_ID, noble, Config.L2JMOD_DUALBOX_CHECK_MAX_OLYMPIAD_PARTICIPANTS_PER_IP))
{
final NpcHtmlMessage message = new NpcHtmlMessage(player.getLastHtmlActionOriginId());
message.setFile(player.getHtmlPrefix(), "data/html/mods/OlympiadIPRestriction.htm");
diff --git a/L2J_Server/java/com/l2jserver/gameserver/network/L2GameClient.java b/L2J_Server/java/com/l2jserver/gameserver/network/L2GameClient.java
index 83c9f64..b96268f 100644
--- a/L2J_Server/java/com/l2jserver/gameserver/network/L2GameClient.java
+++ b/L2J_Server/java/com/l2jserver/gameserver/network/L2GameClient.java
@@ -779,6 +779,7 @@
{
getActiveChar().leaveParty();
OlympiadManager.getInstance().unRegisterNoble(getActiveChar());
+ AntiFeedManager.getInstance().onDisconnect(L2GameClient.this);
// If the L2PcInstance has Pet, unsummon it
if (getActiveChar().hasSummon())
diff --git a/L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/CharacterSelect.java b/L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/CharacterSelect.java
index 51736c0..2b22259 100644
--- a/L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/CharacterSelect.java
+++ b/L2J_Server/java/com/l2jserver/gameserver/network/clientpackets/CharacterSelect.java
@@ -118,7 +118,7 @@
return;
}
- if ((Config.L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP > 0) && !AntiFeedManager.getInstance().tryAddClient(AntiFeedManager.GAME_ID, client, Config.L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP))
+ if (!AntiFeedManager.getInstance().tryAddClient(AntiFeedManager.GAME_ID, client, Config.L2JMOD_DUALBOX_CHECK_MAX_PLAYERS_PER_IP))
{
final NpcHtmlMessage msg = new NpcHtmlMessage();
msg.setFile(info.getHtmlPrefix(), "data/html/mods/IPRestriction.htm");
diff --git a/L2J_DataPack/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java b/L2J_DataPack/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java
index 0567e0f..1aa5ff9 100644
--- a/L2J_DataPack/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java
+++ b/L2J_DataPack/dist/game/data/scripts/custom/events/TvT/TvTManager/TvTManager.java
@@ -96,7 +96,7 @@
htmltext = getHtm(player.getHtmlPrefix(), "TeamsFull.html");
htmltext = htmltext.replaceAll("%max%", String.valueOf(Config.TVT_EVENT_MAX_PLAYERS_IN_TEAMS));
}
- else if ((Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP > 0) && !AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.TVT_ID, player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP))
+ else if (!AntiFeedManager.getInstance().tryAddPlayer(AntiFeedManager.TVT_ID, player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP))
{
htmltext = getHtm(player.getHtmlPrefix(), "IPRestriction.html");
htmltext = htmltext.replaceAll("%max%", String.valueOf(AntiFeedManager.getInstance().getLimit(player, Config.TVT_EVENT_MAX_PARTICIPANTS_PER_IP)));
view raw gistfile1.diff hosted with ❤ by GitHub
Powered by Eclipse 4.34 🌌 | Eclipse Temurin 21 ☕ | MariaDB 11.3.2 🗃️ | L2J Server 2.6.3.0 - High Five 🚀

🔗 Join our Discord! 🎮💬
HanNaGamSa
Posts: 22
Joined: Mon Jun 09, 2014 4:55 pm

Re: Dualbox and offline traders

Post by HanNaGamSa »

Thank you very much! Im gonna try it!
Post Reply