Pokemon-Go-Rocket-API
Pokemon-Go-Rocket-API copied to clipboard
GetMapObjects doesn't always return pokestops/pokemons
Although this could be an issue with PokemonGo itself, I feel that it could be related to S2Helper.GetNearbyCellIds . If you visualize the pokestops that get returned by GetMapObjects you will often see that (for example) only pokestops north of the player get returned.
Is there maybe a limit to the number of pokestops returned? (although that doesn't explain why sometimes it doesn't return any).
I experience missing pokestops as well. But it looks like it is not related to a direction, because there are some stops NEVER returned by the API (but I can see them in the app).
I tested yesterday in central park and many forts appeared. But today when I tried to bot again, just 21 mapcells without forts has been returned.
https://github.com/FeroxRev/Pokemon-Go-Rocket-API/commit/1a723cc08b5a92fa48221f8e6ddaaf9d27f4bd39
Does this fix the issue? :)
This definitely changed the result set. The pokestops around the player look more like a sphere. Will do some more testing to see if it's fixed :)
Unfortunately it's still not fixxed on my end. It only finds 2 out of 60ish pokestops :(
Are you sure you select all pokestops from all cellids and not just the first? @MarkMeier
var pokeStops = mapObjects.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint && i.CooldownCompleteTimestampMs < DateTime.UtcNow.Ticks); foreach (var pokeStop in pokeStops)
this worked before the patch so I don't see why it shouldn't be working now. Even if i manually check all the mapcells forts are always empty. Should I give you more info about the position/mapcells etc?
var mapObjects = await client.Map.GetMapObjects();
var pokeStops = mapObjects.Item1.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint && i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime()).ToArray();
this is what im trying to do with newest version but still always empty? :(
Am i doing something wrong?
No, you arent. I have the same issue. It's strange.
Strange, anyone know a solution?
Sorry for hijacking this, but I think I'm having the same issue.
It seems to me that having more than 1 request each 10 seconds causes them to return 21 empty cells as @Corlobin said.
I'm not really sure if this is a timing issue, but I've never encountered this issue when I update the map every 10 seconds, it only happens when I'm forced to update between those 10 seconds intervals.
I think you are right. When I try at the first time to retrieve the map I receive just 21 cells. I put a Task.Delay(15000) and after a while the map showed.
Well, I am using this code and seems fine!
Hope it help.
private async Task<IEnumerable<FortData>> GetPokestops(CustomClient client)
{
var mapObjects = await player.Map.GetMapObjects();
var pokeStops = mapObjects.Item1.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint && i.CooldownCompleteTimestampMs < DateTime.UtcNow.ToUnixTime());
pokeStops = pokeStops.OrderBy(i => Utility.CalculateDistanceInMeters(
new Location(player.CurrentLatitude, player.CurrentLongitude), new Location(i.Latitude, i.Longitude)));
do
{
Thread.Sleep(15000);
if (pokeStops.Count() > 0)
break;
mapObjects = await player.Map.GetMapObjects();
pokeStops = mapObjects.Item1.MapCells.SelectMany(i => i.Forts).Where(i => i.Type == FortType.Checkpoint );
pokeStops = pokeStops.OrderBy(i => Utility.CalculateDistanceInMeters(
new Location(player.CurrentLatitude, player.CurrentLongitude), new Location(i.Latitude, i.Longitude)));
} while (pokeStops.Count() == 0);
return pokeStops;
}
Check it
Is this working good for you?
I have two problems : First is : If I search to find pokémons and pokéstops (with two call of GetMapObjects), only the the first call is correct : pokémon appear. Not the pokestops on the second call.
Second : When I only call one GetMapObjects for the pokestops, the response is not really "cool" with the radius : http://image.prntscr.com/image/db9efbbefd5e450a8e67b1a0208549a1.png
@Megurine as I said above, the issue is probably related to request timing. Issuing more than one request each 10 seconds returns empty data. You may want to get both pokemons and pokestop in the same request, since they're all returned by the same method.
@ST-Apps Hmm I think its 5 seconds , so for the first problem I scan the pokémon and pokéstop on the same GetMapObjects request :) (surely a Niantic restriction)
But the second problem is strange =S