Catch struct errors when checking session lock.
This commit is contained in:
parent
e0f1ca1799
commit
4d1d96863b
@ -1091,7 +1091,10 @@ class MCInfdevOldLevel(ChunkedLevelMixin, EntityLevel):
|
||||
|
||||
def checkSessionLock(self):
|
||||
lockfile = self.worldFolder.getFilePath("session.lock")
|
||||
(lock, ) = struct.unpack(">q", file(lockfile, "rb").read())
|
||||
try:
|
||||
(lock, ) = struct.unpack(">q", file(lockfile, "rb").read())
|
||||
except struct.error:
|
||||
lock = -1
|
||||
if lock != self.initTime:
|
||||
raise SessionLockLost, "Session lock lost. This world is being accessed from another location."
|
||||
|
||||
|
Reference in New Issue
Block a user