AeonLucid / POGOProtos

A central repository for all proto files of PokémonGO.
MIT License
726 stars 279 forks source link

FortData.proto field 13 is MapPokemon instead LureInfo #103

Closed igoticecream closed 7 years ago

igoticecream commented 8 years ago

Coming from this issue #101

FabianTerhorst commented 8 years ago

wow nice

Deathshiver commented 8 years ago

I can't yet comment on whether it's accurate that the field is MapPokemon instead of LureInfo, but it's worth noting that it's already possible to catch Lured pokemon with the current Proto...

private static async Task CatchLuredPokemon(FortData pokeStop)
{
    var diskEncounterResponse = await _client.DiskEncounter(pokeStop.LureInfo.EncounterId, pokeStop.LureInfo.FortId);
    var catchPokemonResponse = await _client.CatchPokemon(pokeStop.LureInfo.EncounterId, pokeStop.LureInfo.FortId, pokeball);
}

Edit: That's a slimmed down version of the code, you still need to do all the validation, checking for a pokemon (via LureInfo.ActivePokemonId), and checking for errors.

igoticecream commented 8 years ago

You need spawn point id in order to catch a map pokemon (see: https://github.com/AeonLucid/POGOProtos/blob/master/src/POGOProtos/Networking/Requests/Messages/CatchPokemonMessage.proto)

LureInfo doesnt provide this spawn point id. Again, i have made this change with testing it and it is indeed MapPokemonProto

igoticecream commented 8 years ago

https://raw.githubusercontent.com/Jumboperson/PokemonGoDumper/master/OldDumps/Assembly-CSharp.cs

Check out this assembly:

// Namespace: Holoholo.Rpc class PokemonFortProto

and take a look at:

static int ActivePokemonFieldNumber = 13;

Deathshiver commented 8 years ago

I don't think you understand, the FortId -IS- the spawn point id. I'm not just making up this code, I'm literally using it and have been using it to get to level 30 so far. Lured pokemon spawn on a Fort node, not a normal spawn node. You can even use pokeStop.FortId and it still works. If you try printing out the spawn point ID that your change supposedly sends to the server, you'll notice it's a FortId, not a SpawnPointId.

Edit: This is an important distinction because you need to use a separate Encounter message from normal pokemon, and the new encounter message requires the FortId.

igoticecream commented 8 years ago

I tested what you said, and it works too o.o

rubenvereecken commented 8 years ago

I noticed myself I needed a spawn point id while writing an auto-catch but none was supplied so just went with the fort id.

I'll merge this in once you get to removing the old FortLureInfo message ;).

Lennix commented 8 years ago

I wouldn't merge, see #101

trisk commented 8 years ago

@Lennix what seems to be the problem? The internal proto says the field is MapPokemon.

AeonLucid commented 7 years ago

Please let me know if this is still relevant.