-
Notifications
You must be signed in to change notification settings - Fork 51
Configuration
MST reads the same argument model from environment variables, command-line options, and
application.cfg. Runtime configuration can override Inspector defaults, but it cannot invent
server permissions or components that are absent from the scene.
For a canonical MST argument, the first available source wins:
- Environment variable
- Command-line argument
- Main configuration file
- Imported configuration file
- Code or Inspector default
Argument names and environment-variable names are case-sensitive according to the operating system and runtime. The environment name is generated from the argument in upper snake case. Examples:
| Argument | Environment variable |
|---|---|
-mstMasterPort |
MST_MASTER_PORT |
-mstConfigFile |
MST_CONFIG_FILE |
-mstPermissionCredentials |
MST_PERMISSION_CREDENTIALS |
MST loads application.cfg from the Unity project root or build root by default. Select another
main file with:
-mstConfigFile=Configs/master.cfg
A relative path is resolved from the project or build root. If an explicitly selected main file is
missing, startup fails with FileNotFoundException.
# Comments begin with #
-mstStartMaster=true
-mstMasterIp=127.0.0.1
-mstMasterPort=25200
-mstUseSecure=falseValues are split on the first =. JSON arguments must remain on one line:
-mstPermissionCredentials={"default":"client-secret","room_server":"room-secret","spawner":"spawner-secret"}The main file can import reusable defaults:
@import "Configs/common.cfg"
@import "Configs/security.cfg"Relative imports are resolved from the directory of the file containing the directive. Import rules are deterministic:
- the main file wins over imported values;
- the first imported duplicate wins;
- duplicate parameters produce a warning;
- the same normalized file is loaded once, preventing import cycles;
- a missing imported file produces a warning and startup continues;
- an invalid import directive is ignored with a warning.
-mstStartMaster=true
-mstMasterIp=127.0.0.1
-mstMasterPort=25200
-mstTargetFrameRate=60
-mstWebAddress=127.0.0.1
-mstWebPort=25201
-mstUseSecure=false
-mstSecurityKeyRingFile=Configs/mst-security.keys.json
-mstPermissionCredentials={"default":"client-secret","room_server":"room-secret","spawner":"spawner-secret"}
-mstLogFilePath=Logs/master.logOnly include keys used by the active scene and modules. The canonical list, examples, and exact
names are maintained in
MstArgNames.cs.
A non-empty credential configured directly on a connection component takes priority for its exact
permission key. If it is empty, the connection falls back to -mstPermissionCredentials, then to
the built-in credential for that key.
The master uses -mstPermissionCredentials only to replace credentials for permission keys already
declared in its Inspector. Configuration cannot add a permission or change its numeric level.
- Keep production and development configs separate.
- Keep
-mstUseDevModedisabled in production. - Use a stable, backed-up key-ring path for each production environment.
- Update master, room, client, and spawner configs together when changing permission credentials.
- Do not expose server-only database or platform secrets in a client build.
Master Server Toolkit 5 documentation | Repository | Issues