Reading Session Config
Every time PlayFlow starts your server, it makes the current session’s details available so your server can configure itself dynamically. There are two ways to read them.Option 1: playflow.json (file)
PlayFlow writes a playflow.json file in the root directory, right next to your server executable. This file is written for backwards compatibility with existing SDKs, and it remains fully supported.
Example playflow.json:
custom_data to tell the server which map to load or what game mode to run.
Option 2: GET :9090/v1/config (HTTP)
The PlayFlow agent also serves a live config endpoint at http://localhost:9090/v1/config from inside the machine. Newer integrations can query it instead of reading the file. It returns the same session fields plus the current ttl and the allocated ports array, so it is the best source for reading your server’s port mappings at runtime.
- Unity
- Other Engines
The SDK provides a helper class to make this easy. Simply call
PlayFlowServerConfig.LoadConfig() to get the data.Automatic Server Shutdown
Servers stop automatically in two ways: when your process exits, and when a time-to-live (TTL) expires. Both are always enforced.Shutdown on process exit
For match-based games, you want the server to shut down after the match is over to save costs. When your server process exits, PlayFlow detects it and automatically stops the instance. In Unity, this means all you need to do is callApplication.Quit() at the end of a match. PlayFlow will handle the rest, ensuring you only pay for the time your server was actually running.
In the default multi-container model the agent detects exit by watching your game ports go down, which takes up to about 45 seconds after the process exits. A brief lingering
running state after Application.Quit() is expected.Shutdown on TTL
Every server can also carry a TTL — a maximum lifetime after which PlayFlow stops it automatically, even if the process is still running. You setttl (in seconds) when you start a server; the accepted range is 60–86400 (24 hours). Leaving it unset means no TTL-based auto-shutdown.
Next Steps
Now that you understand how the server behaves, learn how to control it from your game client or backend.Programmatic Access
Start, stop, and list servers using the PlayFlow API and Unity SDK.