Jump to content

Question

6 answers to this question

Recommended Posts

  • 0
Posted


Index: java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java

===================================================================

--- java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (revision 174)

+++ java/net/sf/l2j/gameserver/model/actor/instance/L2PcInstance.java (working copy)

@@ -74,6 +74,7 @@

import net.sf.l2j.gameserver.handler.skillhandlers.SiegeFlag;

import net.sf.l2j.gameserver.handler.skillhandlers.StrSiegeAssault;

import net.sf.l2j.gameserver.handler.skillhandlers.TakeCastle;

+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;

@@ -4415,7 +4416,9 @@

&& _clan.isAtWarWith(((L2PcInstance) killer).getClanId())

&& ((L2PcInstance)killer).getClan().isAtWarWith(_clan.getClanId()))

{

- if (getClan().getReputationScore() > 0) // when your reputation score is 0 or below, the other clan cannot acquire any reputation points

+ if (AntiFeedManager.getInstance().check(killer, this))

+ {

+ if (getClan().getReputationScore() > 0) // when your reputation score is 0 or below, the other clan cannot acquire any reputation points

((L2PcInstance) killer).getClan().setReputationScore(((L2PcInstance) killer).getClan().getReputationScore()+2, true);

if (((L2PcInstance)killer).getClan().getReputationScore() > 0) // when the opposing sides reputation score is 0 or below, your clans reputation score does not decrease

_clan.setReputationScore(_clan.getReputationScore()-2, true);

@@ -4434,6 +4437,7 @@

}

}

}

+ }

 

setPvpFlag(0); // Clear the pvp flag

 

@@ -4464,8 +4468,10 @@

calculateDeathPenaltyBuffLevel(killer);

 

stopRentPet();

- stopWaterTask();

+ stopWaterTask();

 

+ AntiFeedManager.getInstance().setLastDeathTime(getObjectId());

+

if (quakeSystem == 1)

{

quakeSystem = 0;

@@ -4628,7 +4634,7 @@

)

{

if (target instanceof L2PcInstance)

- increasePvpKills();

+ increasePvpKills(target);

}

else // Target player doesn't have pvp flag set

{

@@ -4641,7 +4647,7 @@

{

// 'Both way war' -> 'PvP Kill'

if (target instanceof L2PcInstance)

- increasePvpKills();

+ increasePvpKills(target);

return;

}

}

@@ -4653,12 +4659,12 @@

if ( Config.KARMA_AWARD_PK_KILL )

{

if (target instanceof L2PcInstance)

- increasePvpKills();

+ increasePvpKills(target);

}

}

else if (targetPlayer.getPvpFlag() == 0) // Target player doesn't have karma

{

- increasePkKillsAndKarma(targetPlayer.getLevel());

+ increasePkKillsAndKarma(target);

}

}

}

@@ -4667,8 +4673,12 @@

* Increase the pvp kills count and send the info to the player

*

*/

- public void increasePvpKills()

+ public void increasePvpKills(L2Character target)

{

+ if (target instanceof L2PcInstance

+ && AntiFeedManager.getInstance().check(this, target))

+ {

+

// Add karma to attacker and increase its PK counter

setPvpKills(getPvpKills() + 1);

 

@@ -4731,6 +4741,7 @@

// Send a Server->Client UserInfo packet to attacker with its Karma and PK Counter

sendPacket(new UserInfo(this));

}

+ }

 

/**

* Get info on pk's from pk table

@@ -4831,7 +4842,7 @@

*

* @param targLVL : level of the killed player

*/

- public void increasePkKillsAndKarma(int targLVL)

+ public void increasePkKillsAndKarma(L2Character target)

{

int baseKarma = Config.KARMA_MIN_KARMA;

int newKarma = baseKarma;

@@ -4839,6 +4850,8 @@

 

int pkLVL = getLevel();

int pkPKCount = getPkKills();

+

+ int targLVL = target.getLevel();

 

int lvlDiffMulti = 0;

int pkCountMulti = 0;

@@ -4871,6 +4884,8 @@

 

// Add karma to attacker and increase its PK counter

setPkKills(getPkKills() + 1);

+ if (target instanceof L2PcInstance

+ && AntiFeedManager.getInstance().check(this, target))

setKarma(getKarma() + newKarma);

 

//Update the character's title color if they reached any of the 5 PK levels.

Index: java/net/sf/l2j/Config.java

===================================================================

--- java/net/sf/l2j/Config.java (revision 173)

+++ java/net/sf/l2j/Config.java (working copy)

@@ -913,6 +913,10 @@

public static boolean AWAY_PEACE_ZONE;

public static boolean ANNOUNCE_CASTLE_LORDS;

public static int MAX_PLAYERS_FROM_ONE_PC;

+ public static boolean ANTIFEED_ENABLE;

+ public static boolean ANTIFEED_DUALBOX;

+ public static boolean ANTIFEED_DISCONNECTED_AS_DUALBOX;

+ public static int ANTIFEED_INTERVAL;

/** Overdose Mods - End */

 

/** Overdose Events - Start */

@@ -2142,6 +2146,10 @@

AWAY_PEACE_ZONE = Boolean.parseBoolean(OverdoseModsSettings.getProperty("AwayOnlyInPeaceZone", "False"));

ANNOUNCE_CASTLE_LORDS = Boolean.parseBoolean(OverdoseModsSettings.getProperty("AnnounceCastleLors", "False"));

MAX_PLAYERS_FROM_ONE_PC = Integer.parseInt(OverdoseModsSettings.getProperty("MultiboxesPerPC", "2"));

+ ANTIFEED_ENABLE = Boolean.parseBoolean(OverdoseModsSettings.getProperty("AntiFeedEnable", "false"));

+ ANTIFEED_DUALBOX = Boolean.parseBoolean(OverdoseModsSettings.getProperty("AntiFeedDualbox", "true"));

+ ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(OverdoseModsSettings.getProperty("AntiFeedDisconnectedAsDualbox", "true"));

+ ANTIFEED_INTERVAL = 1000*Integer.parseInt(OverdoseModsSettings.getProperty("AntiFeedInterval", "120"));

 

}

