feat: drop offline player's mutex lock

This commit is contained in:
xtex 2023-07-26 16:48:13 +08:00
parent 30187548bb
commit 27ba95e312
Signed by: xtex
GPG Key ID: B918086ED8045B91

View File

@ -16,7 +16,9 @@ object ProjectionShellMutex {
val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`() val mutex = (server as ProjectionShellMutexAccessor).`quaedam$getProjectionShellMutex`()
val currentTime = System.currentTimeMillis() val currentTime = System.currentTimeMillis()
mutex.forEach { (pos, lock) -> 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) mutex.remove(pos)
ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket) ProjectionShell.channel.sendToPlayer(lock.player, ClientboundPSHLockRevokePacket)
} }