Monocle
Monocle copied to clipboard
Raids [BACKEND ONLY]
Raid infos are implemented, feel free to add this fuctionnality on the frontend (I'm just using a personnal discord bot)
Table fort_raids Fields :
- id = Column(Integer, primary_key=True)
- fort_id = Column(Integer, ForeignKey('forts.id'))
- raid_seed = Column(Integer)
- raid_battle_ms = Column(Integer, index=True)
- raid_spawn_ms = Column(Integer, index=True)
- raid_end_ms = Column(Integer, index=True)
- raid_level = Column(Integer)
- complete = Column(TINY_TYPE)
- pokemon_id = Column(TINY_TYPE)
- cp = Column(TINY_TYPE)
- move_1 = Column(SmallInteger)
- move_2 = Column(SmallInteger)
pokemon_id,cp,move_1 and move_2 are updated when raid battle starts
Can you do a rebase with whitespace / newline fix? It is very difficult to review as is.
Everything should be stable now. Tell me if you still have some troubles
I'm not sure why it happens, but when I run locally on my windows pc, it works fine. However when I run this on my ubuntu server it doesn't write to the mysql database. when I stop scan.py it has a huge backlog of items it still wants to push to the DB. It works fine without this addition however.
So it looks like it isn't able to write the data to the fort_raids table (because that stays empty) and that is clogging upp the writing to the DB.
Can you drop fort_raid table, rerun create_db and retest it plz? (Don't forget to pull the lastest version of the PR)
Removing everything and reinstalling it all seems to have worked. However, the update function seems to be clogging it all up now. On a fresh database everything works fine. but as soon as it tries to update an entry to include the raid boss, it blocks up the DB again.
Corrected notifDiscord ;) Sorry for that
I just want to make sure that this will work with SPAWN_ID_INT = false
?
Ok Im testing this out and Im getting a bunch of MySQL errors when the raid hasn't started yet since move_1, move_2, etc can not be "None" since they are smallint according to your specs, so the only thing that can be saved at this point are actual raid battles, not raid eggs.
Update 1: Ok I set it so that those fields could be NULL and that fixed that problem. My raid seed is a negative number.. is that correct?
Yep the raid_seed is a negative number for what i saw
@sebast1219 Im unsure if I have the proper MySQL column types, do you have a create table that I can compare to? Also as I've been running this it doesn't seem like the raids are updated. I get when the initial raid is going to start, so all the moves, etc are NULL, but they never update to the actual raid info when it starts. I have a bunch of NULL in the database and only a very few that actually have the raid info after it has started, but I have a feeling that it was the first time it put those raids in the database and the raid was going when that happened.. so basically it doesn't seem to be updating the raid info. Also is there a way to keep track of when a raid is going to start and then deploy an account to get the raid info, just like a spawnpoint TTL?
@sebast1219 I know I asked on the gym one, but maybe a combo of gym and raid webhook? So when a gym changes teams and also when a raid is announced and starts?