Jannyboy11 / InvSee-plus-plus

A bukkit plugin for manipulating player inventories
Other
93 stars 17 forks source link

/invsee on offline players causes their OfflinePlayer#getLastPlayed() to update #13

Closed metabrixkt closed 2 years ago

metabrixkt commented 3 years ago

When you use /invsee on some offline player, their last played time updates to the time you opened their inventory.

This also creates player's .dat file even if player has never played on the server before and person who used /invsee didn't put anything to that offline player's inventory.

Jannyboy11 commented 3 years ago

The player's .dat file is created if none exists, because one use case of this plugin is that you can already edit inventories of players even before they have logged in for the first time. Consequently, their 'last played'-time is updated too. Not really much I can do there.

Did you test whether the last-played time updated too when the player's data file already existed?

metabrixkt commented 3 years ago

Did you test whether the last-played time updated too when the player's data file already existed?

@Jannyboy11 yes, I did, it still gets updated to the time when /invsee was used (or saved? didn't test when exactly) even if player's .dat file already exists and this player exists too.

Jannyboy11 commented 3 years ago

I need to investigate whether I can fix this, but never in my own code do I write out a last-played value to the player's save-file, so I suppose this is done by the save mechanism itself. I hope to have a solution (or at least an answer) when Spigot 1.18 releases.