Created
April 30, 2013 02:53
-
-
Save riking/5486343 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void checkSession() throws ExceptionWorldConflict { // CraftBukkit - throws ExceptionWorldConflict | |
try { | |
File file1 = new File(this.baseDir, "session.lock"); | |
DataInputStream datainputstream = new DataInputStream(new FileInputStream(file1)); | |
try { | |
if (datainputstream.readLong() != this.sessionId) { | |
throw new ExceptionWorldConflict("The save is being accessed from another location, aborting"); | |
} | |
} finally { | |
datainputstream.close(); | |
} | |
} catch (IOException ioexception) { | |
throw new ExceptionWorldConflict("Failed to check session lock, aborting"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment