Exemplo n.º 1
0
        public static Player FindNick(Player p, string nick)
        {
            nick = Colors.StripColours(nick);
            Player[] players = PlayerInfo.Online.Items;
            Player   match = null; int matches = 0;

            foreach (Player pl in players)
            {
                if (!Entities.CanSee(p, pl))
                {
                    continue;
                }
                string name = Colors.StripColours(pl.DisplayName);

                if (name.Equals(nick, comp))
                {
                    return(pl);
                }
                if (name.IndexOf(nick, comp) >= 0)
                {
                    match = pl; matches++;
                }
            }
            return(matches == 1 ? match : null);
        }