-
Notifications
You must be signed in to change notification settings - Fork 62
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
Added Pokestops #149
base: forts
Are you sure you want to change the base?
Added Pokestops #149
Conversation
Following the logic for Gyms, now scans for pokestops and reports lured pokemon.
Is there any way to apply your PR from windows using TortoiseGit? |
The 'L' does not imply Integer.... Fixed an issue with the adding of lure pokemon Fixed the timestamp on the lure pokemon Adjusted the map queries to be more agnostic of the sql engine (tested on mssql)
I'm not very skilled in git... so i don't know enough to say one way or another, but i would imagine so? I might be able to do a push request to your fork if you'd like... |
I got it working using a .patch file, but thank you for your offering :) |
fixes an issue on db engines that respect constraints
I think that should be fixed now. It is currently updating lure info with the pokemon as long as a worker can see it. |
I appreciate the PR, thanks. But most probably I won't be merging it, as I see no purpose in gathering data about pokestops. I felt the same way about gyms until someone convinced me that it may be purposeful to do it and analyze/display Gyms data over time. There are a lot of variables there: ownership, guarding Pokemon, prestige... which means you can do lot of things with the data. But pokestops? You can only check whether they have lure module and what spawned there, and that seems boring. I'll leave the PR open in case anyone wants to use it. |
I would really love to see lured pokestops on the map, makes it a lot easier when you plan your trip to walk around town. |
I'm planning to analyze the lure hot spots around my area... We have two distinct zones that are always lured and they seem to have a theme of pokemon, and lately have been dropping rare stuff at certain hours. I will continue to update the PR for others. |
Thanks alot, I would love to help, but I'm only a network admin and have literally no idea of python :) I'm just glad I can run a community site for a lot of users here because of you guys. |
Last_Modified does not update when the lure expires, changed the query to account for that. Changed the report queries to work with MSSQL (Hopefully i'm using pretty standard sql, but might break on other engines...)
I'm also planning to analyze the lured pokestops, in my town there aren't many pokestops, and usually there is like 1 or 2 pokestops lured, with the gathered data I could easily know which is the most lured one |
Hi I was trying to check out your pull request locally, I got a conflict in db.py where i removed the old def get_forts(session) sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1582, "Incorrect parameter count in the call to native function 'datediff'") [SQL: "\n SELECT\n ss.stop_id,\n ss.id,\n ss.lure_expires_timestamp_ms,\n ss.encounter_id,\n ss.active_pokemon_id,\n ss.last_modified,\n s.lat,\n s.lon\n FROM stop_sightings ss\n\t\t\tinner join (SELECT max(id) as maxid, stop_id, max(lure_expires_timestamp_ms) as ltime, max(sighting_time) stime from stop_sightings\n\t\t\twhere dateadd(mi, datediff(mi, getutcdate(), getDate()), dateadd(S, lure_expires_timestamp_ms, '1970-01-01')) > getdate() or lure_expires_timestamp_ms = 0\ngroup by stop_id) mss on ss.id = mss.maxid\n JOIN stops s ON s.id=ss.stop_id\n ORDER BY ss.last_modified DESC\n "] I'm using mysql and it works with normal with the master branch. |
You need to recreate your sqlfile
|
I tried, I even dropped the whole database and created new tables with import db, but still the same error :( |
looks like datediff is different between mssql and mysql... mssql takes 3 parameters where as the mysql function takes 2... you'll have to modify the code for mysql... |
Well thanks, but I guess I have to live without pokestops then I dont want to install a windows machine for that. Unless you take donations for implementing mysql :) |
SELECT I think will work, i don't have mysql to test but the funcitonality should be good This replaces the query in db.py get_stops |
For MySQL you have to use UNIX_TIMESTAMP() instead of CURRENT_TIMESTAMP because the latter gives you a formated string and the query never returns lured stops |
@skarlath this is only showing the stop as lured for the short period of time when such lure spawned a pokemon and a worker was near it, so it only appears lured for 1-2mins. Is this the intended behavior or am i missing something? |
Following the logic for Gyms, now scans for pokestops and reports lured
pokemon.