Jump to content
  • 0

Anti Feed Manager Bug


Question

Posted (edited)

I add this code on my config:

 

# ================================================================
#                        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
 
In dual box i try and pvp not work so i don't give pvp point but at pk is the bug when i make pk in dual box i take pk point.
So where is the problem?
Please help me.
Edited by IoNuTzU01

9 answers to this question

Recommended Posts

  • 0
Posted

Please, tell me that you only add that text to the config and you expected it to work just like that, please, tell me you did that so I can laugh a lot.

  • 0
Posted (edited)

Please, tell me that you only add that text to the config and you expected it to work just like that, please, tell me you did that so I can laugh a lot.

I don't add only this text in my config i add completly code and work perfect... but only pk have bug i say not and pvp

Edited by IoNuTzU01
  • 0
Posted

Give us your code...We can fix it...Configs are useless :P

Ok i will give now :

 

public class AntiFeedManager
{
public static final int GAME_ID = 0;
 
final Map<Integer,Long> _lastDeathTimes;
 
private final TIntObjectHashMap<Map<Integer, Connections>> _eventIPs;
 
public static final AntiFeedManager getInstance()
{
return SingletonHolder._instance;
}
 
protected AntiFeedManager()
{
_lastDeathTimes = new ConcurrentHashMap<>();
_eventIPs = new TIntObjectHashMap<>();
}
 
/**
* 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());
ThreadPoolManager.getInstance().scheduleGeneral(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(L2Character attacker, L2Character target)
{
if (!Config.ANTIFEED_ENABLE)
return true;
 
if (target == null)
return false;
 
final L2PcInstance targetPlayer = target.getActingPlayer();
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 = 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())
// 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();
}
 
/**
* Register new event for dualbox check.
* Should be called only once.
* @param eventId
*/
public final void registerEvent(int eventId)
{
if (!_eventIPs.containsKey(eventId))
_eventIPs.put(eventId, new HashMap<Integer, Connections>());
}
 
/**
* 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, L2PcInstance player)
{
final L2GameClient client = player.getClient();
if (client == null)
return false; // unable to determine IP address
 
final Map<Integer, Connections> event = _eventIPs.get(eventId);
if (event == null)
return false; // no such event registered
 
final Integer addrHash = Integer.valueOf(client.getConnection().getInetAddress().hashCode());
Connections conns = event.get(addrHash);
if (conns == null)
return false; // address not registered
 
synchronized (event)
{
if (conns.testAndDecrement())
event.remove(addrHash);
}
 
return true;
}
 
/**
* Remove player connection IP address from all registered events lists.
* @param client
*/
public final void onDisconnect(L2GameClient client)
{
if (client == null)
return;
 
final Integer addrHash = Integer.valueOf(client.getConnection().getInetAddress().hashCode());
_eventIPs.forEachValue(new DisconnectProcedure(addrHash));
}
 
/**
* Clear all entries for this eventId.
* @param eventId
*/
public final void clear(int eventId)
{
final Map<Integer, Connections> event = _eventIPs.get(eventId);
if (event != null)
event.clear();
}
 
protected static final class Connections
{
private int _num = 0;
 
/**
* and false if maximum number is reached.
* @param max 
* @return true if successfully incremented number of connections
*/
public final synchronized boolean testAndIncrement(int max)
{
if (_num < max)
{
_num++;
return true;
}
return false;
}
 
/**
* @return true if all connections are removed
*/
public final synchronized boolean testAndDecrement()
{
if (_num > 0)
_num--;
 
return _num == 0;
}
}
 
private static final class DisconnectProcedure implements TObjectProcedure<Map<Integer, Connections>>
{
private final Integer _addrHash;
 
public DisconnectProcedure(Integer addrHash)
{
_addrHash = addrHash;
}
  • 0
Posted (edited)

Most likely it's actual version(?) of l2jserver, if it's outdated, use the recent one.

 

You should post L2PcInstance changes you did. Gods know what pack you are using and pvp/pk could be separated for 2 methods, so you must add the check in both places.

 

I guess, that's your case.

Edited by SweeTs
  • 0
Posted

Next time post the part which I ask, not the whole file.. :okey: As I said, the check if only made for the pvp case, so DO THE SAME for pk check.

  • 0
Posted (edited)

Change line L2PcInstance 4314 from

 if (target instanceof L2PcInstance)

to:

  if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target))

I think it will work...

Edited by Solomun
  • 0
Posted

Change line L2PcInstance 4314 from

 if (target instanceof L2PcInstance)

to:

  if (target instanceof L2PcInstance && AntiFeedManager.getInstance().check(this, target))

I think it will work...

I try and is same..

Pvp no bug,no reward pvp point.

Pk bug in dual box work reward pk point.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Posts

    • Hi everyone,   In 2014, I completely stepped away from developing L2 servers and doing L2J-related work. Since then, I’ve only opened this server about once a year and helped a few servers and individuals for free. I haven’t taken on any paid L2J work since then.   LINEAGE2.GOLD is a project that has reached about Season 6. The first season launched at the end of 2020 and was a fully rebuilt Gold-style server on the Classic client (protocol 110). It featured many custom systems and enhancements. After several seasons, I decided to abandon the Mobius-based project and move to Lucera, as my goal was to get as close as possible to Interlude PTS behavior while still staying on the L2J platform.   The current project was once again completely rebuilt, this time on the Essence client (protocol 306), and is based on Lucera. Because of that, acquiring a license from Deazer is required.   My Lucera extender includes, but is not limited to: Formulas.java Basic anti-bot detection, which proved quite effective, we caught most Adrenaline users using relatively simple server-side logic, logged them, and took staff action. Simple admin account lookup commands based on IP, HWID, and similar identifiers. In-game Captcha via https://lineage2.gold/code, protected by Cloudflare, including admin commands for blacklisting based on aggression levels and whitelisting. Additional admin tools such as Auto-Play status checks, Enchanted Hero Weapon live sync, force add/remove clans from castle sieges, item listeners for live item monitoring, and more. A fully rewritten Auto-Play system with support for ExAutoPlaySetting, while still using the Auto-Play UI wheel, featuring: Debuff Efficiency Party Leader Assist Respectful Hunting Healer AI Target Mode Range Mode Summoner buff support Dwarf mechanics Reworked EffectDispelEffects to restore buffs after Cancellation. Raid Bomb item support. Reworked CronZoneSwitcher. Prime Time Raid Respawn Service. Community Board features such as Top rankings and RB/Epic status. Custom systems for Noblesse, Subclasses, support-class rewards, and much more.   Depending on the deal, the project can include: The lineage2.gold domain The website built on the Laravel PHP framework The server’s Discord Client Interface source Server files and extender source The server database (excluding private data such as emails and passwords)   I’m primarily looking for a serious team to continue the project, as it would be a shame to see this work abandoned. This is not cheap. You can DM me with offers. If you’re wondering why I’m doing this: I’ve felt a clear lack of appreciation from the L2 community, and I’m not interested in doing charity work for people who don’t deserve it. I’m simply not someone who tolerates BS. Server Info: https://lineage2.gold/info Server for test: https://lineage2.gold/download Over 110 videos YouTube playlist: https://www.youtube.com/watch?v=HO7BZaxUv2U&list=PLD9WZ0Nj-zstZaYeWxAxTKbX7ia2M_DUu&index=113
  • 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..

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock