From 27ba95e3127cf53a63eb6b5cc8be368e9ef3ba05 Mon Sep 17 00:00:00 2001 From: xtex Date: Wed, 26 Jul 2023 16:48:13 +0800 Subject: [PATCH] feat: drop offline player's mutex lock --- common/src/main/kotlin/quaedam/shell/ProjectionShellMutex.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/kotlin/quaedam/shell/ProjectionShellMutex.kt b/common/src/main/kotlin/quaedam/shell/ProjectionShellMutex.kt index af48f68..1dbfcb9 100644 --- a/common/src/main/kotlin/quaedam/shell/ProjectionShellMutex.kt +++ b/common/src/main/kotlin/quaedam/shell/ProjectionShellMutex.kt @@ -16,7 +16,9 @@ object ProjectionShellMutex { val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`() val currentTime = System.currentTimeMillis() mutex.forEach { (pos, lock) -> - if (currentTime - lock.time > 60 * 1000) { + if (lock.player !in server.playerList.players) { + mutex.remove(pos) + } else if (currentTime - lock.time > 60 * 1000) { mutex.remove(pos) ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket) }