API Reference of GS2-Enchant SDK for Game Engine
Model
EzBalanceParameterStatus
Balance parameter status
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| parameterName | string | ✓ | ~ 128 chars | Balance parameter model name | ||
| propertyId | string | ✓ | ~ 1024 chars | Property ID of the resource that owns the parameter | ||
| parameterValues | List<EzBalanceParameterValue> | ✓ | 1 ~ 10 items | List of balance parameter values |
EzRarityParameterStatus
Rarity parameter status
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| parameterName | string | ✓ | ~ 128 chars | Rarity parameter model name | ||
| propertyId | string | ✓ | ~ 1024 chars | Property ID of the resource that owns the parameter | ||
| parameterValues | List<EzRarityParameterValue> | 0 ~ 10 items | List of rarity parameter values |
EzBalanceParameterModel
Balance parameter model
Defines the drawing conditions for balance parameters.
| Type | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Balance parameter model name Balance parameter model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). | ||||||||
| 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. | |||||||||
| totalValue | long | ✓ | 0 ~ 9223372036854775805 | Total value | ||||||||
| initialValueStrategy | String Enum enum { “average”, “lottery” } | ✓ | “average” | Initial value setting policy
| ||||||||
| parameters | List<EzBalanceParameterValueModel> | ✓ | 1 ~ 10 items | Balance parameter value model list |
EzBalanceParameterValueModel
Balance Parameter Value Model
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 64 chars | Name | ||
| metadata | string | ~ 512 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. |
EzRarityParameterModel
Rarity parameter model
Defines the drawing conditions for rarity parameters.
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Rarity parameter model name Rarity parameter model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). | ||
| 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. | |||
| maximumParameterCount | int | ✓ | 1 ~ 10 | Maximum number of parameters to be given | ||
| parameterCounts | List<EzRarityParameterCountModel> | ✓ | 1 ~ 10 items | Rarity parameter count model list | ||
| parameters | List<EzRarityParameterValueModel> | ✓ | 1 ~ 1000 items | Rarity parameter value model list |
EzRarityParameterCountModel
Model of the number of rarity parameters granted
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| count | int | ✓ | 0 ~ 10 | Value | ||
| weight | int | ✓ | 1 ~ 2147483646 | Weight |
EzRarityParameterValueModel
Rarity Parameter Value Model
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 64 chars | Name | ||
| metadata | string | ~ 512 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. | |||
| resourceName | string | ✓ | ~ 64 chars | Parameter Resource Name for Game(Not used for GS2) | ||
| resourceValue | long | ✓ | 0 ~ 9223372036854775805 | Parameter Resource Value for Game(Not used for GS2) | ||
| weight | int | ✓ | 1 ~ 2147483646 | Weight |
EzBalanceParameterValue
Balance Parameter Value
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 64 chars | Name | ||
| value | long | ✓ | 0 ~ 9223372036854775805 | Value |
EzRarityParameterValue
Rarity Parameter Value
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 64 chars | Name | ||
| resourceName | string | ✓ | ~ 64 chars | Resource Name | ||
| resourceValue | long | ✓ | 0 ~ 9223372036854775805 | Resource Value |
EzVerifyActionResult
Verify action execution result
EzConsumeActionResult
Consume action execution result
EzAcquireActionResult
Acquire action execution result
EzTransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | ||
| verifyResults | List<EzVerifyActionResult> | 0 ~ 10 items | List of verify action execution results | |||
| consumeResults | List<EzConsumeActionResult> | [] | 0 ~ 10 items | List of consume action execution results | ||
| acquireResults | List<EzAcquireActionResult> | [] | 0 ~ 100 items | List of acquire action execution results |
Methods
getBalanceParameterModel
Get balance parameter model information
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 (.). | ||
| parameterName | string | ✓ | ~ 128 chars | Balance parameter model name Balance parameter model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzBalanceParameterModel | Balance Parameter Model |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).BalanceParameterModel(
parameterName: "balance-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).BalanceParameterModel(
parameterName: "balance-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
)->BalanceParameterModel(
"balance-0001" // parameterName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).BalanceParameterModel(
parameterName: "balance-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.Enchant.Namespace(
namespaceName: "namespace-0001"
).BalanceParameterModel(
parameterName: "balance-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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->BalanceParameterModel(
"balance-0001" // parameterName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Enchant::Model::FBalanceParameterModel> 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 called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
listBalanceParameterModels
Get list of balance parameter model information
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<EzBalanceParameterModel> | List of Balance Parameter Model |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.BalanceParameterModelsAsync(
).ToListAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.BalanceParameterModels(
);
List<EzBalanceParameterModel> items = new List<EzBalanceParameterModel>();
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->Enchant->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->BalanceParameterModels(
);
TArray<Gs2::UE5::Enchant::Model::FEzBalanceParameterModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeBalanceParameterModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBalanceParameterModels(callbackId); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeBalanceParameterModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBalanceParameterModels(callbackId); const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeBalanceParameterModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeBalanceParameterModels(CallbackId);Warning
This event is called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
getBalanceParameterStatus
Get balance parameter status information
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 (.). | ||
| parameterName | string | ✓ | ~ 128 chars | Balance parameter model name | ||
| gameSession | GameSession | ✓ | GameSession | |||
| propertyId | string | ✓ | ~ 1024 chars | Property ID of the resource that owns the parameter |
Result
| Type | Description | |
|---|---|---|
| item | EzBalanceParameterStatus | Balance parameter status |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BalanceParameterStatus(
parameterName: "balance-0001",
propertyId: "property-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BalanceParameterStatus(
parameterName: "balance-0001",
propertyId: "property-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BalanceParameterStatus(
"balance-0001", // parameterName
"property-0001" // propertyId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BalanceParameterStatus(
parameterName: "balance-0001",
propertyId: "property-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.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).BalanceParameterStatus(
parameterName: "balance-0001",
propertyId: "property-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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->BalanceParameterStatus(
"balance-0001", // parameterName
"property-0001" // propertyId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Enchant::Model::FBalanceParameterStatus> 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 called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
listBalanceParameterStatuses
Get list of balance parameter status information
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 (.). | ||
| parameterName | string | ~ 128 chars | Balance parameter model name | |||
| 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<EzBalanceParameterStatus> | List of Balance Parameter Model |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.BalanceParameterStatusesAsync(
parameterName: "balance-0001"
).ToListAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.BalanceParameterStatuses(
parameterName: "balance-0001"
);
List<EzBalanceParameterStatus> items = new List<EzBalanceParameterStatus>();
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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->BalanceParameterStatuses(
"balance-0001" // parameterName
);
TArray<Gs2::UE5::Enchant::Model::FEzBalanceParameterStatusPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeBalanceParameterStatuses(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBalanceParameterStatuses(callbackId); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeBalanceParameterStatuses(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeBalanceParameterStatuses(callbackId); const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeBalanceParameterStatuses(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeBalanceParameterStatuses(CallbackId);Warning
This event is called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
getRarityParameterModel
Get rarity parameter model information
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 (.). | ||
| parameterName | string | ✓ | ~ 128 chars | Rarity parameter model name Rarity parameter model-specific name. Specified using alphanumeric characters, hyphen (-), underscore (_), and period (.). |
Result
| Type | Description | |
|---|---|---|
| item | EzRarityParameterModel | Rarity Parameter Model |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).RarityParameterModel(
parameterName: "rarity-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).RarityParameterModel(
parameterName: "rarity-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
)->RarityParameterModel(
"rarity-0001" // parameterName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).RarityParameterModel(
parameterName: "rarity-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.Enchant.Namespace(
namespaceName: "namespace-0001"
).RarityParameterModel(
parameterName: "rarity-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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->RarityParameterModel(
"rarity-0001" // parameterName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Enchant::Model::FRarityParameterModel> 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 called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
listRarityParameterModels
Get list of rarity parameter model information
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<EzRarityParameterModel> | List of Rarity Parameter Model |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.RarityParameterModelsAsync(
).ToListAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.RarityParameterModels(
);
List<EzRarityParameterModel> items = new List<EzRarityParameterModel>();
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->Enchant->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->RarityParameterModels(
);
TArray<Gs2::UE5::Enchant::Model::FEzRarityParameterModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeRarityParameterModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeRarityParameterModels(callbackId); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeRarityParameterModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeRarityParameterModels(callbackId); const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeRarityParameterModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeRarityParameterModels(CallbackId);Warning
This event is called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
getRarityParameterStatus
Get rarity parameter status information
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 (.). | ||
| parameterName | string | ✓ | ~ 128 chars | Rarity parameter model name | ||
| gameSession | GameSession | ✓ | GameSession | |||
| propertyId | string | ✓ | ~ 1024 chars | Property ID of the resource that owns the parameter |
Result
| Type | Description | |
|---|---|---|
| item | EzRarityParameterStatus | Rarity parameter status |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).RarityParameterStatus(
parameterName: "balance-0001",
propertyId: "property-0001"
);
var item = await domain.ModelAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).RarityParameterStatus(
parameterName: "balance-0001",
propertyId: "property-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result; const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->RarityParameterStatus(
"balance-0001", // parameterName
"property-0001" // propertyId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).RarityParameterStatus(
parameterName: "balance-0001",
propertyId: "property-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.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).RarityParameterStatus(
parameterName: "balance-0001",
propertyId: "property-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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->RarityParameterStatus(
"balance-0001", // parameterName
"property-0001" // propertyId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Enchant::Model::FRarityParameterStatus> 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 called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
listRarityParameterStatuses
Get list of rarity parameter status information
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 (.). | ||
| parameterName | string | ~ 128 chars | Rarity parameter model name | |||
| 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<EzRarityParameterStatus> | List of Rarity Parameter Model |
| nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.RarityParameterStatusesAsync(
parameterName: "rarity-0001"
).ToListAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.RarityParameterStatuses(
parameterName: "rarity-0001"
);
List<EzRarityParameterStatus> items = new List<EzRarityParameterStatus>();
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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->RarityParameterStatuses(
"rarity-0001" // parameterName
);
TArray<Gs2::UE5::Enchant::Model::FEzRarityParameterStatusPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}Value change event handling
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeRarityParameterStatuses(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeRarityParameterStatuses(callbackId); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeRarityParameterStatuses(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeRarityParameterStatuses(callbackId); const auto Domain = Gs2->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeRarityParameterStatuses(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeRarityParameterStatuses(CallbackId);Warning
This event is called when the value in the local cache that the SDK has is changed.
The local cache will only be changed by executing the SDK’s API, or by executing a stamp sheet 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.
verifyRarityParameterStatus
Verify rarity parameter status information
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 (.). | ||||||||||
| parameterName | string | ✓ | ~ 128 chars | Rarity parameter model name | ||||||||||
| gameSession | GameSession | ✓ | GameSession | |||||||||||
| propertyId | string | ✓ | ~ 1024 chars | Property ID of the resource that owns the parameter | ||||||||||
| verifyType | String Enum enum { “havent”, “have”, “count” } | ✓ | Type of verification
| |||||||||||
| parameterValueName | string | {verifyType} in [“havent”, “have”] | ✓* | ~ 64 chars | Name | |||||||||
| parameterCount | int | {verifyType} in [“count”] | ✓* | 0 ~ 10 | Number of parameters to verify |
Result
| Type | Description | |
|---|---|---|
| item | EzRarityParameterStatus | Rarity parameter status |
Implementation Example
var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).RarityParameterStatus(
parameterName: "balance-0001",
propertyId: "property-0001"
);
var result = await domain.VerifyRarityParameterStatusAsync(
verifyType: "have",
parameterValueName: "parameter-0001",
parameterCount: 0
);
var item = await result.ModelAsync(); var domain = gs2.Enchant.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).RarityParameterStatus(
parameterName: "balance-0001",
propertyId: "property-0001"
);
var future = domain.VerifyRarityParameterStatusFuture(
verifyType: "have",
parameterValueName: "parameter-0001",
parameterCount: 0
);
yield return future;
if (future.Error != null)
{
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->Enchant->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->RarityParameterStatus(
"balance-0001", // parameterName
"property-0001" // propertyId
);
const auto Future = Domain->VerifyRarityParameterStatus(
"have", // verifyType
"parameter-0001", // parameterValueName
0 // parameterCount
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
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();