-
Notifications
You must be signed in to change notification settings - Fork 16
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
Misc. Changes #23
base: master
Are you sure you want to change the base?
Misc. Changes #23
Conversation
HexKing74
commented
Sep 4, 2018
- Configurable "working dir"
- Change webhook to send actual type (egg or raid)
- Change webhook to resend when changing from egg to raid
- Parse end time from hatched raids when not previously scanned as egg
…ng & re-send of webhook when changing from egg to raid
raidnearby.py
Outdated
@@ -658,6 +680,8 @@ def processRaidImage(self, raidfilename): | |||
|
|||
pokemon_id = database.get_raid_pokemon_id(session, gym) | |||
end_time = database.get_raid_time(session, gym) | |||
if end_time == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to be
if end_time < unix_time:
end_time will be previous raid end time for most people with RDRM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
right. because the gym may have had a previous raid and that old value will be returned. hadn't thought about that one. just started using this and we don't get many raids in my county
raidnearby.py
Outdated
@@ -658,6 +680,8 @@ def processRaidImage(self, raidfilename): | |||
|
|||
pokemon_id = database.get_raid_pokemon_id(session, gym) | |||
end_time = database.get_raid_time(session, gym) | |||
if end_time == 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new end_time is only being sent to webhook and not written to the database?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You would probably need to modify one of the database methods (maybe update_raid_mon), or add a new one, and pass the value. I'm only using this code for webhooks so I didn't notice the DB wasn't already being updated
Need to add USE_RAIDBOSS_TIMER to config.example.py
default to PGSS home
@@ -758,21 +787,10 @@ def processRaidImage(self, raidfilename): | |||
|
|||
def send_webhook(self, fort_id, lvl, poke_id, end, type_): | |||
battle_start = end | |||
if fort_id in wh_send_dict: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need someone to review these send_webhook changes.
form = wh_send_dict[fort_id]["form"] | ||
wh_send_dict[fort_id]["poke_id"] = poke_id | ||
#Need to resend the webook if changing from egg to raid, or if raid is from a different time | ||
if fort_id in wh_send_dict and wh_send_dict[fort_id]["end"] == end and wh_send_dict[fort_id]["type"] == type_: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
end
is not in the wh_send_dict
this would lead to a KeyError
you first have to add it in line 807-817
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I missed that when I was copying my changes to the github clone
raidnearby.py
Outdated
end_time_temp = self.getEndTime(file_update_time, time_text) | ||
if end_time_temp != -1: | ||
end_time = end_time_temp | ||
hatch_time = end_time - 6300 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should that not be 2700 instead of 6300?
The db routine works from "hatch time"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. It’s hatch_time, so 2700.
While testing the boss timer changes yesterday and today Pokealarm is encountering errors while receiving egg payloads. Something has improper values. 2018-09-09 07:31:29,982 [DEBUG][ pokealarm][ webserver] Received 1 event(s) from my.ip.was.here. |
Apparently I missed adding both of the items to the dict
Rolled back Raid Egg webhook for PokeAlarm compatibility