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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Posts

    • If you're looking for high-performance residential proxies, try MoMoProxy—it's a reliable and top-tier solution in the proxy market. 📌 Need help or want to test? 💬 Live Support: https://t.me/momoproxy_com 📧 Email Us: support@momoproxy.com
    • interlude: l2acis uber alles
    • New Dragon-Network Server – Vote Now!   We’re launching a new Dragon-Network (Multiskill) server under a new domain, created by the original Classic-Interlude team. We no longer have access to the old domain, but this is the official continuation — not a scam, just a new home. The new domain will host: A main migrated server (nothing lost – all chars/items kept) Plus seasonal servers (voted by players) All seasonal progress will be merged into the main realm Help shape the new server – vote now: https://dragon-network.eu/   Let’s build the future of DN – together.
    • Hello there, Im beyond confused and dont know what path to take. I want to start working on a L2 server, changing some stuff here and there and finally in the future if  im happy with the results, to launch the server, but... L2j or L2off? After all this years, is there a Interlude L2j close to off?   Ive spent some time lookin over this forum, searching what would be better and what files to take but I ain't near to a clear answer.  Most of the time everyone is trowing stones at everyone, "your filles are trash, my filles are good" and viceversa. Therefore, Im reaching out to a knowledge guy, hopefully from a neutral position to all this drama, that can pin point me in a direction.    To explain what I want for a base start is an Interlude with a classic interface (features), low rate. Mostly what this guy TravorJ is describing in his post TravorJ post , and to do some reworks on it, ex: mobs drop, rethink the augment system/interface, rethink learning skills/enchant skills, create some custom potions/buff effects, siege mechanics... Is that possible on off files? or is better to go with L2j? I also want to mention that I have little to none L2 dev experince (13-15yrs ago I had an L2j server running  for a month where I made some basics changes), but I have coding background so Im used to that and more than willing to learn.   So in conclusion, I dont want to get some free shared files without any support, that I need to wrap my head around and fix stuff for long time to make them work, stuff thats already fixed buy someone else. Instead im looking to buy something thats more updated and start working from there. Question is what and from whom? Kinda sux when you go and buy something and u dont know what the hell are you buying (need some guidance here)   Is L2j Orion a good choice? I saw that is regularly updated. Lucera2 I dont think is something that I want cuz they dont sell soruce, prefer to have control and not to be dependent on someone to much...   Big thanks in advance!   
  • Topics

×
×
  • Create New...

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