GS2-Distributor SDK for Game Engine API リファレンス

ゲームエンジン向け GS2-SDK の モデルの仕様 と API のリファレンス

モデル

EzConfig

コンフィグ設定

トランザクションの変数に適用する設定値

必須デフォルト値の制限説明
keystring~ 64文字名前
valuestring~ 51200文字

EzDistributorModel

配信設定モデル

配信設定とはエンティティの入手時に所持枠を超えて入手した時のポリシーを設定するエンティティです。
GS2-Distributor を通して入手処理を行うことで、あふれたリソースを GS2-Inbox のメッセージとして転送することができます。

必須デフォルト値の制限説明
namestring~ 128文字配信設定名
metadatastring~ 2048文字メタデータ
inboxNamespaceIdstring~ 1024文字あふれたリソースを転送する GS2-Inbox のネームスペースGRN
whiteListTargetIdsList<string>[]~ 1000 itemsディストリビューターを通して処理出来る対象のリソースGRNのホワイトリスト

EzDistributeResource

リソース配布

必須デフォルト値の制限説明
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128文字入手アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

EzStampSheetResult

トランザクション実行結果

サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果

必須デフォルト値の制限説明
transactionIdstring36 ~ 36文字トランザクションID
taskRequestsList<EzConsumeAction>~ 100 items消費アクションのリクエスト内容
sheetRequestEzAcquireAction入手アクションのリクエスト内容
taskResultsList<string>[]~ 100 items消費アクションの実行結果
sheetResultstring~ 1048576文字入手アクションの実行結果レスポンス内容

EzBatchRequestPayload

API一括実行リクエスト

必須デフォルト値の制限説明
requestIdstring~ 128文字リクエストID
serviceenum {
    “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文字マイクロサービス名
methodNamestring~ 128文字メソッド名
parameterstring~ 10240文字メソッド名

service に指定する列挙型の定義

定義説明
accountGS2-Account
adRewardGS2-AdReward
authGS2-Auth
buffGS2-Buff
chatGS2-Chat
datastoreGS2-Datastore
deployGS2-Deploy
dictionaryGS2-Dictionary
distributorGS2-Distributor
enchantGS2-Enchant
enhanceGS2-Enhance
exchangeGS2-Exchange
experienceGS2-Experience
formationGS2-Formation
friendGS2-Friend
gatewayGS2-Gateway
gradeGS2-Grade
guardGS2-Guard
guildGS2-Guild
identifierGS2-Identifier
idleGS2-Idle
inboxGS2-Inbox
inventoryGS2-Inventory
jobQueueGS2-JobQueue
keyGS2-Key
limitGS2-Limit
lockGS2-Lock
logGS2-Log
loginRewardGS2-LoginReward
lotteryGS2-Lottery
matchmakingGS2-Matchmaking
megaFieldGS2-MegaField
missionGS2-Mission
moneyGS2-Money
money2GS2-Money2
newsGS2-News
questGS2-Quest
rankingGS2-Ranking
ranking2GS2-Ranking2
realtimeGS2-Realtime
scheduleGS2-Schedule
scriptGS2-Script
seasonRatingGS2-SeasonRating
serialKeyGS2-SerialKey
showcaseGS2-Showcase
skillTreeGS2-SkillTree
staminaGS2-Stamina
stateMachineGS2-StateMachine
versionGS2-Version

EzBatchResultPayload

API一括実行結果

必須デフォルト値の制限説明
requestIdstring~ 128文字リクエストID
statusCodeint100 ~ 1000ステータスコード
resultPayloadstring~ 10240文字レスポンス

EzAcquireAction

入手アクション

必須デフォルト値の制限説明
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128文字入手アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

EzConsumeAction

消費アクション

必須デフォルト値の制限説明
actionenum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Mission:ResetCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
~ 128文字消費アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

EzVerifyAction

検証アクション

必須デフォルト値の制限説明
actionenum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
}
~ 128文字検証アクションで実行するアクションの種類
requeststring~ 1048576文字リクエストのJSON

EzTransactionResult

トランザクション実行結果

サーバーサイドでのトランザクションの自動実行機能を利用して実行されたトランザクションの実行結果

必須デフォルト値の制限説明
transactionIdstring36 ~ 36文字トランザクションID
verifyResultsList<EzVerifyActionResult>~ 100 items検証アクションの実行結果リスト
consumeResultsList<EzConsumeActionResult>~ 100 items消費アクションの実行結果リスト
acquireResultsList<EzAcquireActionResult>~ 100 items入手アクションの実行結果リスト

EzAcquireActionResult

入手アクションの実行結果

必須デフォルト値の制限説明
acquireRequeststring~ 1048576文字リクエストのJSON
statusCodeint~ 999ステータスコード
acquireResultstring~ 1048576文字結果内容

EzConsumeActionResult

消費アクションの実行結果

必須デフォルト値の制限説明
consumeRequeststring~ 1048576文字リクエストのJSON
statusCodeint~ 999ステータスコード
consumeResultstring~ 1048576文字結果内容

EzVerifyActionResult

検証アクションの実行結果

必須デフォルト値の制限説明
verifyRequeststring~ 1048576文字リクエストのJSON
statusCodeint~ 999ステータスコード
verifyResultstring~ 1048576文字結果内容

メソッド

getDistributorModel

配信設定を取得

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
distributorNamestring~ 128文字配信設定名

Result

説明
itemEzDistributorModel配信設定

実装例

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; }
値の変更イベントハンドリング
var domain = gs2.Distributor.Namespace( namespaceName: "namespace-0001" ).DistributorModel( distributorName: "distributor-model-0001" ); // イベントハンドリングを開始 var callbackId = domain.Subscribe( value => { // 値が変化した時に呼び出される // value には変更後の値が渡ってくる } ); // イベントハンドリングを停止 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 ); // イベントハンドリングを開始 const auto CallbackId = Domain->Subscribe( [](TSharedPtr<Gs2::Distributor::Model::FDistributorModel> value) { // 値が変化した時に呼び出される // value には変更後の値が渡ってくる } ); // イベントハンドリングを停止 Domain->Unsubscribe(CallbackId);

listDistributorModels

配信設定の一覧を取得

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名

Result

説明
itemsList<EzDistributorModel>配信設定のリスト

実装例

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()); }
値の変更イベントハンドリング
var domain = gs2.Distributor.Namespace( namespaceName: "namespace-0001" ); // イベントハンドリングを開始 var callbackId = domain.SubscribeDistributorModels( () => { // リストの要素が変化した時に呼び出される } ); // イベントハンドリングを停止 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 ); // イベントハンドリングを開始 const auto CallbackId = Domain->SubscribeDistributorModels( []() { // リストの要素が変化した時に呼び出される } ); // イベントハンドリングを停止 Domain->UnsubscribeDistributorModels(CallbackId);

batchExecuteApi

API を一括実行

Request

必須デフォルト値の制限説明
requestPayloadsList<EzBatchRequestPayload>1 ~ 100 itemsバッチリクエスト

Result

説明
resultsList<EzBatchResultPayload>バッチリザルト

実装例

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

マスターデータをこのAPIを呼び出した時点での内容で固定化するための情報を保持した Context Stack を発行します。

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字アクセストークン

Result

説明
newContextStackstringマスターデータを固定する時刻を記録したコンテキスト

実装例

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

マスターデータを署名付きのタイムスタンプ時点での内容で固定化するための情報を保持した Context Stack を発行します。
署名付きタイムスタンプは SignFreezeMasterDataTimestamp で発行することが可能です。

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字アクセストークン
bodystring~ 1024文字ボディ
signaturestring~ 256文字署名
keyIdstring~ 1024文字署名計算に使用した GS2-Key の暗号鍵GRN

Result

説明
newContextStackstringマスターデータを固定する時刻を記録したコンテキスト

実装例

var domain = gs2.Distributor.Namespace( namespaceName: "namespace-0001" ).Distribute( ); var result = await domain.FreezeMasterDataBySignedTimestampAsync( accessToken: , body: "body", signature: "signature", keyId: "key-0001" );
var domain = gs2.Distributor.Namespace( namespaceName: "namespace-0001" ).Distribute( ); var future = domain.FreezeMasterDataBySignedTimestampFuture( accessToken: , body: "body", signature: "signature", keyId: "key-0001" ); 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 "key-0001" // keyId ); Future->StartSynchronousTask(); if (Future->GetTask().IsError()) { return false; } const auto Result = Future->GetTask().Result();

