PokeGOAPI-Java icon indicating copy to clipboard operation
PokeGOAPI-Java copied to clipboard

[Question] pokemon.transferPokemon have a limit

Open bolds07 opened this issue 10 years ago • 4 comments

Description: Sometimes i get successively UNSET return from transferPokemon method... the pokemon isn't in a gym and i always wait 3 secods between calls, but the method continues returning unset [and pokemon is transfered] and usually it happens simultaniously for lots of pokemons at same user.

So, the question is, are there any limit for amount pokemons i can transfer at once? does anyone have idea about this problem?

bolds07 avatar Jul 30 '16 16:07 bolds07

I can't reproduce this problem. How big is the amount of pokemon to transfer? I tested with 40 and it works.

Lasek avatar Jul 30 '16 17:07 Lasek

indeed im not doing a batch transfer, i just keep runing the bot, capturing and replacing the worst pokemons, and at some moment the transfer start return unset for every try

bolds07 avatar Jul 30 '16 20:07 bolds07

I got the problem...

The thing is if you try to create a Pokemon instance with PokemonData got from a CatachablePokemon [after you catch it] you will get an unusable instance because the Pokemon.data.id was not seted yet.

The solution is to set the pokemon id in pokemonData with the value got in catchPokemonResult getCapturedPokemonId

I tested and it works and in this way you dont need to update the pokemonBank just to transfer any pokemon you caught.

THE PROBLEM is that PokemonData class is automatic generated from protobuf files, and it doesn't have a set method to id attribute [i needed to use reflection to test]

I will open an enhancement to add id

bolds07 avatar Jul 30 '16 22:07 bolds07

You are using it wrong, you must refresh the inventory and after transfering it.

vmarchaud avatar Aug 06 '16 11:08 vmarchaud