-
Notifications
You must be signed in to change notification settings - Fork 278
setFavoritePokemon pokemon_id data type #188
Comments
Which protos file are you talking about? I have pokemon_id values between 1 and 151? xD |
Networking/Requests/SetFavoritePokemonMessage_pb2 line 37 - it's not referring to the Pokemon's Pokedex ID. Each of your Pokemon have a unique ID associated with them. It's visible in session.getInventory:
|
I see, in that case you're probably right. Until they change it you can change it yourself and recompile or use something like pokemon_id = ctypes.c_longlong(pokemon_id) |
Changing the type and cpp_type to 4 in this section actually solves the issue for me:
|
according to current dumps the game is still usings longs for pokemon ids, public sealed class SetFavoritePokemonProto // TypeDefinitionIndex: 4645 Have you witnessed a pokemon that fails and have you tried it in the official client? i have a feeling its a bug on niantics end and its going to cause type issues if its changed to unsigned again |
@Grover-c13 I see that, and I think I have the answer. Per this thread http://stackoverflow.com/questions/25556017/how-to-use-the-unsigned-integer-in-java-8:
So while the game client is declaring it as a "long", it is being interpreted as an unsigned long automatically. In Python, it's necessary to declare the variable as an unsigned int64. I know nothing about Java, but this is what my research has lead me to believe. |
The dump is not java |
@Grover-c13 Well, then I'm at a loss. I posted proof of the issue above, and I've done my best to try to determine where the discrepancy is ;(. All I can really tell you is that Pokemon whose ID fall outside of the scope of INT64 can't be favorited because of this proto, and that using UINT64 instead resolves the issue. I've made this change in the proto on my end and I've been using it without issue for several days now. At this point, I don't care to continue trying to prove anything, especially since the author hasn't chimed in. |
Not saying i dont believe you :P just saying we need to try and find a solution to cover most languages which can be difficult given the nature of protobuf. AeonLucid is probably busy and may not even know/had this issue, so i don't think his input should stop us determining a good solution at this point. If you look at #126 we had some type issues between it. Originally we had it as fixed64 but it did not work, so we tried unit64 which worked for java but not for @GrimmGringo and uses C#. The original logic behind it was the game client is using signed longs for setFavouritePokemon (from decoded client in c++), which is odd because everything else doesnt, so i thought the client might have a bug on pokemon ids > long.max when setting favorite, unless the server has the correct type of ulong and is handling the long being sent. Just out of curiosity could you try and favorite the pokemon inside the game and see if it works? |
Fair enough. I identified a problem Pokemon and favorited it in the game client no problem. For what it's worth, the untouched compiled protos for releasePokemon,evolvePokemon,upgradePokemon all use type=6 (fixed64) and cpp_type=4(uint64), while the setFavoritePokemon uses type=3(int64) and cpp_type=2(int64). Why this proto message uses different datatypes, which cause it to fail, I dunno. Here's the fieldDescriptor reference I am using to determine all of this: https://developers.google.com/protocol-buffers/docs/reference/python/google.protobuf.descriptor.FieldDescriptor-class |
Closing this issue, let me know if this is still relevant. |
Thank you for all of your continued work on these Protos. My project wouldn't be possible without them :). I've got a minor issue with one of the Protos, outlined below.
The data type is currently set as INT64 and this can cause an out of range exception if the following condition is true:
This has happened to me on a few occasions. An example of this:
See Python data types here for verification:
http://docs.scipy.org/doc/numpy-1.10.1/user/basics.types.html
Changing pokemon_id's type to UINT64 solves this problem as the upper limit of the range is 18446744073709551615.
The text was updated successfully, but these errors were encountered: