Monocle icon indicating copy to clipboard operation
Monocle copied to clipboard

Raids [BACKEND ONLY]

Open sebast1219 opened this issue 7 years ago • 11 comments

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

sebast1219 avatar Jun 26 '17 08:06 sebast1219

Can you do a rebase with whitespace / newline fix? It is very difficult to review as is.

j16sdiz avatar Jun 26 '17 17:06 j16sdiz

Everything should be stable now. Tell me if you still have some troubles

sebast1219 avatar Jun 27 '17 10:06 sebast1219

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.

NiliusJulius avatar Jun 27 '17 10:06 NiliusJulius

Can you drop fort_raid table, rerun create_db and retest it plz? (Don't forget to pull the lastest version of the PR)

sebast1219 avatar Jun 27 '17 10:06 sebast1219

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.

NiliusJulius avatar Jun 27 '17 13:06 NiliusJulius

Corrected notifDiscord ;) Sorry for that

sebast1219 avatar Jun 27 '17 15:06 sebast1219

I just want to make sure that this will work with SPAWN_ID_INT = false ?

baskettcase avatar Jun 27 '17 18:06 baskettcase

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?

baskettcase avatar Jun 27 '17 19:06 baskettcase

Yep the raid_seed is a negative number for what i saw

sebast1219 avatar Jun 28 '17 07:06 sebast1219

@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?

baskettcase avatar Jun 29 '17 16:06 baskettcase

@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?

baskettcase avatar Jun 30 '17 18:06 baskettcase