GS2-Version SDK for Game Engine API Reference
Model
EzAcceptVersion
Approved Version
Not a version tied to data, such as an app version or asset version. Used for entities that require version control on a per-user basis, such as a version of an agreed upon Terms of Use.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| versionName | string | ✓ | ~ 128 chars | Version Name The name of the version model that this approval record is associated with. Links the user’s approval to a specific version model definition. | ||
| userId | string | ✓ | ~ 128 chars | User ID | ||
| version | EzVersion | ✓ | Version The version number that the user has approved or rejected. When used with “active” scope version models, this version is compared against the model’s current version during version checks. |
EzVersionModel
Version Model
You can set a warning version that accepts login but notifies you that you can upgrade, and an error version that does not accept login.
You can specify whether or not to have the client declare the current version with or without a signature. If you select signed, the client will not be able to declare a false version.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Version Model name Version Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 2048 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||
| warningVersion | EzVersion | {type} == “simple” | ✓* | Version that prompts for version upgrade The minimum version threshold for showing an upgrade notification. If the client’s version is below this value, login is still allowed but the user is prompted to upgrade. Comparison is performed hierarchically: major, then minor, then micro. * Required if type is “simple” | ||||||||
| errorVersion | EzVersion | {type} == “simple” | ✓* | Version that is determined to be an error by the version check The minimum version threshold for allowing login. If the client’s version is below this value, the version check results in an error and login is blocked. Comparison is performed hierarchically: major, then minor, then micro. * Required if type is “simple” | ||||||||
| scope | String Enum enum { “passive”, “active” } | ✓ | Type of version value used for judgment Determines how the version value is obtained for checking. “passive” means the client declares its current version at check time, while “active” means the system uses a version the user has explicitly approved in the past (such as agreeing to terms of service).
| |||||||||
| currentVersion | EzVersion | {type} == “simple” and {scope} == “active” | ✓* | Current Version The latest version available for this version model. Used only with “active” scope in “simple” mode to inform users of the current version when they approve or review version updates. * Required if type is “simple” and scope is “active” | ||||||||
| needSignature | bool | {scope} == “passive” | ✓* | Whether the version value to be determined requires signature verification When enabled, the client must provide a cryptographic signature along with the version declaration. This prevents clients from falsely reporting a higher version to bypass version checks. Only applicable when scope is “passive”. * Required if scope is “passive” |
EzVersion
Version
Represents a version number with a three-level hierarchy (major, minor, micro). Version comparison is performed hierarchically: major version is compared first, then minor, then micro. Used to define warning and error thresholds for version checking.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| major | int | ✓ | 0 ~ 2147483646 | Major version The highest priority component in version comparison. A difference in major version takes precedence over minor and micro versions. | ||
| minor | int | ✓ | 0 ~ 2147483646 | Minor version The second priority component in version comparison. Compared only when the major versions are equal. | ||
| micro | int | ✓ | 0 ~ 2147483646 | Micro version The lowest priority component in version comparison. Compared only when both major and minor versions are equal. |
EzStatus
Version Status
Indicates the result of version verification. Contains the version model used for checking and the current version reported by the client or recorded from user approval. Returned as part of version check results to inform the client whether the version is up to date, needs an upgrade warning, or is blocked.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| versionModel | EzVersionModel | ✓ | Version Model The version model definition used for this version check. Contains the warning and error version thresholds, scope, and other configuration that determined the check result. | |||
| currentVersion | EzVersion | Current Version The version that was evaluated during the version check. For “passive” scope, this is the version declared by the client. For “active” scope, this is the version the user has previously approved. May be absent if no version information is available. |
EzTargetVersion
Version to be verified
Represents a version declaration submitted by the client for version checking. In unsigned mode, the version is specified directly. In signed mode, the version is embedded in the body along with a cryptographic signature to prevent tampering.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| versionName | string | ✓ | ~ 128 chars | Version Model name Version Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| version | EzVersion | {signature} == "" | ✓* | Version The version number to be verified. Used when signature verification is not required (no signature provided). When a signature is provided, the version is extracted from the signed body instead. * Required if signature is “" | ||
| body | string | ~ 1048576 chars | Body The signed payload containing the version information. Used when signature verification is enabled (needSignature is true). The body contains the version data in a format that can be verified against the signature. | |||
| signature | string | ~ 256 chars | Signature The cryptographic signature for verifying the body content. When provided, the server validates the signature using the GS2-Key encryption key configured in the version model before accepting the declared version. |
Methods
getVersionModel
Get the details of a specific version check definition
Retrieves a single version model by name, including its check rules and thresholds.
The response includes:
- Scope: Whether this is a “passive” check (app version — client reports its version) or an “active” check (terms of service — player must explicitly accept)
- Warning version: The version threshold below which a soft warning is shown (e.g., “A new version is available. Please update.”)
- Error version: The version threshold below which a hard block is applied (e.g., “You must update to continue playing.”)
- Current version: The latest version (for active scope, this is what the player needs to accept)
- Schedule settings: If linked to GS2-Schedule, version thresholds that change over time (e.g., gradually raising the minimum version after a major update)
Use this to display version check details or to build custom version check UI logic.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| versionName | string | ✓ | ~ 128 chars | Version Model name Version Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzVersionModel | Version Model |
Implementation Example
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).VersionModel(
versionName: "version-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).VersionModel(
versionName: "version-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->VersionModel(
"version-0001" // versionName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).VersionModel(
versionName: "version-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).VersionModel(
versionName: "version-0001"
);
// Start event handling
var callbackId = domain.Subscribe(
value => {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
domain.Unsubscribe(callbackId); const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->VersionModel(
"version-0001" // versionName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Version::Model::FVersionModel> value) {
// Called when the value changes
// The "value" is passed the value after the change.
}
);
// Stop event handling
Domain->Unsubscribe(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listVersionModels
Get a list of all version check definitions
Retrieves all version models defined in the namespace. Each version model represents a version check rule — for example, “App Version”, “Terms of Service”, or “Asset Version”.
GS2-Version supports two types of version checks:
- App version check (passive scope): The game client reports its own version (e.g., “1.2.3”) and the server checks if it meets the minimum required version.
- If the client version is below the “warning” threshold → recommend an update (but allow playing)
- If the client version is below the “error” threshold → force an update (block playing)
- Terms of service check (active scope): The player must explicitly accept the current version of the terms.
- If the player hasn’t accepted the latest version → show the terms of service dialog
- If the player has already accepted → pass the check
Use this to find out what version checks are configured, so you can build the appropriate startup flow (version check screen, update prompt, terms dialog, etc.).
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
Result
| Type | Description | |
|---|---|---|
| items | List<EzVersionModel> | List of Version Models |
Implementation Example
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.VersionModelsAsync(
).ToListAsync(); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.VersionModels(
);
List<EzVersionModel> items = new List<EzVersionModel>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->VersionModels(
);
TArray<Gs2::UE5::Version::Model::FEzVersionModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeVersionModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeVersionModels(callbackId); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeVersionModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeVersionModels(callbackId); const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeVersionModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeVersionModels(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
accept
Accept a version (agree to terms of service)
Records that the player has accepted (agreed to) the specified version. This is the “I Agree” button for terms of service, privacy policy, or similar legal agreements.
Typical flow:
- CheckVersion returns an error for “terms_of_service” because the player hasn’t accepted the latest version
- Your game shows the terms of service dialog with the full text
- The player reads and taps “I Agree”
- Your game calls Accept with the version number that was displayed
- On the next CheckVersion call, the terms check passes
Important: Always pass the version number that was actually shown to the player. If the terms are updated on the server while the player is reading them, passing the old version will cause an error — ensuring the player always agrees to the latest terms.
If you don’t specify a version, the latest version is used. However, specifying the version explicitly is recommended to prevent race conditions.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| versionName | string | ✓ | ~ 128 chars | Version Name The name of the version model that this approval record is associated with. Links the user’s approval to a specific version model definition. | ||
| version | EzVersion | Approved Version |
Result
| Type | Description | |
|---|---|---|
| item | EzAcceptVersion | Approved Version |
Error
Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.
| Type | Base Type | Description |
|---|---|---|
| AcceptVersionInvalidException | BadRequestException | Error as a result of an updated server version during the approval process |
Implementation Example
try {
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).AcceptVersion(
versionName: "eula"
);
var result = await domain.AcceptAsync(
version: new Gs2.Unity.Gs2Version.Model.EzVersion {
Major = 2,
Minor = 2,
Micro = 2,
}
);
var item = await result.ModelAsync();
} catch(Gs2.Gs2Version.Exception.AcceptVersionInvalidException e) {
// Error as a result of an updated server version during the approval process
} var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).AcceptVersion(
versionName: "eula"
);
var future = domain.AcceptFuture(
version: new Gs2.Unity.Gs2Version.Model.EzVersion {
Major = 2,
Minor = 2,
Micro = 2,
}
);
yield return future;
if (future.Error != null)
{
if (future.Error is Gs2.Gs2Version.Exception.AcceptVersionInvalidException)
{
// Error as a result of an updated server version during the approval process
}
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->AcceptVersion(
"eula" // versionName
);
const auto Future = Domain->Accept(
MakeShared<Gs2::UE5::Version::Model::FEzVersion>()
->WithMajor(2)
->WithMinor(2)
->WithMicro(2)
) // version
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
auto e = Future->GetTask().Error();
if (e->IsChildOf(Gs2::Version::Error::FAcceptVersionInvalidError::Class))
{
// Error as a result of an updated server version during the approval process
}
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();delete
Delete a version acceptance record
Removes the player’s acceptance or rejection record for the specified version model. After deletion, the next CheckVersion call will treat the player as if they have never responded to this version check.
Use cases:
- Allow the player to change their mind on optional consents (e.g., withdraw data collection consent)
- Reset the acceptance state for testing or debugging purposes
- Force re-acceptance when you want the player to re-read updated terms without changing the version number
For active scope checks (terms of service), deleting the acceptance record means the player will be prompted to accept again on their next login or version check.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| versionName | string | ✓ | ~ 128 chars | Version Name The name of the version model that this approval record is associated with. Links the user’s approval to a specific version model definition. |
Result
| Type | Description | |
|---|---|---|
| item | EzAcceptVersion | Approved Version deleted |
Implementation Example
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).AcceptVersion(
versionName: "eula"
);
var result = await domain.DeleteAsync(
); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).AcceptVersion(
versionName: "eula"
);
var future = domain.DeleteFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->AcceptVersion(
"eula" // versionName
);
const auto Future = Domain->Delete(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();list
Get a list of versions the player has accepted or rejected
Retrieves all version acceptance/rejection records for the current player. Each record shows which version model the player responded to and what version they accepted or rejected.
This is mainly used for terms of service and privacy policy management. For example:
- Show which terms the player has already agreed to and their versions
- Check if the player needs to re-accept updated terms
- Display a “Terms and Policies” settings screen where the player can review what they’ve agreed to
For app version checks (passive scope), acceptance records are not used — those are checked by comparing the client-reported version directly. This list only contains records for active scope checks (where the player explicitly accepted or rejected).
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | |||
| limit | int | 30 | 1 ~ 1000 | Number of data items to retrieve |
Result
| Type | Description | |
|---|---|---|
| items | List<EzAcceptVersion> | List of Approved Versions |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.AcceptVersionsAsync(
).ToListAsync(); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.AcceptVersions(
);
List<EzAcceptVersion> items = new List<EzAcceptVersion>();
while (it.HasNext())
{
yield return it.Next();
if (it.Error != null)
{
onError.Invoke(it.Error, null);
break;
}
if (it.Current != null)
{
items.Add(it.Current);
}
else
{
break;
}
} const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->AcceptVersions(
);
TArray<Gs2::UE5::Version::Model::FEzAcceptVersionPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeAcceptVersions(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeAcceptVersions(callbackId); var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeAcceptVersions(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeAcceptVersions(callbackId); const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeAcceptVersions(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeAcceptVersions(CallbackId);Warning
This event is triggered when the value stored in the SDK’s local cache changes.
The local cache is updated only when executing the SDK’s API, or by executing stamp sheets via GS2-Distributor with GS2-Gateway notification enabled, or by executing a GS2-JobQueue with GS2-Gateway notification enabled.
Therefore, callbacks will not be invoked if the value is changed in any other way.
reject
Reject a version (decline optional terms)
Records that the player has rejected (declined) the specified version. This is the “I Decline” or “No Thanks” button — but only for optional agreements that don’t require acceptance.
This can only be used when the version model’s approval requirement is set to “optional”. If approval is required (mandatory), the player must accept — there is no reject option.
Use cases for optional terms:
- Optional data collection consent: “May we collect usage data to improve the game?” → Accept / Decline
- Optional marketing notifications: “Would you like to receive promotional emails?” → Accept / Decline
- Optional beta features: “Would you like to try experimental features?” → Accept / Decline
Even if the player rejects, the rejection is recorded so you know they’ve seen and responded to the prompt. On the next CheckVersion, the version check passes (since it’s optional), and the game can check the rejection record to adjust behavior accordingly.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| versionName | string | ✓ | ~ 128 chars | Version Name The name of the version model that this approval record is associated with. Links the user’s approval to a specific version model definition. | ||
| version | EzVersion | Rejected Version |
Result
| Type | Description | |
|---|---|---|
| item | EzAcceptVersion | Rejected Version |
Error
Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.
| Type | Base Type | Description |
|---|---|---|
| AcceptVersionInvalidException | BadRequestException | Error as a result of an updated server version during the approval process |
Implementation Example
try {
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).AcceptVersion(
versionName: "version-0001"
);
var result = await domain.RejectAsync(
version: null
);
var item = await result.ModelAsync();
} catch(Gs2.Gs2Version.Exception.AcceptVersionInvalidException e) {
// Error as a result of an updated server version during the approval process
} var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).AcceptVersion(
versionName: "version-0001"
);
var future = domain.RejectFuture(
version: null
);
yield return future;
if (future.Error != null)
{
if (future.Error is Gs2.Gs2Version.Exception.AcceptVersionInvalidException)
{
// Error as a result of an updated server version during the approval process
}
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->AcceptVersion(
"version-0001" // versionName
);
const auto Future = Domain->Reject(
// version
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
auto e = Future->GetTask().Error();
if (e->IsChildOf(Gs2::Version::Error::FAcceptVersionInvalidError::Class))
{
// Error as a result of an updated server version during the approval process
}
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();checkVersion
Run all version checks at once
Checks the game client’s versions and the player’s term acceptance status against all version models in the namespace. This is the main API you call at game startup to determine whether the player can proceed or needs to update / accept terms.
Typical startup flow:
- Game launches and calls CheckVersion with the client’s current versions (app version, asset version, etc.)
- The server checks each version model and returns two lists:
- warnings: Version checks that passed but the client is below the recommended version (show “Update available” dialog)
- errors: Version checks that failed — the client is too old or terms haven’t been accepted (block the player)
- If there are errors, show the appropriate screen:
- For app version errors → show “Please update from the App Store / Google Play” and redirect
- For terms of service errors → show the terms dialog and call Accept when the player agrees
- If there are only warnings (no errors), let the player proceed but optionally show an update recommendation
- If everything passes with no warnings or errors, the player enters the game normally
The targetVersions parameter is where you pass the client’s current version numbers for passive-scope checks (like app version). Active-scope checks (like terms of service) are evaluated automatically based on the player’s acceptance history.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| targetVersions | List<EzTargetVersion> | [] | 0 ~ 1000 items | List of Versions to be verified |
Result
| Type | Description | |
|---|---|---|
| projectToken | string | Signed in to the project token. |
| warnings | List<EzStatus> | Version Verification Results List of Warnings |
| errors | List<EzStatus> | Version Verification Results List of errors |
Implementation Example
var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Checker(
);
var result = await domain.CheckVersionAsync(
targetVersions: new List<Gs2.Unity.Gs2Version.Model.EzTargetVersion> {
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
VersionName = "app",
Version =
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
Major = 1,
Minor = 2,
Micro = 3,
},
},
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
VersionName = "asset",
Version =
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
Major = 1,
Minor = 2,
Micro = 3,
},
},
}
);
var projectToken = result.ProjectToken;
var warnings = result.Warnings;
var errors = result.Errors; var domain = gs2.Version.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Checker(
);
var future = domain.CheckVersionFuture(
targetVersions: new List<Gs2.Unity.Gs2Version.Model.EzTargetVersion> {
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
VersionName = "app",
Version =
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
Major = 1,
Minor = 2,
Micro = 3,
},
},
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
VersionName = "asset",
Version =
new Gs2.Unity.Gs2Version.Model.EzTargetVersion() {
Major = 1,
Minor = 2,
Micro = 3,
},
},
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var projectToken = future.Result.ProjectToken;
var warnings = future.Result.Warnings;
var errors = future.Result.Errors; const auto Domain = Gs2->Version->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Checker(
);
const auto Future = Domain->CheckVersion(
[]
{
auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Version::Model::FEzTargetVersion>>>();
v->Add(
MakeShared<Gs2::UE5::Version::Model::FEzTargetVersion>()
->WithVersionName(TOptional<FString>("app"))
->WithVersion(MakeShared<Gs2::UE5::Version::Model::FEzVersion>()
->WithMajor(TOptional<int32>(1))
->WithMinor(TOptional<int32>(2))
->WithMicro(TOptional<int32>(3))
);
);
v->Add(
MakeShared<Gs2::UE5::Version::Model::FEzTargetVersion>()
->WithVersionName(TOptional<FString>("asset"))
->WithVersion(MakeShared<Gs2::UE5::Version::Model::FEzVersion>()
->WithMajor(TOptional<int32>(1))
->WithMinor(TOptional<int32>(2))
->WithMicro(TOptional<int32>(3))
);
);
return v;
}() // targetVersions
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();
const auto ProjectToken = Result->ProjectToken;
const auto Warnings = Result->Warnings;
const auto Errors = Result->Errors;