Closed Gregwar closed 7 years ago
Looks good, nice work.
I've just confirmed that some PokeStops would still have lure_info property despite the fact that the lure effect has expired.
@BobbyWibowo All forts, including gyms, don't update when u put them. I've found a possible fix by adding self.fortInfo[fort.id] = fort; and setting fortInfo : []; then the check if (!self.forts[fort.id]) make it if(!self.forts[fort.id] || self.fortInfo[fort.id] != fort) { One problem though, when you get too far away from the fort, the location doesn't have it so it stays stuck on lured. This "fix" also makes the gym colors(and info if the PR gets accepted) change if someone took over it. One problem tho, I have to implement the removing of the marker if the fort information changes because the "fix" creates a new marker over the old one and we end up having 2 markers. I'm waiting for the web sockets to be fully implemented so that I can send far_away pokestops requests and stuff like that.
Maybe OP can implement the fix I added and fix the double marker bug?
On my latest commit to my personal repo, instead of re-creating icons, I make it update the data as necessary. It will always overwrite the stored fort data in self.forts, thus allowing extra feature such as gym info (https://github.com/OpenPoGo/OpenPoGoWeb/pull/149) to be able to display the most-recent data. But during cases such as gym, if the old owned_by_team doesn't match with the new one, it will simply change the existing icon (doesn't have to re-create) and log a message to the logs. As for PokeStop, I simply verify the expiry time. If it's already expired, then I simply update the icon to use the default one.
But I had a small issue. I had 3 bots running at the same location, but apparently their location info wasn't in-sync. So I had to implement a feature which lets user choose which bot to prioritize in case of location info clashing (if not specified, automatically prioritize the first user). So yeah, I did that. So far it's working well, but I'll be testing it a little more before I commit the changes to my personal repo.
As for old locations, to be honest I'd rather just leave them be for now.
@BobbyWibowo Looks good and neat. Mind PRing it?
The issue is, my personal repo has already been heavily modified. It was also based on wchill/refactor branch (although it's no longer as updated as the latest commit of that branch since mine is going to support PokemonGo-Bot only, thus it doesn't use those WebSocket stuff yet). So I kinda imagine that it'll be a pain to copy the implementation to the master branch and I don't have enough motivation to do exactly that, lol..
@OpenPoGo/maintainers
This is a simple change that add the lure logo on pokestops where the lure_info entry exists