mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
Implement the server.lock file
This commit is contained in:
parent
90048d5a4c
commit
632f108ad7
3 changed files with 38 additions and 0 deletions
|
|
@ -254,3 +254,16 @@ function logg($message, $name, $EOL = true, $level = 2, $close = false){
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function release_lock(){
|
||||
if(LOCK_FILE !== null){
|
||||
if(!flock(LOCK_FILE, LOCK_UN)){
|
||||
console("[CRITICAL] Failed to release the server.lock file.");
|
||||
}
|
||||
if(!fclose(LOCK_FILE)){
|
||||
console("[CRITICAL] Could not close server.lock resource.");
|
||||
}
|
||||
} else {
|
||||
console("[CRITICAL] Failed to find the server.lock file.");
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue