Example #1
0
        public bool CheckPokestopUsed(FortCacheItem fort)
        {
            UsedPokestopsCleanup();
            var stamp  = DateTime.UtcNow.ToUnixTime();
            var check1 =
                _FortDatas?.Any(x => x != null && x.Id == fort?.Id && (x.Used || x.CooldownCompleteTimestampMS > stamp)) ??
                false;
            var check2 = RecentlyUsedPokestops.ContainsKey(fort.Id);

            return(check1 || check2);
        }
Example #2
0
 public void UsedPokestop(FortCacheItem stop)
 {
     foreach (FortCacheItem result in _FortDatas)
     {
         if (result.Id == stop.Id)
         {
             result.Used = true;
             result.CooldownCompleteTimestampMS     = DateTime.UtcNow.AddMinutes(5).ToUnixTime();
             RuntimeSettings.lastPokeStopId         = stop.Id;
             RuntimeSettings.lastPokeStopCoordinate = new GeoCoordinate(stop.Latitude, stop.Longitude);
             if (RuntimeSettings.TargetStopID == stop.Id)
             {
                 RuntimeSettings.BreakOutOfPathing = true;
             }
         }
     }
 }
Example #3
0
        public void UsedPokestop(FortCacheItem stop, ISession session)
        {
            var stamp = DateTime.UtcNow.AddMinutes(5).ToUnixTime();

            foreach (FortCacheItem result in _FortDatas)
            {
                if (result.Id == stop.Id)
                {
                    result.Used = true;
                    result.CooldownCompleteTimestampMS     = stamp;
                    session.Runtime.lastPokeStopId         = stop.Id;
                    session.Runtime.lastPokeStopCoordinate = new GeoCoordinate(stop.Latitude, stop.Longitude);
                    if (session.Runtime.TargetStopID == stop.Id)
                    {
                        session.Runtime.BreakOutOfPathing = true;
                    }
                }
            }
            if (!RecentlyUsedPokestops.ContainsKey(stop.Id))
            {
                RecentlyUsedPokestops.Add(stop.Id, stamp);
            }
        }
Example #4
0
        public bool CheckPokestopUsed(FortCacheItem fort)
        {
            var stamp = DateTime.UtcNow.ToUnixTime();

            return(_FortDatas?.Any(x => x != null && x.Id == fort?.Id && (x.Used || x.CooldownCompleteTimestampMS > stamp)) ?? false);
        }