AuthMe / AuthMeReloaded

The best authentication plugin for the Bukkit/Spigot API!
https://www.spigotmc.org/resources/authmereloaded.6269/
GNU General Public License v3.0
618 stars 514 forks source link

Player lost their item #2855

Open SimPham02 opened 1 month ago

SimPham02 commented 1 month ago

What behaviour is observed?

Sometimes players exit the server with all their items, but when they rejoin, all their items are gone. The server is running Purpur 1.21.

Expected behaviour

Fix the issue so players no longer lose their items.

To Reproduce

1.Exit the server 2.Log back in

Plugin list

image

Server Implementation

Standalone server (no proxy)

Database Implementation

SQLite

AuthMe Version

2.6.0

Error log (if applicable)

No response

Configuration

https://paste.gg/p/anonymous/5b9aecd47db0424dbd80a13c6ee0370b

sgdc3 commented 1 month ago

@games647 correct me if I'm wrong but we never change the inventory content of the player, we only hide it using fake packets.

games647 commented 1 month ago

Yes that's correct. However, somehow this is version 2.6. @SimPham02 can you check if this really the correct version.

SimPham02 commented 1 month ago

Yes that's correct. However, somehow this is version 2.6. @SimPham02 can you check if this really the correct version.

AuthMe-5.6.0-legacy and authme-5.7.0-SNAPSHOT

SimPham02 commented 1 month ago

When I use version 5.6.0, it only happens occasionally, but when I use version 5.7.0, it happens more frequently @games647

SimPham02 commented 1 month ago

At first, I didn't know what caused it; I thought it was due to version 1.21. However, a few other servers also experienced the issue and said it was caused by AuthMe

games647 commented 1 month ago

We only hide the inventory from the user. So all items are still there. A relogin should also show this. Another issue could be if the user profile switches the UUID, then it's a new user. However, AuthMe doesn't change anything about this. You could also disable ProtectInventoryBeforeLogIn, that will disable our hide feature.

SimPham02 commented 1 month ago

We only hide the inventory from the user. So all items are still there. A relogin should also show this. Another issue could be if the user profile switches the UUID, then it's a new user. However, AuthMe doesn't change anything about this. You could also disable ProtectInventoryBeforeLogIn, that will disable our hide feature.

It wasn't hidden; I've been using AuthMe for almost a year, and when I updated to version 1.21 and used the latest version of AuthMe, this issue started occurring. In some cases, items in the ender chest also disappeared. My server is cracked, and the in-game behavior remained unchanged. Even I lost items, despite being the server admin. I just logged out and back in immediately, and the items were gone. I noticed this issue often occurs when logging out and back in quickly. My friend, who runs a server on version 1.20, is also experiencing similar issues.

t4ba commented 1 month ago

i had this issue when im running 1.20.4 now running 1.20.6 some players lost their inv and endchest and spawn on world spawn point

authme version 5.7.0

JericNisperos commented 1 month ago

Same goes with me. We started experiencing this since the first day of our server last June 1st. We're on 1.20.6 before. We are now on 1.21 and still happens occasionally.

We've reached out to other plugin devs and even stripped down our plugin list to check what's causing it. There's a high chance that this is coming from AuthMe, CMI, Worldedit,Worldguard,Multiverse. But since some of the server owners I talked to don't use CMI,Multiverse, and even Worldedit, the only plugins left are AuthMe and Worldguard.

The reset inventory includes wiped Enderchest, reset Crafting Recipes and being teleported to the world spawn.

krusic22 commented 1 month ago

WorldGuard hard depends on WorldEdit.... We need an actual plugin list.

Kadeluxe commented 1 month ago

I've figured this out. In 1.21 server loads the player's profile after ServerboundFinishConfigurationPacket is received. If connection is unstable, this packet may not land on the server and PlayerList.placeNewPlayer will never be called image

However later when connection is timed out, quit events are still fired and AuthMe will save an empty player data here: https://github.com/AuthMe/AuthMeReloaded/blob/536af46b2b971355c9bdb90eccf357e697fed5cf/src/main/java/fr/xephi/authme/process/quit/ProcessSyncPlayerQuit.java#L30

I don't know what the "proper" fix would be here because I'm not familiar with AuthMe internals. It can be fixed by doing a if (player.getLastLogin() != 0) check but AFAIK this API is only exposed on Paper. So if you can rebuild from source, build AuthMe against Paper API and insert this check: if (player.getLastLogin() != 0) player.saveData();

Lolip-p commented 1 month ago

Yes. I also ran into this problem!

Krissoofer commented 1 month ago

@Kadeluxe Have you fixed it already?

sgdc3 commented 1 month ago

Please try with build 2632 from out jenkins (https://ci.codemc.io/job/AuthMe/job/AuthMeReloaded/)

unnamed199cz commented 1 month ago

EDIT: WRONG call, Newest build may not have the issue

unnamed199cz commented 1 month ago

edited ^^ due to mistake on our server

ghost commented 2 weeks ago

Hello, we run a minecraft server that's also been dealing with the exact same issue. Seems to be AuthME as well, since our other server which runs on the same config (but isn't in offline mode) hasnt ever encountered this bug.

sgdc3 commented 2 weeks ago

@CyberHydra have you tried the latest dev build from https://ci.codemc.io/job/AuthMe/job/AuthMeReloaded/ ?

ghost commented 2 weeks ago

@CyberHydra have you tried the latest dev build from https://ci.codemc.io/job/AuthMe/job/AuthMeReloaded/ ?

We've installed it right now. Hopefully it will fix the issue. I'll keep you informed.

sgdc3 commented 1 week ago

@SimPham02 @t4ba @JericNisperos @Kadeluxe @Lolip-p @Krissoofer @unnamed199cz @CyberHydra is the issue fixed in dev builds?

ghost commented 1 week ago

@SimPham02 @t4ba @JericNisperos @Kadeluxe @Lolip-p @Krissoofer @unnamed199cz @CyberHydra is the issue fixed in dev builds?

This seems to be the case for our server. I've not heard of this bug happening anymore.