ProjectVSettings class
The SDK settings asset. Create it with Assets > Create > SilverTiger > ProjectV SDK > Settings, pick the Environment and fill in its fields in the Inspector.
Namespace: SilverTiger.ProjectV.Unity
public sealed class ProjectVSettings : ScriptableObject, ISerializationCallbackReceiver
Properties​
| Property | Type | Description |
|---|---|---|
Environment | ProjectVEnvironment | The server environment this build connects to. |
Endpoint | string | The server address set for Environment, such as http://127.0.0.1:7350, with surrounding spaces removed. |
ClientVersion | string | The game version sent to the server, in major.minor.patch form, such as 3.0.0. |
Startup | ProjectVStartupSettings | Which player data loads at startup. All of it is required. |
TrustClientRewards | bool | When true, the game sends the rewards it computed itself when a mission ends. Check this before sending them; the server uses them only when it is set up to trust the client too. |
TrustClientStats | bool | When true, the game takes character and ally stats from its own assets instead of the server. The SDK only exposes this setting; the game decides what to do with it. |
Methods​
Validate()​
Checks the settings and throws on the first problem, so you can catch setup mistakes early. The SDK also runs this check when it starts.
public void Validate();
Exceptions
| Exception | When |
|---|---|
InvalidOperationException | The environment is unknown; its address or server key is missing; the address is not HTTP or HTTPS; Production does not use a non-local HTTPS address; the request timeout is not between 1 and 120 seconds; or a startup setting is turned off. |
UriFormatException | The address is not a valid absolute URL. |
ArgumentException | The client version or session key has an invalid format. |
OnBeforeSerialize()​
Unity serialization callback; does nothing. Do not call it yourself.
public void OnBeforeSerialize();
OnAfterDeserialize()​
Unity serialization callback that fills in per-environment fields from older assets. Do not call it yourself.
public void OnAfterDeserialize();