Skip to content

Bot report button problem

Featured Replies

Hi guys i have one issue with my bot report button a player can spam it without get the message "You have already reported this player"

 

What i have done wrong?

 

L2PcInstance:

public boolean isBotReportedBy(L2PcInstance botReporter)

   {
        if (_botReportedBy.isEmpty())
            return false;
        for (L2PcInstance reporter : _botReportedBy)
        {
            if (reporter == null)
                continue;
            if (reporter == botReporter)
                return true;
        }
        return false;
    }

 

 

RequestActionUse:

case 65: // Bot Report Button
                if (target == null)
                    return;
                if (target == activeChar)
                    return;
                if (!(target instanceof L2PcInstance))
                    return;
                L2PcInstance targetPlayer = (L2PcInstance) target;
                if (activeChar.isInsideZone(ZONE_PEACE))
                {
                    activeChar.sendMessage("Cannot use this function in the peace zone.");
                    return;
                }
                if (targetPlayer.isInsideZone(ZONE_PEACE))
                {
                    activeChar.sendMessage("Cannot use this function if the target is in a peace zone.");
                    return;
                }
                if (((L2PcInstance) target).isBotReportedBy(activeChar))
                {
                    activeChar.sendMessage("You have already reported this player.");
                    return;
                }

 

Tnx guys.

Maybe, it doesn't work because you don't add the reporter in the _botReportedBy.

  • Author

Maybe, it doesn't work because you don't add the reporter in the _botReportedBy.

How i can add this?

 

Also forgot to add this:

// List to contain players who have bot reported this L2PcInstance

private FastList<L2PcInstance> _botReportedBy = new FastList<L2PcInstance>();

 

I think that this should add reporter but it seems not work

 

  • Author

The only issue that i can find is that this code dont work :

// List to contain players who have bot reported this L2PcInstance
   private FastList<L2PcInstance> _botReportedBy = new FastList<L2PcInstance>();

 

In result not getting this message

 

                if (((L2PcInstance) target).isBotReportedBy(activeChar))
                {
                    activeChar.sendMessage("You have already reported this player.");
                    return;
                }

 

 

How can i fixed that?

Needs COMPLETE bot report button... Must have something like

_botReportedBy.add(

and also once punished a 

_botReportedBy.clear();

 

Finally it's idiot to store such a list by player, a single Map on a manager is enough. It's not like you will have 10000 registrations anyway, but your 200-300 lists will be really created for nothing.

Needs COMPLETE bot report button...

 

COMPLETE IT FAST  :happyforever:

  • Author

Needs COMPLETE bot report button... Must have something like

_botReportedBy.add(

and also once punished a 

_botReportedBy.clear();

 

Finally it's idiot to store such a list by player, a single Map on a manager is enough. It's not like you will have 10000 registrations anyway, but your 200-300 lists will be really created for nothing.

But button work fine but the problem is that is spamable also is not connected with ban or not ,this will happen manual.

 

My problem is that this code dont work and players can spam report button.

I appreciate you quoted me, but that would be better if you actually read the content of the quote.

 

isBotReportedBy( should be

 

{
if (list.contains(reporter)
return true;

return false;
}

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.