runStampSheet

入手アクションを実行

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
stampSheetstring~ 5242880文字トランザクション
keyIdstring~ 1024文字暗号鍵GRN
contextStackstring~ 32768文字リクエストコンテキスト

Result

説明
statusCodeintステータスコード
resultstringレスポンス内容

実装例

// 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を呼び出す必要はありません

runStampSheetExpress

トランザクションの検証アクション・消費アクション・入手アクションを一括実行

一括実行をすることで、レスポンスタイムを短縮できます。
エラーが発生した場合、再度APIを呼び出してください。成功するまで呼び出すことはクライアントでの責任となります。
リトライ時に ConsumeAction が複数回実行されないよう重複実行排除の仕組みがあるため、再実行してもリソースが重複して消費されることはありません。

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
stampSheetstring~ 5242880文字トランザクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
verifyTaskResultCodesList<int>検証アクションの実行ステータスコード
verifyTaskResultsList<string>検証アクションの実行結果
taskResultCodesList<int>消費アクションの実行ステータスコード
taskResultsList<string>消費アクションの実行結果
sheetResultCodeint入手アクションの実行ステータスコード
sheetResultstring入手アクションの実行結果レスポンス内容

実装例

// 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を呼び出す必要はありません

runStampSheetExpressWithoutNamespace

トランザクションの検証アクション・消費アクション・入手アクションを一括実行

一括実行をすることで、レスポンスタイムを短縮できます。
エラーが発生した場合、再度APIを呼び出してください。成功するまで呼び出すことはクライアントでの責任となります。
リトライ時に ConsumeAction が複数回実行されないよう重複実行排除の仕組みがあるため、再実行してもリソースが重複して消費されることはありません。

ネームスペースの指定を省略することで、
ログが記録できない・リソース溢れ処理が実行されないなどの副作用があります。

Request

必須デフォルト値の制限説明
stampSheetstring~ 5242880文字トランザクション
keyIdstring~ 1024文字暗号鍵GRN

Result

説明
verifyTaskResultCodesList<int>検証アクションの実行ステータスコード
verifyTaskResultsList<string>検証アクションの実行結果
taskResultCodesList<int>消費アクションの実行ステータスコード
taskResultsList<string>消費アクションの実行結果
sheetResultCodeint入手アクションの実行ステータスコード
sheetResultstring入手アクションの実行結果レスポンス内容

実装例

// 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を呼び出す必要はありません

runStampSheetWithoutNamespace

ネームスペースを指定せずに入手アクションを実行

ネームスペースの指定を省略することで、
ログが記録できない・リソース溢れ処理が実行されないなどの副作用があります。

Request

必須デフォルト値の制限説明
stampSheetstring~ 5242880文字トランザクション
keyIdstring~ 1024文字暗号鍵GRN
contextStackstring~ 32768文字リクエストコンテキスト

Result

説明
statusCodeintステータスコード
resultstringレスポンス内容

実装例

// 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を呼び出す必要はありません

runStampTask

消費アクションを実行

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
stampTaskstring~ 5242880文字消費アクション
keyIdstring~ 1024文字暗号鍵GRN
contextStackstring~ 32768文字リクエストコンテキスト

Result

説明
contextStackstringタスクの実行結果を反映したコンテキストスタック
statusCodeintステータスコード
resultstringレスポンス内容

実装例

// 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を呼び出す必要はありません

runStampTaskWithoutNamespace

ネームスペースを指定せずに消費アクションを実行

ネームスペースの指定を省略することで、
ログが記録できない・リソース溢れ処理が実行されないなどの副作用があります。

Request

必須デフォルト値の制限説明
stampTaskstring~ 5242880文字消費アクション
keyIdstring~ 1024文字暗号鍵GRN
contextStackstring~ 32768文字リクエストコンテキスト

Result

