Skip to content

Fix Excluded By Rarity to work with new Dynamic Rarity changes#2489

Open
trunksbomb wants to merge 3 commits intoRocketMap:developfrom
trunksbomb:master
Open

Fix Excluded By Rarity to work with new Dynamic Rarity changes#2489
trunksbomb wants to merge 3 commits intoRocketMap:developfrom
trunksbomb:master

Conversation

@trunksbomb
Copy link
Copy Markdown
Contributor

excludedPokemon is now used as a global list of excluded Pokemon, made up of any number of individual exclusion lists (rarity and hidden, for now)
In accordance with the above two points, refactored all code that controls excluding Pokemon, including adding new functions to help add/remove from list
Fixes Issue #2470

Description

Exclude By Rarity was introduced prior to the Dynamic Rarities change, which changed the way the excluded Pokemon list was sent to the server. This change broke Exclude By Rarity as described in Issue #2470 because the excluded Pokemon by rarity were not sent to the server and so the server sent back the entire list of nearby Pokemon.
Additionally, this PR sets the stage for additional exclusion lists to be easily implemented (such as by generation, or by weather boosted, etc).

Motivation and Context

Fixes issue #2470
New functions abstract excluding/including away from the main logic of decided what to exclude/include.
Moving forward, it should be easier to integrate new exclusion lists.

How Has This Been Tested?

Tested on my live city map. Can switch between all rarity tiers reliably (although reducing the rarity filter doesn't repopulate quickly, moving the map will cause an update to reinclude Pokemon) and exclude/include individual Pokemon.
Map still loads all visible Pokemon on initial load, which can be a lot if clustering is disabled, because the first fetch request goes out before the rarity filter is processed.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Copy link
Copy Markdown
Member

@sebastienvercammen sebastienvercammen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failing Travis.

/home/travis/build/RocketMap/RocketMap/static/js/map.js
  2844:29  error  'pokemonRarities' is not defined                                              no-undef
  2845:32  error  'pokemonRarities' is not defined                                              no-undef
  2846:50  error  'pokemonRarities' is not defined                                              no-undef
  2850:13  error  Closing curly brace does not appear on the same line as the subsequent block  brace-style

trunksbomb and others added 3 commits March 6, 2018 13:44
…m to excludedPokemonByRarity

excludedPokemon is now used as a global list of excluded Pokemon, made up of any number of individual exclusion lists (rarity and hidden, for now)
In accordance with the above two points, refactored all code that controls excluding Pokemon, including adding new functions to help add/remove from list
Fixes Issue RocketMap#2470

Signed-off-by: trunksbomb <[email protected]>
Still says a curly bracket at line 2850 doesn't end on the same block, but it does. Also that pokemonRarities isn't defined, but it is, just in map.common.js

Signed-off-by: trunksbomb <[email protected]>
@sebastienvercammen
Copy link
Copy Markdown
Member

Author is unresponsive, so I rebased and pushed a fix for Travis. Note: this doesn't serve as my review or approval.

Copy link
Copy Markdown
Contributor

@Alderon86 Alderon86 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Working like it should.
Set rarity update to 1 minute and it execluded the updated mons like it should do. 👍

Copy link
Copy Markdown
Contributor

@fosJoddie fosJoddie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks to do the job to me, I can mix exclude by rarity and exclude by pokemon filter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants