Jump to content

Question

Posted

Dunno if that one is shared its for acis 370 i found that on a br ? website  its antifeed pvp protection
unfortunately it works exept this part 

+# If character died faster than timeout - pvp/pk points for killer will not increase
+# and clan reputation will not be transferred
+AntiFeedInterval = 120

 

any thoughts ?

*code inside Spoiler*

Spoiler

### Eclipse Workspace Patch 1.0
#P aCis_gameserver
Index: java/net/sf/l2j/gameserver/GameServer.java
===================================================================
--- java/net/sf/l2j/gameserver/GameServer.java (revision 13)
+++ java/net/sf/l2j/gameserver/GameServer.java (working copy)
@@ -81,6 +81,7 @@
 import net.sf.l2j.gameserver.instancemanager.SevenSignsFestival;
 import net.sf.l2j.gameserver.instancemanager.ZoneManager;
 import net.sf.l2j.gameserver.instancemanager.games.MonsterRace;
+import net.sf.l2j.gameserver.instancemanager.AntiFeedManager;
 import net.sf.l2j.gameserver.model.World;
 import net.sf.l2j.gameserver.model.entity.Hero;
 import net.sf.l2j.gameserver.model.olympiad.Olympiad;
@@ -257,7 +258,10 @@
 
  StringUtil.printSection("Four Sepulchers");
  FourSepulchersManager.getInstance().init();
-
+ //ANTIFEED MANAGER
+ StringUtil.printSection("AntiFeedManager");
+        AntiFeedManager.getInstance().registerEvent(AntiFeedManager.GAME_ID);
+       
  StringUtil.printSection("Quests & Scripts");
  ScriptManager.getInstance();
 
Index: java/net/sf/l2j/Config.java
===================================================================
--- java/net/sf/l2j/Config.java (revision 12)
+++ java/net/sf/l2j/Config.java (working copy)
@@ -465,6 +465,12 @@
  public static boolean STORE_SKILL_COOLTIME;
  public static int MAX_BUFFS_AMOUNT;
 
+ /** AntiFeed Protection by Thug */
+ public static boolean ANTIFEED_ENABLE;
+ public static boolean ANTIFEED_DUALBOX;
+ public static boolean ANTIFEED_DISCONNECTED_AS_DUALBOX;
+ public static int ANTIFEED_INTERVAL;
+
  /** Instance */
  public static int INSTANCE_FINISH_TIME;
  public static boolean RESTORE_PLAYER_INSTANCE;
@@ -1167,6 +1173,11 @@
 
  MAX_BUFFS_AMOUNT = players.getProperty("MaxBuffsAmount", 20);
  STORE_SKILL_COOLTIME = players.getProperty("StoreSkillCooltime", true);
+ //ANTIFEED MANAGER
+ ANTIFEED_ENABLE = players.getProperty("AntiFeedEnable", false);
+ ANTIFEED_DUALBOX = players.getProperty("AntiFeedDualbox", true);
+ ANTIFEED_DISCONNECTED_AS_DUALBOX = players.getProperty("AntiFeedDisconnectedAsDualbox", true);
+ ANTIFEED_INTERVAL = players.getProperty("AntiFeedInterval", 120) * 1000;
 
  INSTANCE_FINISH_TIME = players.getProperty("DefaultFinishTime", 300) * 1000;
  RESTORE_PLAYER_INSTANCE = players.getProperty("RestorePlayerInstance", false);