説明
contextStackstringタスクの実行結果を反映したコンテキストスタック
statusCodeintステータスコード
resultstringレスポンス内容

実装例

// 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を呼び出す必要はありません

runVerifyTask

消費アクションを実行

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
verifyTaskstring~ 5242880文字検証アクション
keyIdstring~ 1024文字暗号鍵GRN
contextStackstring~ 32768文字リクエストコンテキスト

Result

説明
contextStackstringタスクの実行結果を反映したコンテキストスタック
statusCodeintステータスコード
resultstringレスポンス内容

実装例

// 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を呼び出す必要はありません

runVerifyTaskWithoutNamespace

ネームスペースを指定せずに検証アクションを実行

ネームスペースの指定を省略することで、
ログが記録できない・リソース溢れ処理が実行されないなどの副作用があります。

Request

必須デフォルト値の制限説明
verifyTaskstring~ 5242880文字検証アクション
keyIdstring~ 1024文字暗号鍵GRN
contextStackstring~ 32768文字リクエストコンテキスト

Result

説明
contextStackstringタスクの実行結果を反映したコンテキストスタック
statusCodeintステータスコード
resultstringレスポンス内容

実装例

// 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を呼び出す必要はありません

setDefaultConfig

トランザクション発行APIに指定する Config の値のデフォルト値を保持した Context Stack を発行します。

Request

必須デフォルト値の制限説明
accessTokenstring~ 128文字アクセストークン
configList<EzConfig>1 ~ 1000 itemsトランザクションのプレースホルダの適用する設定値

Result

説明
newContextStackstringデフォルトコンフィグを反映するためのコンテキストスタック

実装例

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

トランザクションの実行結果を取得

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字アクセストークン
transactionIdstring36 ~ 36文字トランザクションID

Result

説明
itemEzStampSheetResultトランザクションの実行結果

実装例

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; }
値の変更イベントハンドリング
var domain = gs2.Distributor.Namespace( namespaceName: "namespace-0001" ).Me( gameSession: GameSession ).StampSheetResult( transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec" ); // イベントハンドリングを開始 var callbackId = domain.Subscribe( value => { // 値が変化した時に呼び出される // value には変更後の値が渡ってくる } ); // イベントハンドリングを停止 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 ); // イベントハンドリングを開始 const auto CallbackId = Domain->Subscribe( [](TSharedPtr<Gs2::Distributor::Model::FStampSheetResult> value) { // 値が変化した時に呼び出される // value には変更後の値が渡ってくる } ); // イベントハンドリングを停止 Domain->Unsubscribe(CallbackId);

getTransactionResult

トランザクションの実行結果を取得

Request

必須デフォルト値の制限説明
namespaceNamestring~ 128文字ネームスペース名
accessTokenstring~ 128文字アクセストークン
transactionIdstring36 ~ 36文字トランザクションID

Result

説明
itemEzTransactionResultトランザクションの実行結果

実装例

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; }
値の変更イベントハンドリング
var domain = gs2.Distributor.Namespace( namespaceName: "namespace-0001" ).Me( gameSession: GameSession ).TransactionResult( transactionId: "cc1985c3-54f0-4fc3-b295-dc30214284ec" ); // イベントハンドリングを開始 var callbackId = domain.Subscribe( value => { // 値が変化した時に呼び出される // value には変更後の値が渡ってくる } ); // イベントハンドリングを停止 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 ); // イベントハンドリングを開始 const auto CallbackId = Domain->Subscribe( [](TSharedPtr<Gs2::Distributor::Model::FTransactionResult> value) { // 値が変化した時に呼び出される // value には変更後の値が渡ってくる } ); // イベントハンドリングを停止 Domain->Unsubscribe(CallbackId);

イベントハンドラ

OnAutoRunStampSheetNotification

トランザクションの自動実行が完了した際に通知

名前説明
namespaceNamestringネームスペース名
userIdstringユーザーID
transactionIdstringトランザクションID

実装例

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

トランザクションの自動実行が完了した際に通知

名前説明
namespaceNamestringネームスペース名
userIdstringユーザーID
transactionIdstringトランザクションID

実装例

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; });