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

New API basic support #5784

Merged
merged 3 commits into from
Nov 7, 2016
Merged

New API basic support #5784

merged 3 commits into from
Nov 7, 2016

Conversation

pablossp
Copy link
Contributor

@pablossp pablossp commented Nov 6, 2016

Short Description:

  • Changed the api.activate_signature functions for the new api.set_signature and api.set_hash_lib functions.
  • Modified the requirements.txt to include the latest pgoapi API.

@mention-bot
Copy link

@pablossp, thanks for your PR! By analyzing the history of the files in this pull request, we identified @brantje, @geek-man and @simonsmh to be potential reviewers.

@pablossp pablossp changed the title Pablossp New API basic support Nov 6, 2016
@@ -1,6 +1,6 @@
numpy==1.11.0
networkx==1.11
-e git+https://github.com/pogodevorg/pgoapi.git/@3a02e7416f6924b1bbcbcdde60c10bd247ba8e11#egg=pgoapi
-e git+https://github.com/pogodevorg/pgoapi.git#egg=pgoapi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you need the add the tag? To get the latest update from a branch? This is what I put on my requirements.txt:

-e git+https://github.com/pogodevorg/pgoapi.git/@v0.43.3-alpha#egg=pgoapi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use
-e git+https://github.com/pogodevorg/pgoapi.git/@1a112879f424b518f994b99f43859dd95cd43fdf#egg=pgoapi
for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you guys, I'll make the change, I knew i had to be missing something in case the repository gets updated

else:
file_name = 'niantichash32.dll'
else:
file_name = 'libniantichash-linux-x86-64.so'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will this work on mac osx?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also linux 32?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I don't think so, I haven't worked on mac ever so I don't know what to check the _platform variable against? care to help me on that?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's 'darwin' on mine, not sure about the linux though

Copy link
Contributor Author

@pablossp pablossp Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, the Linux library works for both 32 and 64 bit architecture.
And thank you for the OSX info, I'll make a condition for it

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's not working on linux 32-bit

@pablossp
Copy link
Contributor Author

pablossp commented Nov 7, 2016

I made some changes now.
I still need a condition for the freebsd-64.so file.
And the web map is not showing Pokemon or the player in the map.
The bot client is working correctly so far.

@enginebai
Copy link

enginebai commented Nov 7, 2016

if _platform.lower() == "linux" or _platform.lower() == "linux2":
    file_name = 'src/pgoapi/pgoapi/lib/libniantichash-linux-x86-64.so'

In get_encrypt_lib(), the file_name should be libencrypt-linux-x86-64.so.

@pablossp pablossp force-pushed the pablossp branch 2 times, most recently from 8f95451 to 6f342be Compare November 7, 2016 12:10
Copy link

@lukasz138 lukasz138 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not working on linux 32-bit .

@pablossp
Copy link
Contributor Author

pablossp commented Nov 7, 2016

@lukasz138 try @enginebai solution, i've updated my branch (in a very ugly way) in order for it to work on linux now.

@lukasz138
Copy link

Exception: Could not find linux2 encryption library /root/pgoapi/PokemonGo-Bot/src/pgoapi/pgoapi/lib/libencrypt-linux-x86-32.so
2016-11-07 14:16:36,491 [sentry.errors] [ERROR] Sentry responded with an error: 'module' object has no attribute 'HTTPSHandler' (url: https://app.getsentry.com/api/90254/store/)
Traceback (most recent call last):
File "/root/pgoapi/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/threaded.py", line 174, in send_sync
super(ThreadedHTTPTransport, self).send(data, headers)
File "/root/pgoapi/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/transport/http.py", line 47, in send
ca_certs=self.ca_certs,
File "/root/pgoapi/PokemonGo-Bot/local/lib/python2.7/site-packages/raven/utils/http.py", line 44, in urlopen
class ValidHTTPSHandler(urllib2.HTTPSHandler):
AttributeError: 'module' object has no attribute 'HTTPSHandler'

@pablossp
Copy link
Contributor Author

pablossp commented Nov 7, 2016

@lukasz138 run pip install -r requirements.txt to download the new API to the src directory, or maybe I made a mistake, let me know please.

@lukasz138
Copy link

still the same

@enginebai
Copy link

@lukasz138 I encountered this problem before, and solved by locating the current encryption and hash lib file. Make sure ./pokemon_bot/__init__.py is updated as this PR.

@lukasz138
Copy link

Problem is in pgoapi/utilities.py : (there is no 32-bit libraries)

elif sys.platform.startswith('linux'):
if "centos" in platform.platform():
if platform.architecture()[0] == '64bit':
encrypt_lib = "libencrypt-centos-x86-64.so"
hash_lib = "libniantichash-centos-x86-64.so"
else:
encrypt_lib = "libencrypt-linux-x86-32.so"
hash_lib = "libniantichash-linux-x86-32.so"
else:
if platform.architecture()[0] == '64bit':
encrypt_lib = "libencrypt-linux-x86-64.so"
hash_lib = "libniantichash-linux-x86-64.so"
else:
encrypt_lib = "libencrypt-linux-x86-32.so"
hash_lib = "libniantichash-linux-x86-32.so"

@nullpixel
Copy link

nullpixel commented Nov 7, 2016

Can you make the PR for extra libs here? https://github.com/pogodevorg/pgoapi/pull/

It'll help me ;)

@lukasz138
Copy link

OK, tell me how ?

@nullpixel
Copy link

This was intended for original op

@pablossp
Copy link
Contributor Author

pablossp commented Nov 7, 2016

@nullpixel1 This same PR? to the pogo dev branch? Id be honored.
Please tell me exactly what you need and ill be glad to help.

@nullpixel
Copy link

@pablossp Just PR your binaries 😀 We need people to compile them for us, as we don't have all the binaries

@pablossp
Copy link
Contributor Author

pablossp commented Nov 7, 2016

Ohh, I think you might be mistaken, we are actually missing them, @lukasz138 is saying he is having an error because he does not have them. If I get to compile any of them when Im back home Ill be glad to send any missing binaries to the project.

@nullpixel
Copy link

We've got a PR that's got them. I'll review and merge them later

@solderzzc
Copy link
Contributor

solderzzc commented Nov 7, 2016

👍

Approved with PullApprove

@solderzzc solderzzc closed this Nov 7, 2016
@solderzzc solderzzc reopened this Nov 7, 2016
@solderzzc
Copy link
Contributor

Let me merge and have it run on Linux :) Everybody can't wait to see the green log.

@solderzzc solderzzc merged commit c581078 into PokemonGoF:dev Nov 7, 2016
@nachi9211
Copy link

Is bot working after latest update with CP changes?

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

Successfully merging this pull request may close these issues.

9 participants