Index: java/net/sf/l2j/gameserver/instancemanager/AntiFeedManager.java
===================================================================
--- java/net/sf/l2j/gameserver/instancemanager/AntiFeedManager.java (nonexistent)
+++ java/net/sf/l2j/gameserver/instancemanager/AntiFeedManager.java (working copy)
@@ -0,0 +1,218 @@
+/*
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later
+ * version.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package net.sf.l2j.gameserver.instancemanager;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import net.sf.l2j.Config;
+import net.sf.l2j.commons.concurrent.ThreadPool;
+import net.sf.l2j.gameserver.model.actor.Creature;
+import net.sf.l2j.gameserver.model.actor.instance.Player;
+import net.sf.l2j.gameserver.network.L2GameClient;
+
+/**
+ * @author Thug
+ *
+ */
+public final class AntiFeedManager
+{
+       public static final int GAME_ID = 0;
+     
+       final Map<Integer, Long> _lastDeathTimes = new ConcurrentHashMap<>();
+       private final Map<Integer, Map<Integer, AtomicInteger>> _eventIPs = new ConcurrentHashMap<>();
+     
+       protected AntiFeedManager()
+       {
+       }
+     
+       /**
+        * Set time of the last player's death to current
+        * @param objectId Player's objectId
+        */
+       public final void setLastDeathTime(int objectId)
+       {
+               _lastDeathTimes.put(objectId, System.currentTimeMillis());
+               ThreadPool.schedule(new DeleteDeathTime(objectId), 120000);
+       }
+     
+       private class DeleteDeathTime implements Runnable
+       {
+               int id;
+               public DeleteDeathTime(int objectId)
+               {
+                       id = objectId;
+               }
+             
+               @Override
+               public void run()
+               {
+                       _lastDeathTimes.remove(id);
+               }
+       }
+     
+       /**
+        * Check if current kill should be counted as non-feeded.
+        * @param attacker Attacker character
+        * @param target Target character
+        * @return True if kill is non-feeded.
+        */
+       public final boolean check(Creature attacker, Creature target)
+       {
+               if (!Config.ANTIFEED_ENABLE)
+               {
+                       return true;
+               }
+             
+               if (target == null)
+               {
+                       return false;
+               }
+             
+               final Player targetPlayer = target.getActingPlayer();
+               if (targetPlayer == null)
+               {
+                       return false;
+               }
+             
+               if ((Config.ANTIFEED_INTERVAL > 0) && _lastDeathTimes.containsKey(targetPlayer.getObjectId()))
+               {
+                       if ((System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) < Config.ANTIFEED_INTERVAL)
+                       {
+                               return false;
+                       }
+               }
+             
+               if (Config.ANTIFEED_DUALBOX && (attacker != null))
+               {
+                       final Player attackerPlayer = attacker.getActingPlayer();
+                       if (attackerPlayer == null)
+                       {
+                               return false;
+                       }
+                     
+                       final L2GameClient targetClient = targetPlayer.getClient();
+                       final L2GameClient attackerClient = attackerPlayer.getClient();
+                       if ((targetClient == null) || (attackerClient == null) || targetClient.isDetached() || attackerClient.isDetached())
+                       {
+                               return !Config.ANTIFEED_DISCONNECTED_AS_DUALBOX;
+                       }
+                     
+                       return !targetClient.getConnection().getInetAddress().equals(attackerClient.getConnection().getInetAddress());
+               }
+             
+               return true;
+       }
+     
+       /**
+        * Clears all timestamps
+        */
+       public final void clear()
+       {
+               _lastDeathTimes.clear();
+       }
+     
+       /**
+        * Register new event for dualbox check. Should be called only once.
+        * @param eventId
+        */
+       public final void registerEvent(int eventId)
+       {
+               _eventIPs.putIfAbsent(eventId, new ConcurrentHashMap<Integer, AtomicInteger>());
+       }
+             
+       /**
+        * Decreasing number of active connection from player's IP address
+        * @param eventId
+        * @param player
+        * @return true if success and false if any problem detected.
+        */
+       public final boolean removePlayer(int eventId, Player player)
+       {
+               return removeClient(eventId, player.getClient());
+       }
+     
+       /**
+        * Decreasing number of active connection from player's IP address
+        * @param eventId
+        * @param client
+        * @return true if success and false if any problem detected.
+        */
+       public final boolean removeClient(int eventId, L2GameClient client)
+       {
+               if (client == null)
+               {
+                       return false; // unable to determine IP address
+               }
+             
+               final Map<Integer, AtomicInteger> event = _eventIPs.get(eventId);
+               if (event == null)
+               {
+                       return false; // no such event registered
+               }
+             
+               final Integer addrHash = Integer.valueOf(client.getConnection().getInetAddress().hashCode());
+             
+               return event.computeIfPresent(addrHash, (k, v) ->
+               {
+                       if ((v == null) || (v.decrementAndGet() == 0))
+                       {
+                               return null;
+                       }
+                       return v;
+               }) != null;
+       }
+     
+       /**
+        * Remove player connection IP address from all registered events lists.
+        * @param client
+        */
+       public final void onDisconnect(L2GameClient client)
+       {
+               if (client == null)
+               {
+                       return;
+               }
+             
+               _eventIPs.forEach((k, v) ->
+               {
+                       removeClient(k, client);
+               });
+       }
+     
+       /**
+        * Clear all entries for this eventId.
+        * @param eventId
+        */
+       public final void clear(int eventId)
+       {
+               final Map<Integer, AtomicInteger> event = _eventIPs.get(eventId);
+               if (event != null)
+               {
+                       event.clear();
+               }
+       }
+             
+       public static final AntiFeedManager getInstance()
+       {
+               return SingletonHolder._instance;
+       }
+     
+       private static class SingletonHolder
+       {
+               protected static final AntiFeedManager _instance = new AntiFeedManager();
+       }
+}
\ No newline at end of file
Index: java/net/sf/l2j/gameserver/model/actor/instance/Player.java
===================================================================
--- java/net/sf/l2j/gameserver/model/actor/instance/Player.java (revision 16)
+++ java/net/sf/l2j/gameserver/model/actor/instance/Player.java (working copy)
@@ -24,9 +24,11 @@
 
 import erengine.ErPlayerBonuses;
 import erengine.ErUtils;
