Jump to content
  • 0

Bot report button problem


Question

Posted

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.

7 answers to this question

Recommended Posts

  • 0
Posted

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

 

  • 0
Posted

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?

  • 0
Posted

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.

  • 0
Posted

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.

  • 0
Posted

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

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.



×
×
  • Create New...