Bentobox: Island owner inventory deletion on /is team kick

Created on 5 Feb 2019  路  6Comments  路  Source: BentoBoxWorld/BentoBox

Description
Island owners inventory gets resetted when member is kicked out of the team.

Steps to reproduce the behavior:

  1. Bskyblock config:
    on-join: money: false inventory: true ender-chest: false on-leave: money: false inventory: true ender-chest: true
  2. Player 'dcAnt' joins player 'acBee's island.
  3. See http://prntscr.com/mgzcgm , acBee has some items.
  4. Players 'acBee' kicks 'dcAnt' from island using /is team kick
  5. acBee's inventory is cleared, see: http://prntscr.com/mgzgci

Expected behavior
Only the members that join/leave/get kicked shall be affected with the configuration above, and not owners.

Server Information:

  • Database being used:
    MySQL
  • OS:
    Debian GNU/Linux 9

  • Java Version:
    Java(TM) SE Runtime Environment 18.3 (build 10.0.1+10)
    Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10.0.1+10, mixed mode)

    • BentoBox version:
  • Addons:

    • Other plugins?

  • [06:32:17 INFO]: Plugins (50): AnimatedNames, AreaShop, ArmorStandTools, BentoBox, BungeeTabListPlus, ChatControl, ChestCommands, ChestShop, ClearLag, CrateReloaded, EditableSign, Essentials, EssentialsChat, EssentialsSpawn, ExecuteEverywhere, FastAsyncWorldEdit, FeatherBoard, HeadDatabase, HolographicDisplays, HungerKeeperPlus, IPWhitelist, IslandBorder, LeaderHeads, LibsDisguises, LuckPerms, MobManager, Multiverse-Core, MVdWPlaceholderAPI, NickRemover, NoSleepCMDs, OpenInv, PlayerHeads, PlayerPoints, ProtocolLib, PvPManager, PvPManagerBossBar, RedstoneClockDetector, RPGHealthIndicator, SilkSpawners, SkinsRestorer, Spartan, TradeMe, TrophyHeads, UnbreakingAnvils, Vault, VoidGenerator, WorldEdit, WorldGuard, WorldGuardPistonFix, Yamler

Localhost:

  • Plugins:
  • Addons:
    Additional context
  • acBee(s) inventory did not reset if dcAnt used /is team leave. Happened only when the member was kicked out from the team.
  • Last test of this was done on localhost on my PC (The above one)
  • First time when we noticed this on our server, we immediately turned off these features, because players had already started losing their items. We didn't want to test again on a live server and in the meantime this was forgotten. Now when I remembered I decided to start it on my PC to test and report, and it's still a bug.
  • Tested it only with 2 players on island, not sure what happens if more are present.
  • Since the configuration file for these settings is found in BSkyBlocks addon folder, I thought that this issue shall be placed in the BSB section.
Done Bug

All 6 comments

Thanks for your report, but this is a BentoBox bug! I'll move the issue :wink:

Okay, I can confirm it's occuring - no need to test it on a fresh install:
https://github.com/BentoBoxWorld/BentoBox/blob/f71ca4f0847593dad1cc751a96a3c2b6a298d267/src/main/java/world/bentobox/bentobox/api/commands/island/team/IslandTeamKickCommand.java#L74-L80

The user shouldn't be used there - it should be the target.

I just fixed the bug - at least the island owner's no longer losing his stuff. However, the member that gets kicked does not get his inventory/enderchest resetted if he's offline at that moment.
@tastybento Could you please have a look at that? I've also @Ignore'd the unit test responsible for checking this. That's pointless to rewrite it as long as we do not have the final solution to this problem.

I'll keep this issue opened so we can monitor it. I'm also assigning you to it if you don't mind, tasty.

@Poslovitch To be able to remove items from the offline player will take some handling. We will need to track in the database a list of offline kicked players and then when they log back in, remove their stuff when they are in the appropriate game world. I'm concerned about edge cases and race conditions. We'll have to think them through. For example:

Standard path

  1. Alice and Bob are in a team
  2. Alice goes to another world, Alice logs off
  3. Bob kicks Alice off the team
  4. Alice logs in (her inventory must not be cleared)
  5. Alice tp's to the island world - her inventory should be cleared.

Alternatives

  1. Charlie invites Alice to his team
  2. Alice accepts - her inventory should be cleared at that point

or

  1. Alice starts her own island
  2. Inventory should be cleared.

Any others?

We'll need to assume that the Admin is running a per-world inventory system.

There are always an ability to use NMS to modify offline player inventories :)

NMS is not an option. That's a hassle to maintain.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Michel-0 picture Michel-0  路  5Comments

leonardochaia picture leonardochaia  路  5Comments

Bobbbe picture Bobbbe  路  5Comments

doitliketyler picture doitliketyler  路  3Comments

LegacyGamerHD picture LegacyGamerHD  路  6Comments