API Reference of GS2-SkillTree SDK for Game Engine
Model
EzNodeModel
The node model is the entity to be recorded in the skill tree. This section defines what kind of entities can be recorded in the skill tree.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Node Model Name | |
metadata | string | ~ 2048 chars | metadata | ||
releaseConsumeActions | List<EzConsumeAction> | ✓ | [] | 1 ~ 10 items | List of consume actions required for release |
returnAcquireActions | List<EzAcquireAction> | ~ 10 items | List of acquire actions required for return | ||
restrainReturnRate | float | ✓ | 1 | ~ 1 | Return Rate |
EzStatus
Status of skill tree
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
statusId | string | ✓ | ~ 1024 chars | Status GRN | |
userId | string | ✓ | ~ 128 chars | User Id | |
releasedNodeNames | List<string> | [] | ~ 1000 items | List of released node model name |
EzConfig
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | |
value | string | ~ 51200 chars | Value |
EzAcquireAction
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
action | enum [] | ✓ | ~ 128 chars | Types of actions to be performed in the stamp sheet | |
request | string | ✓ | ~ 1048576 chars | JSON of request |
EzConsumeAction
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
action | enum [] | ✓ | ~ 128 chars | Types of actions to be performed in the stamp task | |
request | string | ✓ | ~ 1048576 chars | JSON of the obtain request |
Methods
getNodeModel
Get status model information
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
nodeModelName | string | ✓ | ~ 128 chars | Node Model Name |
Result
Type | Description | |
---|---|---|
item | EzNodeModel | Node model |
Implementation Example
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).NodeModel(
nodeModelName: "status-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).NodeModel(
nodeModelName: "status-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->NodeModel(
"status-0001" // nodeModelName
);
const auto Future = Domain.Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).NodeModel(
nodeModelName: "status-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.SkillTree.Namespace(
namespaceName: "namespace-0001"
).NodeModel(
nodeModelName: "status-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->NodeModel(
"status-0001" // nodeModelName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::SkillTree::Model::FNodeModel> 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.
listNodeModels
Get list of status model information
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<EzNodeModel> | List of Node models |
Implementation Example
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.NodeModelsAsync(
).ToListAsync();
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.NodeModels(
);
List<EzNodeModel> items = new List<EzNodeModel>();
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->SkillTree->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->NodeModels(
);
for (auto Item : *It)
{
}
Value change event handling
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeNodeModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeNodeModels(callbackId);
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.NodeModels(
);
List<EzNodeModel> items = new List<EzNodeModel>();
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->SkillTree->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeNodeModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeNodeModels(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.
getStatus
Get a release status
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | EzStatus | Status |
Implementation Example
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var item = await domain.ModelAsync();
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Status(
);
const auto Future = Domain.Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
// 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.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Status(
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::SkillTree::Model::FStatus> 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.
release
Release nodes
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
nodeModelNames | List<string> | ✓ | 1 ~ 1000 items | List of node model names |
Result
Type | Description | |
---|---|---|
item | EzStatus | Status |
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheets used to execute the release process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is stamp sheet auto-execution enabled? |
Implementation Example
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var result = await domain.ReleaseAsync(
nodeModelNames: new string[] {
"node-0001",
}
);
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var future = domain.ReleaseFuture(
nodeModelNames: new string[] {
"node-0001",
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Status(
);
const auto Future = Domain->Release(
[]
{
const auto v = MakeShared<TArray<FString>>();
v->Add("node-0001");
return v;
}()
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
reset
Reset node status
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | EzStatus | Status |
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheets used to execute the reset process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is stamp sheet auto-execution enabled? |
Implementation Example
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var result = await domain.ResetAsync(
);
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var future = domain.ResetFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Status(
);
const auto Future = Domain->Reset(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
restrain
Restrain nodes
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
nodeModelNames | List<string> | ✓ | 1 ~ 1000 items | List of node model names |
Result
Type | Description | |
---|---|---|
item | EzStatus | Status |
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheets used to execute the restrain process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is stamp sheet auto-execution enabled? |
Implementation Example
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var result = await domain.RestrainAsync(
nodeModelNames: new string[] {
"node-0001",
}
);
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
var domain = gs2.SkillTree.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Status(
);
var future = domain.RestrainFuture(
nodeModelNames: new string[] {
"node-0001",
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
const auto Domain = Gs2->SkillTree->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Status(
);
const auto Future = Domain->Restrain(
[]
{
const auto v = MakeShared<TArray<FString>>();
v->Add("node-0001");
return v;
}()
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}