Skip to content

Commit

Permalink
Make too late scanning configurable (PokemonGoF#932)
Browse files Browse the repository at this point in the history
* Make too late scanning configurable

Some would rather catch all spawns (for statistical analysis)
Others only want ones they can get to in time.

Making this configurable allows you to start skipping queued items earlier, so if workers get behind they can eventually catch up again.

* Status improvements (PokemonGoF#935)

* Improved Overseer line

Now shows next queue item, when that item is supposed to be scanned (for -ss), and how far ahead/behind of realtime your queue is.

* Username already shown, not need to write it twice

* Format all lat/lng to 6 decimals

That is an accuracy of approx 10cm, more than enough for display purposes.

* Show sleep length, reformat some messages

* Appease travis

* Make too late scanning configurable

Some would rather catch all spawns (for statistical analysis)
Others only want ones they can get to in time.

Making this configurable allows you to start skipping queued items earlier, so if workers get behind they can eventually catch up again.

* Show total skipped items

* Add account name back into log message

* Update config.ini

* Update requirements.txt to fix PokemonGoF#926 (PokemonGoF#928)

* Update requirements.txt to fix PokemonGoF#926

gpsoauth 0.4.0 is now required

* Update requirements.txt to fix PokemonGoF#926

Removed gpsoauth requirement completely as this lib is only used by pgoapi that already defines this requirement in its own requirements.txt

* Add username of possibly banned accounts (PokemonGoF#941)

Just a small fix in order to add banned usernames.

* Prevent header from cutting off bottom of accordion (PokemonGoF#873)

height: 100% doesn't take into account the #header height of 3.5em

* Make too late scanning configurable

Some would rather catch all spawns (for statistical analysis)
Others only want ones they can get to in time.

Making this configurable allows you to start skipping queued items earlier, so if workers get behind they can eventually catch up again.

* Show total skipped items

* Update config.ini
  • Loading branch information
justsomedudeonthenet authored and BaIthamel committed Aug 23, 2016
1 parent fdcdfe7 commit 5f56ee1
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions config/config.ini.example
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#no-pokestops: # disables pokestop scanning (default false)
#scan-delay: # default 10
#step-limit: # default 12
#min-seconds-left: # time that must be left on a spawn before considering it too late and skipping it (default 0)

# Misc
#gmaps-key: # your Google Maps API key
Expand Down
10 changes: 8 additions & 2 deletions pogom/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ def status_printer(threadStatus, search_items_queue, db_updates_queue, wh_queue)
# Create a list to hold all the status lines, so they can be printed all at once to reduce flicker
status_text = []

# Calculate total skipped items
skip_total = 0
for item in threadStatus:
if 'skip' in threadStatus[item]:
skip_total += threadStatus[item]['skip']

# Print the queue length
status_text.append('Queues: {} items, {} db updates, {} webhook'.format(search_items_queue.qsize(), db_updates_queue.qsize(), wh_queue.qsize()))
status_text.append('Queues: {} search items, {} db updates, {} webhook. Total skipped items: {}'.format(search_items_queue.qsize(), db_updates_queue.qsize(), wh_queue.qsize(), skip_total))

# Print status of overseer
status_text.append('{} Overseer: {}'.format(threadStatus['Overseer']['method'], threadStatus['Overseer']['message']))
Expand Down Expand Up @@ -470,7 +476,7 @@ def search_worker_thread(args, account, search_items_queue, pause_bit, encryptio
continue

# too late?
if leaves and now() > leaves:
if leaves and now() > (leaves - args.min_seconds_left):
search_items_queue.task_done()
status['skip'] += 1
# it is slightly silly to put this in status['message'] since it'll be overwritten very shortly after. Oh well.
Expand Down
3 changes: 3 additions & 0 deletions pogom/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ def get_args():
parser.add_argument('-mf', '--max-failures',
help='Maximum number of failures to parse locations before an account will go into a two hour sleep',
type=int, default=5)
parser.add_argument('-msl', '--min-seconds-left',
help='Time that must be left on a spawn before considering it too late and skipping it. eg. 600 would skip anything with < 10 minutes remaining. Default 0.',
type=int, default=0)
parser.add_argument('-dc', '--display-in-console',
help='Display Found Pokemon in Console',
action='store_true', default=False)
Expand Down

0 comments on commit 5f56ee1

Please sign in to comment.