-
Notifications
You must be signed in to change notification settings - Fork 90
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
Dynamic filters! #914
Merged
Merged
Dynamic filters! #914
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Electroid
requested changes
Aug 23, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool to see both of your work on this. I've done a high-level pass, but we'll need some more reviews
core/src/main/java/tc/oc/pgm/filters/dynamic/FilterMatchModule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/tc/oc/pgm/filters/dynamic/FilterMatchModule.java
Outdated
Show resolved
Hide resolved
core/src/main/java/tc/oc/pgm/filters/dynamic/FilterMatchModule.java
Outdated
Show resolved
Hide resolved
Pablete1234
reviewed
Aug 23, 2021
Pablete1234
reviewed
Aug 23, 2021
Pablete1234
reviewed
Aug 23, 2021
Pablete1234
reviewed
Aug 23, 2021
core/src/main/java/tc/oc/pgm/filters/dynamic/FilterMatchModule.java
Outdated
Show resolved
Hide resolved
Pablete1234
reviewed
Aug 23, 2021
core/src/main/java/tc/oc/pgm/filters/dynamic/FilterMatchModule.java
Outdated
Show resolved
Hide resolved
#836 Can be recreated after this PR is merged |
KingOfSquares
force-pushed
the
dynamic-filters
branch
from
September 1, 2021 09:47
9cd9074
to
1b9be1d
Compare
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
- Also removed MatchPlayerState as a filterable. Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Co-Authored-By: KingOfSquares <[email protected]> Signed-off-by: KingSimon <[email protected]>
Co-Authored-By: KingOfSquares <[email protected]> Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
- formatting included Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
… loaded Signed-off-by: KingSimon <[email protected]>
…trary events Signed-off-by: KingSimon <[email protected]> squASH Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]> Scope MethodHandle creating to Entityy instead of PLayer Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
- Also remove illegal symbol :( Signed-off-by: KingSimon <[email protected]>
- Change semantics in MultiFilterFunction#getRelevantEvents Signed-off-by: KingSimon <[email protected]>
KingOfSquares
force-pushed
the
dynamic-filters
branch
from
September 1, 2021 09:50
1b9be1d
to
c618a30
Compare
- Move some methods from interface to implementation Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
Electroid
reviewed
Sep 4, 2021
Signed-off-by: Pugzy <[email protected]>
KingOfSquares
commented
Sep 15, 2021
Signed-off-by: KingSimon <[email protected]>
Signed-off-by: KingSimon <[email protected]>
KingOfSquares
force-pushed
the
dynamic-filters
branch
from
September 28, 2021 16:01
584c96f
to
598c197
Compare
Pablete1234
approved these changes
Sep 30, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dynamic filters 🔮:tada:
This PR proposes an implementation of the dynamic filter concept originally introduced in ProjectAres.
In addition it also comes bundled with:
#getQuery
since they now implementFilterable
(which means that the objects implement the query instead)After this PR any feature in PGM can register FilterListeners through
#onChange/onRise/onFall
which will enable the feature to be able to trigger functionality whenever a dynamic filter matches/unmatches its condition.From the outside, the functionality of dynamic filters is quite similar to how it was in ProjectAres with one exception. Filters now have to override
#getRelevantEvents
and declare which events should be listened to that could change a filters opinion on someone (e.g. if KillStreakFilter is used MatchPlayerDeathEvent should be listened for because that might change a filters opinion on a player). If it does not override the method the filter is regarded as non-dynamic.On the inside (inside
FilterMatchModule
) there have been changes from how ProjectAres solved it.Before,
FilterMatchModule
would listen for a set of hardcoded events (here) and invalidate players/the match whenever those events where called.In this PR, the module only listens for events that the filters say are relevant (
Filter#getRelevantEvents()
). If multiple filters need the same event it is only listened for once.This new approach enables more types of filters to be dynamic, and allows the module to be more precise in when to invalidate someone.
In addition to all the old dynamic filters (excluding the time filter) the following filters are now dynamic:
Also, all filters with children(also query modifiers) are dynamic if their child(ren) are
@Electroid Please remember to credit both me and Pugzy in the final commit
The testing of these changes was powered by the diamyx-pack