Concurrency
Exclusive lock, TTL, heartbeat and optimistic concurrency through baseVersion.
Coordinate one dedicated-server world across multiple PCs without silently overwriting newer progress. Palworld v2.2.2 is the stable release; main also contains an experimental Valheim 1.0 adapter.
The backend keeps one source of truth. Every host must prove it started from the right version before it can publish progress.
The difficult part is not uploading a folder. It is preserving ownership and history when hosts, networks or processes fail.
Exclusive lock, TTL, heartbeat and optimistic concurrency through baseVersion.
Every adapter supplies a canonical saveIdentity: Palworld uses worldGuid; experimental Valheim uses worldUid.
Temporary ZIP, defensive validation, SHA-256 and transactional SQLite authority changes.
Version history, restore-as-new-version, pending upload recovery and rollback procedures.
SQLite queue and a supervisor independent from Gunicorn, with timeout, retry and crash-safe retention.
Bearer hashes on the backend and DPAPI on Windows. Runtime data stays out of source and release assets.
The Flask application remains one deployable service, but critical responsibilities are separated so lock/publication invariants stay reviewable.
sessions.py owns lock, heartbeat, unlock and managed-host revalidation.
publications.py owns upload staging, ZIP validation, atomic publish and two-phase historical restore.
database.py owns schema/migrations; retention.py and backup_supervisor.py preserve backup and cleanup safety.
game_config.py keeps game identity/capabilities declarative; game-specific save parsing stays in client adapters.
mainAfter v2.2.2, the development tree gained a Valheim 1.0 adapter and opt-in managed-computer authorization. This is a preview, not a stable-release promise.
The adapter validates complete Valheim 1.0 generations and uses the intrinsic signed 64-bit worldUid as save identity.
Each registered PC gets a stable ClientId and its own host-bound sync token. Palworld keeps its existing unmanaged flow.
The client starts valheim_server.exe, maintains the lease, sends CTRL+C, waits for a committed final generation and only then publishes.
Heartbeat safety reserves enough lease time for clean shutdown; uncertain uploads and unexpected exits preserve recovery state instead of guessing.
Do not use the only valid copy of a real Valheim world for testing. Follow the four-host acceptance checklist and keep Palworld/Valheim databases and storage isolated. TTL expiry by itself is not proof that a failed old server process has stopped.
Use client and backend from the same stable product release.
git clone --branch v2.2.2 --depth 1 https://github.com/Ayerdi/dedicated-server-save-sync.git cd dedicated-server-save-sync config/deploy.sh --init-env config/deploy.sh
Requires Docker Compose, HTTPS and private storage.
1. Download the ZIP and .sha256.
2. Verify the checksum.
3. Configure config.json.
4. Run Configure-Secrets.cmd and Test-Connection.cmd.
5. Start with Start-PalworldSync.cmd.
Palworld's local REST API must listen on localhost only. Do not expose that port through your router.
The Palworld v2.2.2 reference remains maintained for bugs, security, dependencies and compatibility. Experimental Valheim work on main is documented and tested separately; the broader general multi-game and device/cloud-sync product remains outside this repository.