+
 import net.sf.l2j.commons.concurrent.ThreadPool;
 import net.sf.l2j.commons.math.MathUtil;
 import net.sf.l2j.commons.random.Rnd;
+
 import museum.MuseumPlayer;
 
 import net.sf.l2j.Config;
@@ -50,6 +52,7 @@
 import net.sf.l2j.gameserver.handler.IItemHandler;
 import net.sf.l2j.gameserver.handler.ItemHandler;
 import net.sf.l2j.gameserver.handler.admincommandhandlers.AdminEditChar;
+import net.sf.l2j.gameserver.instancemanager.AntiFeedManager;
 import net.sf.l2j.gameserver.instancemanager.CastleManager;
 import net.sf.l2j.gameserver.instancemanager.CoupleManager;
 import net.sf.l2j.gameserver.instancemanager.CursedWeaponsManager;
@@ -246,6 +249,7 @@
 import net.sf.l2j.gameserver.templates.skills.L2EffectType;
 import net.sf.l2j.gameserver.templates.skills.L2SkillType;
 import net.sf.l2j.gameserver.util.Broadcast;
+
 import vote.VotingPlayer;
 
 /**
@@ -3964,7 +3964,8 @@
{
// PK Points are increased only if you kill a player.
//erlandys museum
- if (target instanceof Player) {
+ if (target instanceof Player && AntiFeedManager.getInstance().check(this, target))
+ {
setPkKills(getPkKills() + 1);
//erlandys museum
((Player) target).getMuseumPlayer().addData("pk_defeats", 1);
@@ -3721,12 +3725,15 @@
  // if clans got mutual war, then use the reputation calcul
  if (_clan.isAtWarWith(pk.getClanId()) && pk.getClan().isAtWarWith(_clan.getClanId()))
  {
- // when your reputation score is 0 or below, the other clan cannot acquire any reputation points
- if (getClan().getReputationScore() > 0)
- pk.getClan().addReputationScore(1);
- // when the opposing sides reputation score is 0 or below, your clans reputation score doesn't decrease
- if (pk.getClan().getReputationScore() > 0)
- _clan.takeReputationScore(1);
+                                                                if (AntiFeedManager.getInstance().check(killer, this))
+                                                                {
+                                                                        // when your reputation score is 0 or below, the other clan cannot acquire any reputation points
+                                                                        if (getClan().getReputationScore() > 0)
+                                                                                pk.getClan().addReputationScore(1);
+                                                                        // when the opposing sides reputation score is 0 or below, your clans reputation score doesn't decrease
+                                                                        if (pk.getClan().getReputationScore() > 0)
+                                                                                _clan.takeReputationScore(1);
+                                                                }
  }
  }
  }
Index: config/players.properties
===================================================================
--- config/players.properties (revision 12)
+++ config/players.properties (working copy)
@@ -284,4 +284,23 @@
 # When a player dies, is removed from instance after a fixed period of time.
 # Time in seconds.
 # Default: 60
-EjectDeadPlayerTime = 60
\ No newline at end of file
+EjectDeadPlayerTime = 60
+
+# ================================================================
+#                        Anti feed protection
+# ================================================================
+
+# This option will enable antifeed for pvp/pk/clanrep points
+AntiFeedEnable = True
+
+# If set to True, kills from dualbox will not increase pvp/pk points
+# and clan reputation will not be transferred
+AntiFeedDualbox = False
+
+# If set to True, server will count disconnected (unable to determine ip address)
+# as dualbox
+AntiFeedDisconnectedAsDualbox = False
+
+# If character died faster than timeout - pvp/pk points for killer will not increase
+# and clan reputation will not be transferred
+AntiFeedInterval = 120
\ No newline at end of file

 

3 answers to this question

Recommended Posts

Guest
This topic is now closed to further replies.


  • Posts

    • Please note:i will provide you with forum address for registration once buyer sends money(my commission) to forum guarantor's payment details. You can register on forum in any day and in any time,which are convenient for you,send code word in private message to forum guarantor(you will receive code word from buyer). If buyer does not purchase your product,you will need to wait private message(answer) from forum guarantor to compare code word. I will invite you in "forum deal". I will add your name,which you registered on forum,in "forum deal". Then you write in "forum deal": "buyer did not purchase product" and add code word(you will have this right according to clause in forum questionnaire). Forum guarantor will refund buyer((in full amount). If buyer purchases your product,buyer notifies forum guarantor and forum guarantor will send money to my payment details.   Sports exercise machines,jacuzzi,building materials,cosmetics,perfumes,shoes,clothing,furniture,bags,televisions,music centers,telephones,laptops,tablet computers,refrigerators,washing machines,microwaves,fans.  
    • Here is a L2JMobius Classic Interlude FULL server. The share includes full server source+datapack, patch, interface and the P110 client. The original build is L2JMobius. However it was bought from a user called "ClassicLude (https://classic-lude.org/)" which is also a huge scammer, selling free Mobius files for $500. I could not believe someone actually bought this, yet here we are.    Unfortunately the admin is a scammer and refused to pay his remaining balance of over $150 to me since he is too busy "working for Bill Gates" and opening the next big mega mall in ChatGPT city therefore not having enough money. The server itself garnered a massive 30 players so I can't really tell you if this is usable. Knowing its backstory and that it is Mobius based i can surmise that it is NOT suitable for serious users. This build is the result of typical AI slop and vibecode "admins" thinking they just "one shotted L2J" because they discovered how to prompt an agent.   I have made the following changes, some of which were regrettably butchered by the admin after he discovered how to download Cursor. Not much more was done due to the absolute displeasure and misery of having to work on a Mobius server.   - Updated files to JDK 22 - Added l2 reborn community board - Added preview system for skins including mounts/agathions - Added AIO npc (buffer/store/teleporter) - Added QuickVar system - Added Ranking system (pvp/pk/online/level and moar) - Added raid boss list on community board - Added drop search+shift click with itemtooltip on community board and npc - Added l2 reborn styled flash windows and window borders and L2UI_CT1 - Added custom donate coin icon in the store swf - Fixed some random bugs like Hot Springs monsters not giving the disease     Links Source+Datapack: https://drive.google.com/file/d/1uMaTzSxKtnLxXC-VoZyHYW_OXq7Oof5L/view?usp=sharing Interface+Compiler+Client tools: https://drive.google.com/file/d/14IJWyYSDOjMycHnJ749H9dRXuv2JeYK3/view?usp=sharing Full Client: https://drive.google.com/file/d/1P7Yd9wI0XcWlLMFDPSdfTZgWhW_9JEii/view?usp=sharing
    • I logged in with this system, maybe its the patch shared by greenhope i don't remember i just downloaded it because i love C3 but no l2j or l2off c3 is good everything is buggy and this one too, also it has no geodata and i don't know if it has geoengine because i didn't see the config for it in the config folder. If someone had the latest l2jvn maybe it could be more stable but i don't think so at least without the source, if someone has it to share it that would be good  https://www.mediafire.com/file/mzodnsyi9qn4ap7/patch+560+for+c3.rar/file
    • We are certainly not an ambulance, but we will definitely cure you of blacklists and empty pockets. Live freely with SX! Each of you will receive a trial version of SX to familiarize yourself with the product, all you have to do is post in this thread
  • Topics

×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..