API Reference of GS2-Distributor SDK for Game Engine
Model
EzConfig
Configration
Set values to be applied to transaction variables
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | |
value | string | ~ 51200 chars | Value |
EzDistributorModel
Delivery Setting Model
A delivery setting is an entity that sets the policy when an entity’s acquisition exceeds its possession quota. By processing acquisitions through GS2-Distributor, overflow resources can be forwarded as GS2-Inbox messages.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Delivery setting name | |
metadata | string | ~ 2048 chars | metadata | ||
inboxNamespaceId | string | ~ 1024 chars | GS2-Inbox namespace GRN to transfer overflow resources | ||
whiteListTargetIds | List<string> | [] | ~ 1000 items | Whitelist of target resource GRNs that can be processed through the distributor |
EzDistributeResource
Distribute Resource
EzStampSheetResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | |
taskRequests | List<EzConsumeAction> | ~ 100 items | List of consume action request payload | ||
sheetRequest | EzAcquireAction | ✓ | Acquire action request payload | ||
taskResults | List<string> | ~ 100 items | Consume action execution results | ||
sheetResult | string | ~ 1048576 chars | Acquire action execution results |
EzBatchRequestPayload
API Batch Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
requestId | string | ✓ | ~ 128 chars | Request ID | |
service | enum { “account”, “adReward”, “auth”, “buff”, “chat”, “datastore”, “deploy”, “dictionary”, “distributor”, “enchant”, “enhance”, “exchange”, “experience”, “formation”, “friend”, “gateway”, “grade”, “guard”, “guild”, “identifier”, “idle”, “inbox”, “inventory”, “jobQueue”, “key”, “limit”, “lock”, “log”, “loginReward”, “lottery”, “matchmaking”, “megaField”, “mission”, “money”, “money2”, “news”, “quest”, “ranking”, “ranking2”, “realtime”, “schedule”, “script”, “seasonRating”, “serialKey”, “showcase”, “skillTree”, “stamina”, “stateMachine”, “version” } | ✓ | ~ 128 chars | Service | |
methodName | string | ✓ | ~ 128 chars | Method Name | |
parameter | string | ✓ | ~ 10240 chars | Method Name |
Enumeration type definition to specify as service
Enumerator String Definition | Description |
---|---|
account | GS2-Account |
adReward | GS2-AdReward |
auth | GS2-Auth |
buff | GS2-Buff |
chat | GS2-Chat |
datastore | GS2-Datastore |
deploy | GS2-Deploy |
dictionary | GS2-Dictionary |
distributor | GS2-Distributor |
enchant | GS2-Enchant |
enhance | GS2-Enhance |
exchange | GS2-Exchange |
experience | GS2-Experience |
formation | GS2-Formation |
friend | GS2-Friend |
gateway | GS2-Gateway |
grade | GS2-Grade |
guard | GS2-Guard |
guild | GS2-Guild |
identifier | GS2-Identifier |
idle | GS2-Idle |
inbox | GS2-Inbox |
inventory | GS2-Inventory |
jobQueue | GS2-JobQueue |
key | GS2-Key |
limit | GS2-Limit |
lock | GS2-Lock |
log | GS2-Log |
loginReward | GS2-LoginReward |
lottery | GS2-Lottery |
matchmaking | GS2-Matchmaking |
megaField | GS2-MegaField |
mission | GS2-Mission |
money | GS2-Money |
money2 | GS2-Money2 |
news | GS2-News |
quest | GS2-Quest |
ranking | GS2-Ranking |
ranking2 | GS2-Ranking2 |
realtime | GS2-Realtime |
schedule | GS2-Schedule |
script | GS2-Script |
seasonRating | GS2-SeasonRating |
serialKey | GS2-SerialKey |
showcase | GS2-Showcase |
skillTree | GS2-SkillTree |
stamina | GS2-Stamina |
stateMachine | GS2-StateMachine |
version | GS2-Version |
EzBatchResultPayload
API Batch Result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
requestId | string | ✓ | ~ 128 chars | Request ID | |
statusCode | int | ✓ | 100 ~ 1000 | Status Code | |
resultPayload | string | ✓ | ~ 10240 chars | Response |
EzAcquireAction
Acquire Action
EzConsumeAction
Consume Action
EzVerifyAction
Verify Action
EzTransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | |
verifyResults | List<EzVerifyActionResult> | ~ 100 items | List of verify action execution results | ||
consumeResults | List<EzConsumeActionResult> | ~ 100 items | List of consume action execution results | ||
acquireResults | List<EzAcquireActionResult> | ~ 100 items | List of acquire action execution results |
EzAcquireActionResult
Acquire action execution result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
acquireRequest | string | ✓ | ~ 1048576 chars | JSON of request | |
statusCode | int | ~ 999 | Status code | ||
acquireResult | string | ~ 1048576 chars | Result payload |
EzConsumeActionResult
Consume action execution result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
consumeRequest | string | ✓ | ~ 1048576 chars | JSON of request | |
statusCode | int | ~ 999 | Status code | ||
consumeResult | string | ~ 1048576 chars | Result payload |
EzVerifyActionResult
Verify action execution result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
verifyRequest | string | ✓ | ~ 1048576 chars | JSON of request | |
statusCode | int | ~ 999 | Status code | ||
verifyResult | string | ~ 1048576 chars | Result payload |
Methods
getDistributorModel
Get delivery settings
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
distributorName | string | ✓ | ~ 128 chars | Delivery setting name |
Result
Type | Description | |
---|---|---|
item | EzDistributorModel | Delivery Setting |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).DistributorModel(
distributorName: "distributor-model-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).DistributorModel(
distributorName: "distributor-model-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->DistributorModel(
"distributor-model-0001" // distributorName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).DistributorModel(
distributorName: "distributor-model-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.Distributor.Namespace(
namespaceName: "namespace-0001"
).DistributorModel(
distributorName: "distributor-model-0001"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->DistributorModel(
"distributor-model-0001" // distributorName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Distributor::Model::FDistributorModel> 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.
listDistributorModels
Get list of delivery settings
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<EzDistributorModel> | List of delivery settings |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.DistributorModelsAsync(
).ToListAsync();
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.DistributorModels(
);
List<EzDistributorModel> items = new List<EzDistributorModel>();
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->Distributor->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->DistributorModels(
);
TArray<Gs2::UE5::Distributor::Model::FEzDistributorModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
Value change event handling
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeDistributorModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeDistributorModels(callbackId);
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.DistributorModels(
);
List<EzDistributorModel> items = new List<EzDistributorModel>();
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->Distributor->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeDistributorModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeDistributorModels(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.
batchExecuteApi
Batch execution of APIs
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
requestPayloads | List<EzBatchRequestPayload> | ✓ | 1 ~ 100 items | Batch request |
Result
Type | Description | |
---|---|---|
results | List<EzBatchResultPayload> | Batch result |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: null
);
var result = await domain.BatchExecuteApiAsync(
requestPayloads: new List<Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload> {
new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
Service = "inventory",
Method = "describeSimpleItems",
Request = "{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"inventory-0001\", \"accessToken\": \"accessToken-0001\"}",
},
new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
Service = "exchange",
Method = "describeRateModels",
Request = "{\"namespaceName\": \"namespace-0001\"}",
},
}
);
var results = result.Results;
var domain = gs2.Distributor.Namespace(
namespaceName: null
);
var future = domain.BatchExecuteApiFuture(
requestPayloads: new List<Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload> {
new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
Service = "inventory",
Method = "describeSimpleItems",
Request = "{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"inventory-0001\", \"accessToken\": \"accessToken-0001\"}",
},
new Gs2.Unity.Gs2Distributor.Model.EzBatchRequestPayload() {
Service = "exchange",
Method = "describeRateModels",
Request = "{\"namespaceName\": \"namespace-0001\"}",
},
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var results = future.Result.Results;
const auto Domain = Gs2->Distributor->Namespace(
nullptr // namespaceName
);
const auto Future = Domain->BatchExecuteApi(
[]
{
auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Distributor::Model::FEzBatchRequestPayload>>>();
v->Add(
MakeShared<Gs2::UE5::Distributor::Model::FEzBatchRequestPayload>()
->WithService(TOptional<FString>("inventory"))
->WithMethod(TOptional<FString>("describeSimpleItems"))
->WithRequest(TOptional<FString>("{\"namespaceName\": \"namespace-0001\", \"inventoryName\": \"inventory-0001\", \"accessToken\": \"accessToken-0001\"}"))
);
v->Add(
MakeShared<Gs2::UE5::Distributor::Model::FEzBatchRequestPayload>()
->WithService(TOptional<FString>("exchange"))
->WithMethod(TOptional<FString>("describeRateModels"))
->WithRequest(TOptional<FString>("{\"namespaceName\": \"namespace-0001\"}"))
);
return v;
}() // requestPayloads
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();
const auto Results = Result->Results;
freezeMasterData
Issue a Context Stack that holds the information to fix the contents at the time of calling this API in the Master Data.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
newContextStack | string | Request of context in time to freeze the master data |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Distribute(
);
var result = await domain.FreezeMasterDataAsync(
accessToken:
);
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Distribute(
);
var future = domain.FreezeMasterDataFuture(
accessToken:
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Distribute(
);
const auto Future = Domain->FreezeMasterData(
// accessToken
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();
freezeMasterDataBySignedTimestamp
Issue a Context Stack that holds the information to fix the contents at the time of signing the timestamp in the Master Data. Signed timestamps can be issued with SignFreezeMasterDataTimestamp.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
body | string | ✓ | ~ 1024 chars | Body | |
signature | string | ✓ | ~ 256 chars | Signature | |
keyId | string | ✓ | ~ 1024 chars | GS2-Key GRN of the cryptographic key used for signature calculation |
Result
Type | Description | |
---|---|---|
newContextStack | string | Request of context in time to freeze the master data |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Distribute(
);
var result = await domain.FreezeMasterDataBySignedTimestampAsync(
accessToken: ,
body: "body",
signature: "signature",
keyId:
);
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Distribute(
);
var future = domain.FreezeMasterDataBySignedTimestampFuture(
accessToken: ,
body: "body",
signature: "signature",
keyId:
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Distribute(
);
const auto Future = Domain->FreezeMasterDataBySignedTimestamp(
, // accessToken
"body", // body
"signature", // signature
// keyId
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();
runStampSheet
Run acquire action
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN | |
contextStack | string | ~ 32768 chars | Context of request |
Result
Type | Description | |
---|---|---|
statusCode | int | Status code |
result | string | Response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runStampSheetExpress
Batch execution of verify actions, consume actions, and acquire actions in transactions
Batch execution reduces response time. However, there is no guarantee of a correct retry in the event of failure in the process of transaction execution. It is strongly recommended to keep a log of transaction execution in GS2-Log in case execution fails, so that appropriate action can be taken during customer support.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
verifyTaskResultCodes | List<int> | Verify action execution status code |
verifyTaskResults | List<string> | Verify action execution results |
taskResultCodes | List<int> | Consume action execution status code |
taskResults | List<string> | Consume action execution results |
sheetResultCode | int | Acquire action execution status code |
sheetResult | string | Acquire action execution result response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runStampSheetExpressWithoutNamespace
Batch execution of verify actions, consume actions, and acquire actions in transactions
Batch execution reduces response time. However, there is no guarantee of a correct retry in the event of failure in the process of transaction execution. It is strongly recommended to keep a log of transaction execution in GS2-Log in case execution fails, so that appropriate action can be taken during customer support.
By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN |
Result
Type | Description | |
---|---|---|
verifyTaskResultCodes | List<int> | Verify action execution status code |
verifyTaskResults | List<string> | Verify action execution results |
taskResultCodes | List<int> | Consume action execution status code |
taskResults | List<string> | Consume action execution results |
sheetResultCode | int | Acquire action execution status code |
sheetResult | string | Acquire action execution result response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runStampSheetWithoutNamespace
Run acquire action without specifying namespace
By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
stampSheet | string | ✓ | ~ 5242880 chars | Transaction | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN | |
contextStack | string | ~ 32768 chars | Context of request |
Result
Type | Description | |
---|---|---|
statusCode | int | Status code |
result | string | Response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runStampTask
Run consume action
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
stampTask | string | ✓ | ~ 5242880 chars | Consume Action | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN | |
contextStack | string | ~ 32768 chars | Context of request |
Result
Type | Description | |
---|---|---|
contextStack | string | Request of context reflecting task execution results |
statusCode | int | Status code |
result | string | Response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runStampTaskWithoutNamespace
Run consume action without specifying namespace
By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
stampTask | string | ✓ | ~ 5242880 chars | Consume Action | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN | |
contextStack | string | ~ 32768 chars | Context of request |
Result
Type | Description | |
---|---|---|
contextStack | string | Request of context reflecting task execution results |
statusCode | int | Status code |
result | string | Response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runVerifyTask
Run verify action
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
verifyTask | string | ✓ | ~ 5242880 chars | Verify Action | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN | |
contextStack | string | ~ 32768 chars | Context of request |
Result
Type | Description | |
---|---|---|
contextStack | string | Request of context reflecting task execution results |
statusCode | int | Status code |
result | string | Response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
runVerifyTaskWithoutNamespace
Run verify action without specifying namespace
By omitting the namespace specification, the There are side effects such as logging not being possible and resource overflow processing not being executed.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
verifyTask | string | ✓ | ~ 5242880 chars | Verify Action | |
keyId | string | ✓ | ~ 1024 chars | encryption key GRN | |
contextStack | string | ~ 32768 chars | Context of request |
Result
Type | Description | |
---|---|---|
contextStack | string | Request of context reflecting task execution results |
statusCode | int | Status code |
result | string | Response content |
Implementation Example
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// New Experience ではSDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// New Experience runs at the SDK level, so there is no need to explicitly call the API
// Runs at the SDK level, so there is no need to explicitly call the API
setDefaultConfig
Issue a Context Stack that holds the default values of Config to be specified in the Transaction Issuance API.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
accessToken | string | ✓ | ~ 128 chars | User Id | |
config | List<EzConfig> | ✓ | 1 ~ 1000 items | Transaction placeholder applied settings values |
Result
Type | Description | |
---|---|---|
newContextStack | string | Context stack reflecting the results of the task |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: null
);
var result = await domain.SetDefaultConfigAsync(
accessToken: ,
config: new List<Gs2.Unity.Gs2Distributor.Model.EzConfig> {
new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
Key = "key-0001",
Value = "value-0001",
},
new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
Key = "key-0002",
Value = "value-0002",
},
}
);
var domain = gs2.Distributor.Namespace(
namespaceName: null
);
var future = domain.SetDefaultConfigFuture(
accessToken: ,
config: new List<Gs2.Unity.Gs2Distributor.Model.EzConfig> {
new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
Key = "key-0001",
Value = "value-0001",
},
new Gs2.Unity.Gs2Distributor.Model.EzConfig() {
Key = "key-0002",
Value = "value-0002",
},
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
const auto Domain = Gs2->Distributor->Namespace(
nullptr // namespaceName
);
const auto Future = Domain->SetDefaultConfig(
, // accessToken
[]
{
auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Distributor::Model::FEzConfig>>>();
v->Add(
MakeShared<Gs2::UE5::Distributor::Model::FEzConfig>()
->WithKey(TOptional<FString>("key-0001"))
->WithValue(TOptional<FString>("value-0001"))
);
v->Add(
MakeShared<Gs2::UE5::Distributor::Model::FEzConfig>()
->WithKey(TOptional<FString>("key-0002"))
->WithValue(TOptional<FString>("value-0002"))
);
return v;
}() // config
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();
getStampSheetResult
Get transaction execution results
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID |
Result
Type | Description | |
---|---|---|
item | EzStampSheetResult | Transaction execution results |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).StampSheetResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
var item = await domain.ModelAsync();
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).StampSheetResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->StampSheetResult(
"cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).StampSheetResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
// 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.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).StampSheetResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->StampSheetResult(
"cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Distributor::Model::FStampSheetResult> 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.
getTransactionResult
Get transaction execution results
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID |
Result
Type | Description | |
---|---|---|
item | EzTransactionResult | Transaction execution results |
Implementation Example
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).TransactionResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
var item = await domain.ModelAsync();
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).TransactionResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->TransactionResult(
"cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).TransactionResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
// 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.Distributor.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).TransactionResult(
transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec"
);
var future = domain.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->TransactionResult(
"cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Distributor::Model::FTransactionResult> 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.
Event Handler
OnAutoRunStampSheetNotification
Notification when transaction auto-execution is complete
Name | Type | Description |
---|---|---|
namespaceName | string | Namespace name |
userId | string | User Id |
transactionId | string | Transaction ID |
Implementation Example
gs2.Distributor.OnAutoRunStampSheetNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var transactionId = notification.TransactionId;
};
gs2.Distributor.OnAutoRunStampSheetNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var transactionId = notification.TransactionId;
};
Gs2->Distributor->OnAutoRunStampSheetNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto TransactionId = Notification->TransactionIdValue;
});
OnAutoRunTransactionNotification
Notification when transaction auto-execution is complete
Name | Type | Description |
---|---|---|
namespaceName | string | Namespace name |
userId | string | User Id |
transactionId | string | Transaction ID |
Implementation Example
gs2.Distributor.OnAutoRunTransactionNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var transactionId = notification.TransactionId;
};
gs2.Distributor.OnAutoRunTransactionNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var userId = notification.UserId;
var transactionId = notification.TransactionId;
};
Gs2->Distributor->OnAutoRunTransactionNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto UserId = Notification->UserIdValue;
const auto TransactionId = Notification->TransactionIdValue;
});