Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setFavoritePokemon proto fix #93

Open
earshel opened this issue Aug 12, 2016 · 7 comments
Open

setFavoritePokemon proto fix #93

earshel opened this issue Aug 12, 2016 · 7 comments

Comments

@earshel
Copy link

earshel commented Aug 12, 2016

Using setFavoritePokemon() function can sometimes return an error because the Pokemon ID is outside of the range of an INT64. Changing the type to UINT64 in the fielddescriptor solves this problem. Line 38 in POGOProtos\Networking\Requests\Messages\SetFavoritePokemonMessage_pb2 should look like this:

number=1, type=4, cpp_type=4, label=1,

@dmadisetti
Copy link
Collaborator

We're just following these guys for now.

If you are convinced this is the case, submit a pull request with them and we'll merge it

@dmadisetti
Copy link
Collaborator

Ehh. I'll keep this open then

@dmadisetti dmadisetti reopened this Aug 12, 2016
@earshel
Copy link
Author

earshel commented Aug 12, 2016

Fair enough. All I know is that using INT64, when my Pokemon ID is outside of the scope of INT64 it fails to favorite the Pokemon giving an out of range exception.

@dmadisetti
Copy link
Collaborator

I haven't had this issue, but I haven't extensively used the call. Do you have an id as reference?

@earshel
Copy link
Author

earshel commented Aug 12, 2016

@dmadisetti here's an ID that raises the error if it's set to INT64 rather than UINT64:

File "C:\Python27\lib\site-packages\google\protobuf\internal\type_checkers.py", line 134, in CheckValue
    if not isinstance(proposed_value, six.integer_types):
      message = ('%.1024r has type %s, but expected one of: %s' %
                 (proposed_value, type(proposed_value), six.integer_types))
      raise TypeError(message)
    if not self._MIN <= proposed_value <= self._MAX:
      raise ValueError('Value out of range: %d' % proposed_value)
    # We force 32-bit values to int and 64-bit values to long to make
    # alternate implementations where the distinction is more significant
    # (e.g. the C++ implementation) simpler.
    proposed_value = self._TYPE(proposed_value)
    return proposed_value
ValueError: Value out of range: 9616888052755598152

 We force 32-bit values to int and 64-bit values to long to make
    # alternate implementations where the distinction is more significant
    # (e.g. the C++ implementation) simpler.
    proposed_value = self._TYPE(proposed_value)
    return proposed_value
ValueError: Value out of range: 9616888052755598152

@earshel
Copy link
Author

earshel commented Aug 12, 2016

After altering the Proto, it works.

Line 111,mgr.py - 2016-08-12 15:28:59,000 - CRITICAL - Found pokemon with ID 9616888052755598152. Toggling favorite.
Line 113,mgr.py - 2016-08-12 15:28:59,124 - CRITICAL - result: SUCCESS

Line 87,_internal.py - 2016-08-12 15:28:59,132 - INFO - 127.0.0.1 - - [12/Aug/2016 15:28:59] "GET /release?sortBy=cp&pokeID=9616888052755598152&action=Favorite+Selected HTTP/1.1" 200 -
Line 87,_internal.py - 2016-08-12 15:29:00,266 - INFO - 127.0.0.1 - - [12/Aug/2016 15:29:00] "GET /inventory HTTP/1.1" 200 -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants