Skip to content

Commit

Permalink
NoPlayerPositionSetException() after re-logging in (#4364)
Browse files Browse the repository at this point in the history
  • Loading branch information
Calcyfer authored and solderzzc committed Aug 20, 2016
1 parent cc3b4c9 commit 72e111c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pokemongo_bot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ def tick(self):
self.tick_count += 1

# Check if session token has expired
self.check_session(self.position[0:2])
self.check_session(self.position)

for worker in self.workers:
if worker.work() == WorkerResult.RUNNING:
Expand Down Expand Up @@ -667,6 +667,7 @@ def _setup_logging(self):
format='%(asctime)s [%(name)10s] [%(levelname)s] %(message)s'
)
def check_session(self, position):

# Check session expiry
if self.api._auth_provider and self.api._auth_provider._ticket_expire:

Expand All @@ -686,7 +687,7 @@ def check_session(self, position):
formatted='Session stale, re-logging in.'
)
self.api = ApiWrapper(config=self.config)
self.api.set_position(*self.position)
self.api.set_position(*position)
self.login()
self.api.activate_signature(self.get_encryption_lib())

Expand Down

0 comments on commit 72e111c

Please sign in to comment.