Fight in Gym - always fail
Description: When I start battle, status of start battle is always UNSET
Steps to reproduce:
Battle battle = gym.battle(attackers);
StartGymBattleResponseOuterClass.StartGymBattleResponse.Result result = battle.start();
if(result == StartGymBattleResponseOuterClass.StartGymBattleResponse.Result.SUCCESS){
...
}else{
new throw Exception(result);
}
Expected behavior: Status should be SUCCESS
Actual behavior: Status always is UNSET
Version: Last commit ee28406d5a0f87dc2b16429f7b19e31fbac30a95
i had this issue when i had dead pokemon in my attacking team, need to add some checks to it at some point.
My all pokemons in team have max stamina. I still have a problem.
I'm seeing the same issue.
I tried the code in FightGymExample.java, (substituting my username and password), and this was the outcome:
D/RequestHandler: Authenticated with static token
D/RequestHandler: Authenticated with static token
FAILED:UNSET
FAILED:UNSET
FAILED:UNSET
FAILED:UNSET
FAILED:UNSET
FAILED:UNSET
FAILED:UNSET
FAILED:UNSET
im not using this api/bot because im a c# guy, but i think we have the same issue.
If you look at the IDs of you attacker Team - they are ulong and something like "6068907423423435111511". But the GuardPokemonId returns a PokemonId (Flareon = 143 or whatever). GuardPokemonCP is also always 0. So we maybe need the pkmn-unique id of the defender pkmn, same as we use these unique ids for attackerTeam.
It could be that this is an issue of pogoprotos.dll
Are you talking about the ID of the gym pokemon when the battle start request is sent? This API is sending the UID of the defending pokemon just fine AFAICT.
From my testing, when building with the java api, you should get a different status_code in the ResponseEnvelope. As i discussed with someone over slack, when you start a fight, the server will switch you to another one (like the first packet send) with the status_code 53 or 2. In reality we got 3, thats a bad request status from my testing again, so dont know if the proto are wrong but the definitely dont want us to make that request.
@Grover-c13 told me that he succeed for sending that packet, any more info ?
My apologies guys, i must of modified the proto when developing it and forgot to submit a PR to AeonLucids, if you change the defender_id to fixed64 this will work correctly. https://github.com/AeonLucid/POGOProtos/pull/97
@Grover-c13 I fixed the proto locally, and now I'm getting ERROR_INVALID_DEFENDER. It looks like the logic for selecting the first defender is working correctly, so I'm not sure what's going wrong.
hmmm, i was assuming the defenders that are on gyms are sorted on the server, but maybe i was lucky and we should sort for the lowest defender CP first before selecting the initial defender ID (which has to be the lowest CP defender pretty sure)
It looks like it is selecting the lowest CP defender, that was the first thing I checked.
Is it an offensive attack (team vs another team) or a training attack (same team vs same team)?
If you asked me, this problem is in attack and trening too.
This is an offensive attack
Seems to be working this morning, but I didn't change anything. It's possible my account was soft banned. Now I'm getting INVALID_ATTACK_ACTIONS
Yes, you should check on how work battling, since the parameters are actually super important on the result of the action, read this dump and try to understand how it works, its not easy i warn you : http://pastebin.com/enDzFvUN
That's just what I was looking for - thanks!
did anyone manage to do this yet?
So my issue with this is that it works for me sometimes... (I have applied the fixed64 proto fix to defender). it seems like it fails if the defender_id is larger than an int64 but smaller than uint64. I had the same exact issue when capturing Incense generated Pokemon. Perhaps it's a python 2.7 issue on my end or something stupid.
Any updates on this? I've fixed the proto manually but attacking an enemy gym still does not work. My attacks are not being registered. I can see my pokemon's health going down but the enemy's health stays exactly the same (even though I have a higher CP) meaning my attacks aren't registered.
I followed the code in the example provided.