AeonLucid / POGOProtos

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

Error on SetPlayerTeamResponse #228

Closed vankxr closed 7 years ago

vankxr commented 7 years ago

I am getting this error on NodeJS when trying to decode a SetPlayerTeam Response

Error: Illegal wire type for field Message.Field .POGOProtos.Networking.Responses.SetPlayerTeamResponse.player_data: 0 (2 expected)

The request message is simple, and it's okay, I am trying to join team 2 (Valor/Red)

{ team: 2 }

I can't find any solution for this :(

vankxr commented 7 years ago

Forgot to mention, I tried to comment (//) the proto field that throws an error. With that commented, I was getting status = 1 (success) on the SetPlayerTeamResponse.status but the team wasn't actually set

trisk commented 7 years ago

Wire type 0 indicates a single varint (maybe the same POGOProtos.Enums.TeamColor enum in the request) instead of the PlayerData message in the proto. Check the raw request or try declaring the type as varint32 or .POGOProtos.Enums.TeamColor.

vankxr commented 7 years ago

That males sense. Will try it tomorrow.

But what about the team not getting set? Although it returned 1 as status?

trisk commented 7 years ago

I don't know why that would return 1 (SUCCESS); TEAM_ALREADY_SET is 2. The proto in the game client definitely uses a ClientPlayerProto instead of a varint for field 2, though. Maybe it's parsing the wrong response buffer?

vankxr commented 7 years ago

Found out what was causing the issue.

Nothing related with protos. ;)

Think you anyways for helping :D