chore: checkpoint stable battle and eidolon progression

This commit is contained in:
CAtlas0784 committed 2026-10-17 16:38:03 +07:00
1 parent 365e66ffe0
commit a681affdb3
23 files changed
+34511 -11310

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
//go:build linux || darwin || freebsd || openbsd || netbsd || dragonfly
package common
import (
"os"
"syscall"
)
func lockPersistentFile() (func(), error) {
file, err := os.OpenFile("persistent.lock", os.O_CREATE|os.O_RDWR, 0600)
if err != nil {
return nil, err
}
if err := syscall.Flock(int(file.Fd()), syscall.LOCK_EX); err != nil {
file.Close()
return nil, err
}
return func() { syscall.Flock(int(file.Fd()), syscall.LOCK_UN); file.Close() }, nil
}