catch (Exception e)

@@ -2822,6 +2830,10 @@

 

else if (pName.equalsIgnoreCase("MultiBoxesPerPC")) MAX_PLAYERS_FROM_ONE_PC = Integer.parseInt(pValue);

+ else if (pName.equalsIgnoreCase("AntiFeedEnable")) ANTIFEED_ENABLE = Boolean.parseBoolean(pValue);

+ else if (pName.equalsIgnoreCase("AntiFeedDualbox")) ANTIFEED_DUALBOX = Boolean.parseBoolean(pValue);

+ else if (pName.equalsIgnoreCase("AntiFeedDisconnectedAsDualbox")) ANTIFEED_DISCONNECTED_AS_DUALBOX = Boolean.parseBoolean(pValue);

+ else if (pName.equalsIgnoreCase("AntiFeedInterval")) ANTIFEED_INTERVAL = 1000*Integer.parseInt(pValue);

 

// PvP settings

else if (pName.equalsIgnoreCase("MinKarma")) KARMA_MIN_KARMA = Integer.parseInt(pValue);

Index: config/overdose_mods.properties

===================================================================

--- config/overdose_mods.properties (revision 173)

+++ config/overdose_mods.properties (working copy)

@@ -198,4 +198,27 @@

# MultiBox Protection -

# -------------------------------------------------------------

# Multibox protection based on client tracert comparison

-MultiBoxesPerPC = 2

\ No newline at end of file

+MultiBoxesPerPC = 2

+

+# -------------------------------------------------------------

+# AntiFeed -

+# -------------------------------------------------------------

+# This option will enable antifeed for pvp/pk/clanrep points.

+# Default: False

+AntiFeedEnable = False

+

+# If set to True, kills from dualbox will not increase pvp/pk points

+# and clan reputation will not be transferred.

+# Default: True

+AntiFeedDualbox = True

+

+# If set to True, server will count disconnected (unable to determine ip address)

+# as dualbox.

+# Default: True

+AntiFeedDisconnectedAsDualbox = True

+

+# If character died faster than timeout - pvp/pk points for killer will not increase

+# and clan reputation will not be transferred.

+# Setting to 0 will disable this feature.

+# Default: 120 seconds.

+AntiFeedInterval = 120

\ No newline at end of file

Index: java/net/sf/l2j/gameserver/instancemanager/AntiFeedManager.java

===================================================================

--- java/net/sf/l2j/gameserver/instancemanager/AntiFeedManager.java (revision 0)

+++ java/net/sf/l2j/gameserver/instancemanager/AntiFeedManager.java (revision 0)

@@ -0,0 +1,104 @@

+/*

+ * 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 javolution.util.FastMap;

+import net.sf.l2j.Config;

+import net.sf.l2j.gameserver.model.L2Character;

+import net.sf.l2j.gameserver.model.actor.instance.L2PcInstance;

+import net.sf.l2j.gameserver.network.L2GameClient;

+

+public class AntiFeedManager

+{

+ private Map<Integer,Long> _lastDeathTimes;

+

+ public static final AntiFeedManager getInstance()

+ {

+ return SingletonHolder._instance;

+ }

+

+ private AntiFeedManager()

+ {

+ _lastDeathTimes = new FastMap<Integer,Long>().setShared(true);

+ }

+

+ /**

+ * 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());

+ }

+

+ /**

+ * 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(L2Character attacker, L2Character target)

+ {

+ if (!Config.ANTIFEED_ENABLE)

+ return true;

+

+ if (target == null)

+ return false;

+

+ final L2PcInstance targetPlayer = null;

+ if (targetPlayer == null)

+ return false;

+

+ if (Config.ANTIFEED_INTERVAL > 0

+ && _lastDeathTimes.containsKey(targetPlayer.getObjectId()))

+ return (System.currentTimeMillis() - _lastDeathTimes.get(targetPlayer.getObjectId())) > Config.ANTIFEED_INTERVAL;

+

+ if (Config.ANTIFEED_DUALBOX && attacker != null)

+ {

+ final L2PcInstance attackerPlayer = null;

+ if (attackerPlayer == null)

+ return false;

+

+ final L2GameClient targetClient = targetPlayer.getClient();

+ final L2GameClient attackerClient = attackerPlayer.getClient();

+ if (targetClient == null

+ || attackerClient == null

+ || targetClient.isDetached()

+ || attackerClient.isDetached())

+ // unable to check ip address

+ 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();

+ }

+

+ @SuppressWarnings("synthetic-access")

+ private static class SingletonHolder

+ {

+ protected static final AntiFeedManager _instance = new AntiFeedManager();

+ }

+}

\ No newline at end of file

 

  • 0
Posted

    [javac] warning: [options] bootstrap class path not set in conjunction with -source 1.7
    [javac] Note: C:\workspace3\L2jFrozenInterlude\branches\Beta\gameserver\head-src\com\l2jfrozen\gameserver\managers\AntiFeedManager.java uses or overrides a deprecated API.
    [javac] Note: Recompile with -Xlint:deprecation for details.
    [javac] 1 warning

 

afto einai entaksi ???

Guest
This topic is now closed to further replies.


  • Posts

    • CLEAR BRIEF – ZERO SURPRISES The client requested an Illinois Driver License with custom data. Task – scannable front/back and photos suitable for upload. He provided data and portrait. Timeline agreed – 30+ minutes. Then everything followed engineering logic: – built the document for the specific state – checked structure and fields – prepared both sides – provided additional dark-background photos upon request No changing requirements. No “let’s redo it differently”. When the brief is clear – the case is controllable. When the process is disciplined – the result is predictable. Want the same smooth process without chaos and endless revisions? Message us – we’ll structure the task before it even starts. › TG: https://t.me/mustang_service ( https:// t.me/ mustang_service ) › Channel: https://t.me/+JPpJCETg-xM1NjNl ( https:// t.me/ +JPpJCETg-xM1NjNl ) #MustangService #verification #documents #case #antifraud #rendering
    • i know some things from java and eclipse about coding but for sure i take one programmer to make the hard work. thank you very much for your replying 🙂
    • Forum Post:   🛡️ L2Genesis Closed Beta — Test With Us, Launch With Exclusive Rewards Join the community: https://discord.gg/mcuHsQzNCm Website: https://l2genesis.com/ Join Beta: https://cbt.l2genesis.com/     Hey everyone, We're L2Genesis — an Interlude Classic server being built with one core belief: every player matters. Not just the top clans, not just the donators — everyone. We've spent months developing, refining, and listening to community feedback. Now we're opening up our Closed Beta and we need your help to make sure this server launches rock-solid. Registration is open for one week only — after that, the doors close. Every tester who puts in the work walks into launch day with exclusive rewards that won't be available again.     Why Genesis? We're not rushing to open doors and hope for the best. We're building a community-first server where player feedback directly shapes the final product. No pay-to-win, no shortcuts — just a clean Interlude experience with thoughtful quality-of-life improvements. If you've been burned by servers that promise the world and deliver a cash shop, this one's for you. What you can expect to see on our server: - x4 rate - Player buff trade shop - Crystallization shop - Arena mode for FUN PvP     Closed Beta Rewards Rewards are tied to real participation — no freebies for just showing up. 🥉 Tier 1 The test server runs at x100 rates with a gear shop, so you won't be grinding for days just to start testing. Requirements: Register, level to S-grade, complete 3rd profession, and join one of the organized beta clans.   Launch Rewards: - Exclusive "Genesis Start" Discord rank - Beta Box — unique hat (won't be available after launch) + big-head potions, fireworks & more   Optional: Participate in the Bug Hunt for additional rewards (details below). You will have one week from CBT server launch to complete Tier 1 🥇 Tier 2 Requirements: Complete Tier 1 + participate in at least 3 events like Clan Wars, Siege and others, they will be stated during CBT in Discord. Launch Rewards: - Everything from Tier 1 - 1 Month of VIP status — quality-of-life perks handed to you for free on day one     🐛 Bug Hunt — Bonus Rewards Throughout the beta we're running a Bug Hunt — find and report bugs to earn 1 Genesis Coin (donation currency) for every confirmed bug. We'll share full details and focus areas once you're in.     Get Involved This is your chance to shape a server before it launches, not complain about it after. The testers who show up now are the ones who'll feel the difference on day one — and they'll have the exclusive rewards to prove it. Sign Up for beta test and drop in to Discord, and let's build something worth logging into. Even if you're not ready to test but you're a veteran L2 player — join the community anyway. Your experience and perspective are worth a lot to us. See you in Aden.  
    • l2jlucera the source code is not public and is not for sale. If you're going to use L2jMobius or L2jAcis, you need to know how to program or have a basic understanding, and you can ask for help from a bot, which usually won't be 100% helpful. Or you can pay a programmer to do the work for you.  
    • You need for sure some knowledge to make a good start and dont get scammed.
  • 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..