Exemple #1
0
        public string getPermitXY(int UID)
        {
            Player user = getPlayer(UID);

            if (user != null)
            {
                if (isCoordFiltered(user.x, user.y, xLow, xHigh, yLow, yHigh))
                {
                    updateLog("[Filter] Spot filtered at " + user.x + "," + user.y);
                    return(null);
                }
                Foothold foothold = myCharacter.Map.footholds.findBelow(new Point(user.x, user.y));
                if (Program.whiteList)
                {
                    string contents = File.ReadAllText(Program.FMWhiteList);
                    if (contents.ToLower().Contains(user.ign.ToLower()))
                    {
                        return(null);
                    }
                }
                else
                {
                    string contents = File.ReadAllText(Program.FMBlackList);
                    if (contents.ToLower().Contains(user.ign.ToLower()))
                    {
                        return(string.Concat(user.x, ",", foothold.getY1(), ",", foothold.getId()));
                    }
                    return(null);
                }
                return(string.Concat(user.x, ",", foothold.getY1(), ",", foothold.getId()));
            }
            return(null);
        }
Exemple #2
0
        public string getStoreXY(int UID)
        {
            MapleFMShop shop = mapleFMShopCollection.getPlayerShop(UID, false);

            if (shop != null)
            {
                if (clientMode != ClientMode.SHOPRESET)
                {
                    if (isCoordFiltered(shop.x, shop.y, xLow, xHigh, yLow, yHigh))
                    {
                        updateLog("[Filter] Spot filtered at " + shop.x + "," + shop.y);
                        return(null);
                    }
                }
                Foothold foothold = myCharacter.Map.footholds.findBelow(new Point(shop.x, shop.y));
                if (clientMode == ClientMode.SHOPRESET)
                {
                    return(string.Concat(shop.x, ",", foothold.getY1(), ",", foothold.getId()));
                }
                if (Program.whiteList)
                {
                    string contents = File.ReadAllText(Program.FMWhiteList);
                    if (clientMode != ClientMode.SHOPRESET & clientMode != ClientMode.SHOPCLOSE & contents.ToLower().Contains(shop.owner.ToLower()))
                    {
                        return(null);
                    }
                }
                else
                {
                    string contents = File.ReadAllText(Program.FMBlackList);
                    if (clientMode != ClientMode.SHOPRESET & clientMode != ClientMode.SHOPCLOSE & contents.ToLower().Contains(shop.owner.ToLower()))
                    {
                        return(string.Concat(shop.x, ",", foothold.getY1(), ",", foothold.getId()));
                    }
                    return(null);
                }
                return(string.Concat(shop.x, ",", foothold.getY1(), ",", foothold.getId()));
            }
            else
            {
                updateLog("[Error] Could not find your store!");
                updateLog("[Error] Is your char in the right FM room?");
                forceDisconnect(false, 0, false, "Character not in right FM room?");
                return(null);
            }

            /*
             * List<KeyValuePair<int, MapleFMShop>>.Enumerator enumerator = mapleFMShopCollection.shops.ToList<KeyValuePair<int, MapleFMShop>>().GetEnumerator();
             * try
             * {
             *  while (enumerator.MoveNext())
             *  {
             *      KeyValuePair<int, MapleFMShop> current = enumerator.Current;
             *      if (current.Value.playerUID == UID)
             *      {
             *          Foothold foothold = myCharacter.Map.footholds.findBelow(new Point(current.Value.x, current.Value.y));
             *          if (clientMode == ClientMode.SHOPRESET)
             *              return string.Concat(current.Value.x, ",", foothold.getY1(), ",", foothold.getId());
             *          if (Program.whiteList)
             *          {
             *              string contents = File.ReadAllText(Program.FMWhiteList);
             *              if (clientMode != ClientMode.SHOPRESET & clientMode != ClientMode.SHOPCLOSE & contents.ToLower().Contains(current.Value.owner.ToLower()))
             *              {
             *                  return null;
             *              }
             *          }
             *          else
             *          {
             *              string contents = File.ReadAllText(Program.FMBlackList);
             *              if (clientMode != ClientMode.SHOPRESET & clientMode != ClientMode.SHOPCLOSE & contents.ToLower().Contains(current.Value.owner.ToLower()))
             *              {
             *                  return string.Concat(current.Value.x, ",", foothold.getY1(), ",", foothold.getId());
             *              }
             *              return null;
             *          }
             *          return string.Concat(current.Value.x, ",", foothold.getY1(), ",", foothold.getId());
             *      }
             *  }
             *  updateLog("[Error] Could not find your store!");
             *  updateLog("[Error] Is your char in the right FM room?");
             *  forceDisconnect(false, 0, false);
             *  return null;
             * }
             * finally
             * {
             *  ((IDisposable)enumerator).Dispose();
             * }
             * return null;
             */
        }