API Reference of GS2-Distributor SDK for Game Engine
Model
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 | Namespace GRN |
whiteListTargetIds | List<string> | | [] | | Whitelist of target resource GRNs that can be processed through the distributor |
EzDistributeResource
| 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 |
EzStampSheetResult
Stamp sheet execution results
Stamp sheet execution results executed using server-side stamp sheet auto-execution functionality
| Type | Require | Default | Limitation | Description |
---|
transactionId | string | ✓ | | 36 ~ 36 chars | stamp-sheet transaction ID |
taskRequests | List<EzConsumeAction> | | | | List of Stamp task request payload |
sheetRequest | EzAcquireAction | ✓ | | | Stamp sheet request payload |
taskResults | List<string> | | | | Stamp task execution results |
sheetResult | string | | | ~ 1048576 chars | Stamp sheet execution result response content |
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
getDistributorModel
Get delivery settings
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
distributorName | string | ✓ | | ~ 128 chars | Delivery setting name |
Result
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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->DistributorModel(
"distributor-model-0001" // distributorName
);
const auto item = Domain.Model();
listDistributorModels
Get list of delivery settings
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
Result
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(
);
for (auto Item : *It)
{
}
runStampSheet
Run Stamp Sheet
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
stampSheet | string | ✓ | | ~ 5242880 chars | Stamp sheet |
keyId | string | ✓ | | ~ 1024 chars | encryption key GRN |
contextStack | string | | | ~ 32768 chars | Context of request |
Result
| Type | Description |
---|
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
// SDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// Runs at the SDK level, so there is no need to explicitly call the API
runStampSheetExpress
Batch execution of stamp tasks and stamp sheets
Batch execution reduces response time.
However, there is no guarantee of a correct retry in the event of failure in the process of stamp sheet execution.
It is strongly recommended to keep a log of stamp sheet 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 | ✓ | | ~ 32 chars | Namespace name |
stampSheet | string | ✓ | | ~ 5242880 chars | Stamp sheet |
keyId | string | ✓ | | ~ 1024 chars | encryption key GRN |
Result
| Type | Description |
---|
taskResults | List<string> | Stamp task execution results |
sheetResult | string | Stamp sheet 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
// SDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// Runs at the SDK level, so there is no need to explicitly call the API
runStampSheetExpressWithoutNamespace
Batch execution of stamp tasks and stamp sheets
Batch execution reduces response time.
However, there is no guarantee of a correct retry in the event of failure in the process of stamp sheet execution.
It is strongly recommended to keep a log of stamp sheet 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 | Stamp sheet |
keyId | string | ✓ | | ~ 1024 chars | encryption key GRN |
Result
| Type | Description |
---|
taskResults | List<string> | Stamp task execution results |
sheetResult | string | Stamp sheet 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
// SDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// Runs at the SDK level, so there is no need to explicitly call the API
runStampSheetWithoutNamespace
Run Stamp Sheet
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 | Stamp sheet |
keyId | string | ✓ | | ~ 1024 chars | encryption key GRN |
contextStack | string | | | ~ 32768 chars | Context of request |
Result
| Type | Description |
---|
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
// SDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// Runs at the SDK level, so there is no need to explicitly call the API
runStampTask
Run Stamp Task
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
stampTask | string | ✓ | | ~ 5242880 chars | Stamp task |
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 |
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
// SDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// Runs at the SDK level, so there is no need to explicitly call the API
runStampTaskWithoutNamespace
Run stamping task
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 | Stamp task |
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 |
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
// SDKレベルで実行されるため明示的にAPIを呼び出す必要はありません
// Runs at the SDK level, so there is no need to explicitly call the API
getStampSheetResult
Get stamp sheet execution results
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
transactionId | string | ✓ | | 36 ~ 36 chars | stamp-sheet transaction ID |
Result
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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Distributor->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->StampSheetResult(
"cc1985c3-54f0-4fc3-b295-dc30214284ec" // transactionId
);
const auto item = Domain.Model();
Event Handler
OnAutoRunStampSheetNotification
Notification when stamp sheet auto-execution is complete
Name | Type | Description |
---|
namespaceName | string | Namespace name |
transactionId | string | stamp-sheet transaction ID |
Implementation Example
gs2.Distributor.OnAutoRunStampSheetNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var transactionId = notification.TransactionId;
};
gs2.Distributor.OnAutoRunStampSheetNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var transactionId = notification.TransactionId;
};
Gs2->Distributor->OnAutoRunStampSheetNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto TransactionId = Notification->TransactionIdValue;
});