9
0
mirror of https://github.com/WiIIiam278/HuskSync.git synced 2025-12-19 14:59:21 +00:00

refactor: lock user before updating user data on command

This commit is contained in:
William
2024-08-26 14:08:11 +01:00
parent a57b8df994
commit 47373d8974

View File

@@ -159,6 +159,7 @@ public class RedisManager extends JedisPubSub {
switch (messageType) {
case UPDATE_USER_DATA -> plugin.getOnlineUser(redisMessage.getTargetUuid()).ifPresent(
user -> {
plugin.lockPlayer(user.getUuid());
try {
final DataSnapshot.Packed data = DataSnapshot.deserialize(plugin, redisMessage.getPayload());
user.applySnapshot(data, DataSnapshot.UpdateCause.UPDATED);