API Reference of GS2-Enchant SDK for Game Engine
Model
EzBalanceParameterModel
Balance parameter model
Defines the drawing conditions for balance parameters.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Balance parameter model name | |
metadata | string | ~ 2048 chars | metadata | ||
totalValue | long | ✓ | ~ 9223372036854775805 | Total value | |
initialValueStrategy | enum { “average”, “lottery” } | ✓ | “average” | ~ 128 chars | Initial value setting policy |
parameters | List<EzBalanceParameterValueModel> | ✓ | 1 ~ 10 items | Balance parameter value model list |
Enumeration type definition to specify as initialValueStrategy
Enumerator String Definition | Description |
---|---|
average | Average |
lottery | Lottery |
EzBalanceParameterValueModel
Balance Parameter Value Model
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
metadata | string | ~ 512 chars | metadata |
EzBalanceParameterStatus
Balance parameter status
Type | Require | Default | Limitation | 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 |
EzBalanceParameterValue
Balance Parameter Value Model
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
value | long | ✓ | ~ 9223372036854775805 | Value |
EzRarityParameterModel
Balance parameter model
Defines the drawing conditions for balance parameters.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Balance parameter model name | |
metadata | string | ~ 2048 chars | metadata | ||
maximumParameterCount | int | ✓ | 1 ~ 10 | Maximum number of parameters to be given | |
parameterCounts | List<EzRarityParameterCountModel> | ✓ | 1 ~ 10 items | Rarity parameter value model list | |
parameters | List<EzRarityParameterValueModel> | ✓ | 1 ~ 1000 items | Rarity parameter value model list |
EzRarityParameterCountModel
Model of the number of rarity parameters granted
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
count | int | ✓ | ~ 10 | Value | |
weight | int | ✓ | 1 ~ 2147483646 | Weight |
EzRarityParameterValueModel
Balance Parameter Value Model
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
metadata | string | ~ 512 chars | metadata | ||
resourceName | string | ✓ | ~ 64 chars | Parameter Resource Name for Game(Not used for GS2) | |
resourceValue | long | ✓ | ~ 9223372036854775805 | Parameter Resource Value for Game(Not used for GS2) | |
weight | int | ✓ | 1 ~ 2147483646 | Weight |
EzRarityParameterStatus
Rarity parameter status
Type | Require | Default | Limitation | 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> | ~ 10 items | List of rarity parameter values |
EzRarityParameterValue
Rarity Parameter Value Model
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 64 chars | Name | |
resourceName | string | ✓ | ~ 64 chars | Resource Name | |
resourceValue | long | ✓ | ~ 9223372036854775805 | Resource Value |
Methods
getBalanceParameterModel
Get balance parameter model information
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ✓ | ~ 128 chars | Balance parameter model name |
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.Model();
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"
);
var future = domain.Model();
yield return future;
var item = future.Result;
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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
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"
);
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
);
// 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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ✓ | ~ 128 chars | Balance parameter model name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
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.Model();
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"
);
var future = domain.Model();
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
);
// 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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ~ 128 chars | Balance parameter model name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
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
);
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
);
// 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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ✓ | ~ 128 chars | Balance parameter model name |
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.Model();
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"
);
var future = domain.Model();
yield return future;
var item = future.Result;
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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
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"
);
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
);
// 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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ✓ | ~ 128 chars | Rarity parameter model name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
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.Model();
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"
);
var future = domain.Model();
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
);
// 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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ~ 128 chars | Rarity parameter model name | ||
accessToken | string | ✓ | ~ 128 chars | User Id | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
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
);
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
);
// 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. 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 | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
parameterName | string | ✓ | ~ 128 chars | Rarity parameter model name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
propertyId | string | ✓ | ~ 1024 chars | Property ID of the resource that owns the parameter | |
verifyType | enum { “havent”, “have”, “count” } | ✓ | ~ 128 chars | Type of verification | |
parameterValueName | string | {verifyType} in [“havent”, “have”] | ~ 64 chars | Name | |
parameterCount | int | {verifyType} in [“count”] | ~ 10 | Number of parameters to verify |
Enumeration type definition to specify as verifyType
Enumerator String Definition | Description |
---|---|
havent | The specified parameter must not be held |
have | The specified parameter must be held |
count | The number of parameters held must be the specified number |
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:
);
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:
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.Model();
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
// 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();