Refactor join logic & add support for squads #1136
Merged
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.
This Implements a relatively big refactor to the join logic in PGM, which makes it more flexible and easier to maintain. We no longer have different codepaths for join, force-join, team switch kit (which adds a title when joining) etc. They now instead all route thru queryJoin & join, but with a JoinRequest, which decides how this player is allowed to join.
You may now join a player to join with FORCE perms (even if they don't have those themselves) and the whole join process will respect that, EVEN after the join occurs (ie: if a re-balance occurs, or a priority-kick occurs, a forced player won't be kicked out). Before this behavior would be dependant on the users' permissions instead of on what "flags" it used to join.
Ontop of that, it adds support for Squads. These are a new pgm integration to be handled by 3rd party plugins, where PGM has very little logic to support them (expect Community to have support for them very soon). Players in the same squad will see eachother listed higher in the tablist, and underlined.