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
|
|
||
| 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.
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.
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
|
|
||
| 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.
The new end_time is only being sent to webhook and not written to the database?
There was a problem hiding this comment.
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
|
|
||
| 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.
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.
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.
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.
Should that not be 2700 instead of 6300?
The db routine works from "hatch time"
There was a problem hiding this comment.
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