Skip to content
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

Users can invite more than his limit approves #1690

Closed
DJIronic opened this issue Feb 25, 2021 · 2 comments · Fixed by #1691
Closed

Users can invite more than his limit approves #1690

DJIronic opened this issue Feb 25, 2021 · 2 comments · Fixed by #1691
Assignees
Labels

Comments

@DJIronic
Copy link

Description

Describe the bug

This issue allows to invite more user than your limit is. So if the player has maxsize of 2, he can invite more.

Steps to reproduce the behavior

  1. Join your island
  2. invite player
  3. then invite another player ASAP (before the first accepts is)
  4. then invite another player ASAP (before ANYONE accepts is)
  5. ....and so on

Expected behavior

Player that were invited should not be added to the team, if the teamlimit of the owner is already full. Their invites should be discarded.

Screenshots and videos

Oneblock:
image

Skyblock:
image

Environment

Output of /bbox version (Mandatory)

> bbox version
[20:46:21 INFO]: Běžím na Neplatné (IGOT) Neplatné.
[20:46:21 INFO]: Verze BentoBox: 1.15.5
[20:46:21 INFO]: Databáze: MARIADB
[20:46:21 INFO]: Načtené herní světy:
[20:46:21 INFO]: bskyblock_world (BSkyBlock): Svět, Nether, End
[20:46:21 INFO]: oneblock_world (OneBlock): Svět, Nether*
[20:46:21 INFO]: Načtené doplňky:
[20:46:21 INFO]: AOneBlock 1.4.6 (ENABLED)
[20:46:21 INFO]: BentoBox-InvSwitcher 1.6.1 (ENABLED)
[20:46:21 INFO]: Biomes 1.14.0 (ENABLED)
[20:46:21 INFO]: BSkyBlock 1.14.3 (ENABLED)
[20:46:21 INFO]: Challenges 0.8.3 (ENABLED)
[20:46:21 INFO]: Chat 1.1.2 (ENABLED)
[20:46:21 INFO]: ControlPanel 1.7.0 (ENABLED)
[20:46:21 INFO]: DimensionalTrees 1.6.0 (ENABLED)
[20:46:21 INFO]: Level 2.5.1 (ENABLED)
[20:46:21 INFO]: Likes 2.0.0 (ENABLED)
[20:46:21 INFO]: Limits 1.15.2 (ENABLED)
[20:46:21 INFO]: Warps 1.10.2 (DISABLED)

Plugins (Optional)

Plugins (27): AAC5, AutoPluginLoader, BentoBox, dynmap*, Essentials, GSit, HolographicDisplays, Images, LuckPerms, MaSuiteCore, MaSuiteHomes, MaSuitePortals, MaSuiteTeleports, MaSuiteWarps, NamelessMC, NetworkManager, PlaceholderAPI, ProtocolLib, spark, TAB-BukkitBridge, Vault, VoidGenerator, WorldEdit, WorldGuard, WorldGuardExtraFlags

@BONNe
Copy link
Member

BONNe commented Feb 25, 2021

I was planning to fix it, but then I notice one large issue.

My fix can be bypassable if the island owner invites players to the team and logout. BentoBox does not offer permission checks for offline players, and team size is defined only by owner permission.

This means that we should either handle permissions for offline users or rethinking the ways how permissions are applied and used.

I could suggest storing permissions on island objects. When the owner login, these permission values are updated.
This would solve an issue with offline users.

Any thoughts @tastybento and @Poslovitch

@tastybento
Copy link
Member

With PR #1689 I not only added the homes to the Island object, but also the max number of homes to it. This was for the same reason as this issue - the island should "know" its own limits and not rely on dynamic checking of permissions. The permissions can still be checked and used to update the Island object both when the owner logs in or during invite operations (invite and acceptance), but the max member value should decide whether the invite can be accepted or not.

So, here's my suggestion - let's do a PR where we add max members to the Island object (and max homes). Then the team code can be adjusted to use this value and update it based on player perms. The login listener can be adjusted to update the value.

@tastybento tastybento added Status: Under investigation Investigating the interest and the feasability of the issue. Type: Bug labels Feb 26, 2021
@tastybento tastybento added Status: In progress Working on the issue. and removed Status: Under investigation Investigating the interest and the feasability of the issue. labels Feb 27, 2021
tastybento added a commit that referenced this issue Feb 27, 2021
* Adds maxMembers to the Island object for persistent storage

#1690

* Expanded approach to include coop and trusted ranks.

* Checks for max members/coops/trusts on accept based on island setting.

* Write island max member/coop/trusted if owner joins server

This updates the island's settings based on the owner's permissions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants