Ticket #6 (closed defect: fixed)

Opened 2 years ago

Last modified 1 year ago

Matchbot matches wrong player

Reported by: Maverick Assigned to:
Priority: high Component: Bots - Other
Version: Latest version from repository Severity: critical
Keywords: Cc:

Description

flibb <ER>: "if a player is outside of base, and another player has a similar name it will sometimes warn and kick that player. eg melo, melon"

Attachments

Change History

02/15/07 20:49:19 changed by spacehiker

Also, if we play a twd match and we try to put the player "ph" in, if the other team has a player "phizey" that is in the arena, it will get confused and put player "ph" on the opposing freq.

02/15/07 22:52:10 changed by D1st0rt

I would think this would have to do with BotAction's getFuzzyPlayerName

04/22/07 16:44:50 changed by dugwyler

  • priority set to normal.

This is the method used by MatchBot, essentially exactly the same as BotAction's getFuzzyPlayerName. However, it really shouldn't be giving problems. "Melon" would only be returned over "Melo" if the search was for "m", "me", or "mel" … when given "Melo" (around line 505 of MatchRound), MatchTeam's getPlayer method should be able to directly match the name and only return that.

Here's the code for anyone wanting to give it a cursory look and see if they can fix it:

    public MatchPlayer getPlayer(String name, boolean matchExact)
    {
        ListIterator i = m_players.listIterator();
        MatchPlayer answ, best = null;

        while (i.hasNext())
        {
            answ = (MatchPlayer) i.next();

            if (answ.getPlayerName() != null)
            {
                if ((!matchExact) && (answ.getPlayerName().toLowerCase().startsWith(name.toLowerCase())))
                    if (best == null)
                        best = answ;
                    else if (best.getPlayerName().toLowerCase().compareTo(answ.getPlayerName().toLowerCase()) > 0)
                        best = answ;

                if (answ.getPlayerName().equalsIgnoreCase(name))
                    return answ;
            }
        }
        return best;
    };

06/20/07 14:33:30 changed by Maverick

  • priority changed from normal to high.
  • status changed from new to closed.
  • resolution set to duplicate.
  • severity changed from minor to critical.

06/20/07 14:34:27 changed by Maverick

  • status changed from closed to reopened.
  • resolution deleted.

Oops, my mistake.

priority and severity changed to match ticket:78 which is a duplicate of this ticket.

06/20/07 16:38:38 changed by anonymous

Is this bug repeatable — does it happen with the same players in the same situation?

06/20/07 18:18:06 changed by Reaver

Yes it's repeatable, it happened when we were jd'ing against a squad, while playing a guy on our squad named singer, and the other team had a guy named sin in.

06/20/07 19:58:48 changed by dugwyler

I guess what I mean is, if you JD that squad 100 times, will it happen 100 out of 100 times with the same command? Or would it happen intermittently and unpredictably?

08/19/07 20:43:22 changed by dugwyler

Attempted a fix.

08/20/07 14:57:33 changed by dugwyler

Odd:

Each team carries a list of players in MatchTeam. MatchTeam has a getPlayer(String name) method which uses a fuzzy search to get the best match for a given name… but if the search succeeded with the first team, the second wasn't checked for a better match. This should fix the out of bounds problem.

Found out this would also allow players with similar names to other players to enter commands for the other team, if they were on the second team. This may have been the cause of the player name mismatch. I couldn't see any other instances of getPlayer called with the fuzzy search outside of MatchTeam. I guess we'll see what happens.

09/09/07 05:18:13 changed by dugwyler

Anyone see this problem recur, at least on King bots? If not, should be able to close it. The out-of-bounds piece was pretty glaring.

09/09/07 06:12:05 changed by Maverick

This problem doesn't happen very often. I think it's best to just close it and reopen it when it's found that the problem still exists.

Up to you though.

11/14/07 01:18:46 changed by Maverick

  • status changed from reopened to closed.
  • resolution set to fixed.

No more reports coming in about this. If it's found that this is still a problem in the future, this ticket will be reopened.

Thanks for fixing it, dugwyler :)


Add/Change #6 (Matchbot matches wrong player)




Change Properties
Action