OpenInv

4M Downloads

Do you have this issue?

RoboMWM opened this issue ยท 11 comments

commented

lishid#40

Also wondering if yours differs much (other than the UUID lookups mentioned in readme) since the plugin is being continued by another author.

commented

This is weird. Looks like when the player comes online our swap to them is discounted. I wonder if it's due to the fact that the PlayerJoinEvent has always been fired too early. Either way, in retrospect, my "fix" is already handled earlier in the /openinv and /openender commands, though it's a good fix to have in case any other plugin uses OpenInv's API.

commented

Not sure if you saw this PR lishid#41 - there seems to be other changes he made?

commented

Did not, no. I was already planning on removing the save from SpecialPlayerInventory#setPlayerOffline, it was redundant.

To reproduce dupe bug:

  1. Open player inventory, player can be online or offline.
  2. Log player out and back in
  3. Have player make any inventory modifications and log out - dump items, etc. This is where the issue is - when a player comes back online, their inventory is no longer tied to the inventory being viewed.
  4. Close open inventory to set viewed inventory's contents to player's current

It's not as simple as just saving post-quit or I'd have it fixed by now. There's some issue with how I'm setting the item arrays. I've already added setting PlayerInventory.g, which was a missed case on my part from before, but that's apparently not enough.

commented

Found the fix. We never updated the owner of the PlayerInventory.

commented

Backporting the fix to all previous versions and making an interface change to reduce duplicate saves. There'll be a new release out shortly.

commented

I would assume that that's still an issue in my fork, though I haven't noticed it myself. I'll look into what could be causing it if I can reproduce it.

My fork supports all past versions aside from pre-versioned-package CB, which the current version of OpenInv does not. I'm not up on what else the current author has done because of the awful commit messages and general horrible git usage, but as for other features, the updater is gone for obvious reasons and the OpenInv wand is removed because all it did was run the command for the user - there was no way to enable the wand without also allowing command access. I also do not support partial offline name matching, which was the main cause of lookup lag in the original.

Edit: Based on the ticket, I suspect that the player loader is loading player.dat even when the player is online. If that's it, it'll be a simple enough fix.

commented

I'll leave this open till I have time to test it, but it should be fixed.

commented

Thanks! Also wondering if possible to potentially disable the editing part, as I primarily use this to view inventories (considering that this bug did not require the inventory to be modified), as a mitigation for future issues.

commented

That's permission-based, that feature's in the main branch as well.
OpenInv.editinv for editing player inventories, OpenInv.editender for ender chests.

commented

Well I meant programmatically, since

this bug did not require the inventory to be modified

Unless it wouldn't occur for those who have OpenInv.editinv negated?

commented

Ah, no saving entirely? More complex for me than the main branch because I removed all of the static access, but still probably quite doable. Created #6 for my own sanity