ConfigService
A game service that gives access to in-experience configuration with updates in real time.
| Memory category | Instances |
|---|
Member index 4
Description
ConfigService exposes methods for getting ConfigSnapshot objects. Configs can only be accessed by game servers, so you can't use ConfigService within client scripts.
See Experience configs for an in-depth guide on managing keys, deploying real-time updates, error handling, limits, and more.
History 7
- 670 Add SetTestingValue
- 670 Add ClearTestingValue
- 667 Change ReturnType of GetConfigForPlayerAsync from Object to ConfigSnapshot
- 667 Change ReturnType of GetConfigAsync from Object to ConfigSnapshot
- 666 Add GetConfigForPlayerAsync
- 666 Add GetConfigAsync
- 666 Add ConfigService
Members 4
ClearTestingValue
| Parameters (1) | ||
|---|---|---|
| key | string | |
| Returns (1) | ||
| null | ||
Removes a testing override created by the SetTestingValue() function. The actual configured value will be returned after calling this function.
| Thread safety | Unsafe |
|---|
History 1
- 670 Add ClearTestingValue
GetConfigAsync
| Parameters (0) | ||
|---|---|---|
| No parameters. | ||
| Returns (1) | ||
| ConfigSnapshot | ||
This function retrieves the latest available configuration as a ConfigSnapshot instance without player targeting. Snapshots can be refreshed to the latest values by calling ConfigSnapshot:Refresh().
Experiments are not applied since there is no player context.
If configuration fails to load and there is no previously available configuration, this function throws an error.
| Thread safety | Unsafe |
|---|
History 2
- 667 Change ReturnType of GetConfigAsync from Object to ConfigSnapshot
- 666 Add GetConfigAsync
GetConfigForPlayerAsync
| Parameters (1) | ||
|---|---|---|
| player | Player | |
| Returns (1) | ||
| ConfigSnapshot | ||
Retrieves the latest available configuration as a ConfigSnapshot instance targeting to the given player. Snapshots can be refreshed to the latest values by calling ConfigSnapshot:Refresh().
This function applies all experiments running for the player.
If configuration fails to load and there is no previously available configuration, this function throws an error.
| Thread safety | Unsafe |
|---|
History 2
- 667 Change ReturnType of GetConfigForPlayerAsync from Object to ConfigSnapshot
- 666 Add GetConfigForPlayerAsync
SetTestingValue
| Parameters (2) | ||
|---|---|---|
| key | string | |
| value | Variant | |
| Returns (1) | ||
| null | ||
Sets a testing override for the specified configuration key in the current server instance. When a testing value is set, calls to ConfigSnapshot:GetValue() for that key will return the testing value instead of the actual configured value.
Testing values can be cleared by calling the ClearTestingValue() function.
| Thread safety | Unsafe |
|---|
History 1
- 670 Add SetTestingValue