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

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

モデル

EzProgress

クエスト進行状況

クエストの開始時に作成され、終了時に削除されます。

インゲームの途中でアプリを終了した際にはこのデータが残った状態となり
エンティティが保持する進行中のクエスト情報からゲームをリジュームすることが可能です。

有効化条件 必須 デフォルト 値の制限 説明
progressId string
~ 1024文字 クエスト進行状況 GRN
※ サーバーが自動で設定
transactionId string
UUID ~ 36文字 トランザクションID
クエストトランザクションの一意の識別子です。クエスト進行状況と報酬配布を管理するトランザクションを紐付けるために使用されます。
questModelId string
~ 1024文字 クエストモデル GRN
現在進行中のクエストモデルのGRNです。ユーザーがプレイ中のクエストを識別し、クエスト途中でアプリを終了した場合のゲームリジュームを可能にします。
randomSeed long
0 ~ 9223372036854775805 乱数シード
クエスト開始時に割り当てられる乱数シードです。このクエスト試行で選択されるコンテンツバリエーション(報酬セット)の決定に使用され、再現可能な結果を保証します。
metadata string ~ 256文字 メタデータ
メタデータには任意の値を設定できます。
これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。
rewards List<EzReward> [] 0 ~ 1000 items クリア報酬リスト
クエストクリア時に付与される報酬のリストです。乱数シードで選択されたコンテンツバリエーションに基づき、クエスト開始時に決定されます。
failedRewards List<EzReward> [] 0 ~ 1000 items 失敗時報酬リスト
クエスト失敗時に付与される報酬のリストです。クエスト開始時に決定され、失敗時の慰労報酬やコストの一部返還として提供されます。

EzCompletedQuestList

クリア済みクエストリスト

クエストグループ内でユーザーがクリアしたクエストを追跡します。前提クエストのクリア判定や初回クリアボーナスの判定に使用されます。各クエスト名はクリア回数に関わらず一度だけ記録されます。

有効化条件 必須 デフォルト 値の制限 説明
questGroupName string
~ 128文字 クエストグループモデル名
このクリア済みクエストリストが属するクエストグループの名前です。ユーザーごと・クエストグループごとに1つの CompletedQuestList が存在します。
completeQuestNames List<string> [] 0 ~ 1000 items クリア済みクエスト名リスト
このクエストグループ内でユーザーがクリアしたクエスト名のリストです。初回クリア時にクエスト名が追加され、重複は排除されます。前提クエスト条件の評価や初回クリアボーナスの判定に使用されます。

EzQuestGroupModel

クエストグループモデル

クエストグループは複数のクエストをグルーピングするためのエンティティで、クエストの進行はグループ内で同時に1つしか実行できません。
つまり、並列でクエストを進行できるようにする必要がある場合はグループを分ける必要があります。

有効化条件 必須 デフォルト 値の制限 説明
name string
~ 128文字 クエストグループモデル名
クエストグループモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
metadata string ~ 1024文字 メタデータ
メタデータには任意の値を設定できます。
これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。
quests List<EzQuestModel> [] 0 ~ 1000 items グループに属するクエスト
このクエストグループに属するクエストモデルのリストです。グループ内では同時に1つのクエストのみ進行できます。
challengePeriodEventId string ~ 1024文字 挑戦可能期間イベント GRN
このグループ内のクエストに挑戦可能な期間を設定する GS2-Schedule のイベントGRNです。指定した場合、イベントがアクティブな期間中のみクエストを開始できます。

EzQuestModel

クエストモデル

クエストモデルはインゲームの開始に必要な対価とクリアしたときに得られる報酬を保持するエンティティです。

クリアしたときに得られる報酬は複数のバリエーションを用意でき、クエスト開始時に抽選することができます。
例えば、クエスト自体は同じでも、レアモンスターの出現有無によって2種類のコンテンツバリエーションを作成できます。

有効化条件 必須 デフォルト 値の制限 説明
questModelId string
~ 1024文字 クエストモデル GRN
※ サーバーが自動で設定
name string
~ 128文字 クエストモデル名
クエストモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
metadata string ~ 1024文字 メタデータ
メタデータには任意の値を設定できます。
これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。
contents List<EzContents> [] 1 ~ 10 items クエストの内容
このクエストのコンテンツバリエーションのリストです。クエスト開始時に重み付き抽選で1つのバリエーションが選択されます。各バリエーションに異なるクリア報酬を定義でき、同じクエストでも異なる結果(例:レアモンスターの出現)を実現できます。
challengePeriodEventId string ~ 1024文字 挑戦可能期間イベント GRN
このクエストに挑戦可能な期間を設定する GS2-Schedule のイベントGRNです。指定した場合、イベントがアクティブな期間中のみクエストを開始できます。この設定はクエストグループの挑戦可能期間より優先されます。
firstCompleteAcquireActions List<EzAcquireAction> [] 0 ~ 10 items 初回クリア報酬入手アクションリスト
このクエストの初回クリア時にのみ実行される入手アクションのリストです。通常のクリア報酬に加えて付与されるボーナス報酬で、初回クリアボーナスの実現に使用します。
verifyActions List<EzVerifyAction> [] 0 ~ 10 items 検証アクションリスト
このクエストを開始するための前提条件となる検証アクションのリストです。すべての検証アクションが成功しないとクエストを開始できません。レベル確認やアイテム所持などの要件の強制に使用します。
consumeActions List<EzConsumeAction> [] 0 ~ 10 items 消費アクションリスト
このクエストの開始コストとして実行される消費アクションです。スタミナや通貨などのコストがクエスト開始時に消費されます。
failedAcquireActions List<EzAcquireAction> [] 0 ~ 100 items 失敗時入手アクションリスト
クエスト失敗時に実行される入手アクションです。失敗時の慰労報酬やクエスト参加コストの一部返還などに使用します。
premiseQuestNames List<string> [] 0 ~ 10 items 前提クエスト名リスト
このクエストに挑戦する前にクリアが必要な同グループ内のクエスト名のリストです。連続するクエストチェーンや分岐するクエストパスの作成に使用します。

EzContents

コンテンツ

クエストコンテンツの1つのバリエーションを表します。各クエストは異なる報酬を持つ複数のコンテンツバリエーションを持つことができ、クエスト開始時に重み付き抽選で1つが選択されます。メタデータはユーザーIDやコンフィグ値によるテンプレート変数の置換をサポートします。

有効化条件 必須 デフォルト 値の制限 説明
metadata string ~ 256文字 メタデータ
メタデータには任意の値を設定できます。
これらの値は GS2 の動作には影響しないため、ゲーム内で利用する情報の保存先として使用できます。
completeAcquireActions List<EzAcquireAction> [] 0 ~ 10 items クリア報酬入手アクション
このコンテンツバリエーションでクエストをクリアした際に実行される入手アクションです。プレイヤーがクエストクリア時に受け取る実際の報酬を定義します。

EzConsumeAction

消費アクション

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
}
消費アクションで実行するアクションの種類
request string
~ 524288文字 アクション実行時に使用されるリクエストのJSON文字列

EzVerifyAction

検証アクション

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
"Gs2Stamina:VerifyStaminaValueByUserId",
"Gs2Stamina:VerifyStaminaMaxValueByUserId",
"Gs2Stamina:VerifyStaminaRecoverIntervalMinutesByUserId",
"Gs2Stamina:VerifyStaminaRecoverValueByUserId",
"Gs2Stamina:VerifyStaminaOverflowValueByUserId",
}
検証アクションで実行するアクションの種類
request string
~ 524288文字 アクション実行時に使用されるリクエストのJSON文字列

EzAcquireAction

入手アクション

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
入手アクションで実行するアクションの種類
request string
~ 524288文字 アクション実行時に使用されるリクエストのJSON文字列

EzReward

報酬

クエスト開始時に決定される個々の報酬アイテムを表します。実行する入手アクション、対象リソース、付与する数量を含みます。Progress エンティティに保存され、クエストのクリアまたは失敗時の報酬配布に使用されます。

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
入手アクションで実行するアクションの種類
request string
~ 5242880文字 リクエスト
入手アクション実行時に使用されるリクエストパラメータのJSON文字列です。対象ネームスペース、リソース名、数量など、報酬の具体的な詳細を含みます。
itemId string
~ 1024文字 アイテムID
報酬として入手するリソースのGRNです。プレイヤーに付与されるアイテム、通貨、その他のリソースを特定します。
value int
0 ~ 2147483646 数量
報酬として付与するリソースの数量です。ゲームロジックに基づいて動的に調整することが可能です。

EzConfig

コンフィグ設定

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

有効化条件 必須 デフォルト 値の制限 説明
key string
~ 64文字 名前
value string ~ 51200文字

EzVerifyActionResult

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

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
"Gs2Stamina:VerifyStaminaValueByUserId",
"Gs2Stamina:VerifyStaminaMaxValueByUserId",
"Gs2Stamina:VerifyStaminaRecoverIntervalMinutesByUserId",
"Gs2Stamina:VerifyStaminaRecoverValueByUserId",
"Gs2Stamina:VerifyStaminaOverflowValueByUserId",
}
検証アクションで実行するアクションの種類
verifyRequest string
~ 524288文字 アクション実行時に使用されるリクエストのJSON文字列
statusCode int 0 ~ 999 ステータスコード
verifyResult string ~ 1048576文字 結果内容

EzConsumeActionResult

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

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
}
消費アクションで実行するアクションの種類
consumeRequest string
~ 524288文字 アクション実行時に使用されるリクエストのJSON文字列
statusCode int 0 ~ 999 ステータスコード
consumeResult string ~ 1048576文字 結果内容

EzAcquireActionResult

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

有効化条件 必須 デフォルト 値の制限 説明
action 文字列列挙型
enum {
"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",
"Gs2Schedule:ExtendTriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
入手アクションで実行するアクションの種類
acquireRequest string
~ 524288文字 アクション実行時に使用されるリクエストのJSON文字列
statusCode int 0 ~ 999 ステータスコード
acquireResult string ~ 1048576文字 結果内容

EzTransactionResult

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

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

有効化条件 必須 デフォルト 値の制限 説明
transactionId string
36 ~ 36文字 トランザクションID
verifyResults List<EzVerifyActionResult> 0 ~ 10 items 検証アクションの実行結果リスト
consumeResults List<EzConsumeActionResult> [] 0 ~ 10 items 消費アクションの実行結果リスト
acquireResults List<EzAcquireActionResult> [] 0 ~ 100 items 入手アクションの実行結果リスト

メソッド

deleteProgress

プレイヤーの現在のクエストをキャンセルする

プレイヤーの進行中のクエストを削除し、別のクエストを開始できるようにします。
プレイヤーがクエストを放棄したい場合に使います。たとえば「このクエストを諦めますか?」という確認ダイアログを表示し、プレイヤーが確認した時にこのAPIを呼びます。
新しいクエストを開始する際の force オプションの代替手段です。前のクエストを暗黙的に破棄するのではなく、プレイヤーに明示的な「クエスト放棄」ボタンを提供したい場合に使います。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
gameSession GameSession
GameSession

Result

説明
item EzProgress クエスト進行状況

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    var result = await domain.DeleteProgressAsync(
    );
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    var future = domain.DeleteProgressFuture(
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Progress(
    );
    const auto Future = Domain->DeleteProgress(
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
    const auto Result = Future->GetTask().Result();

end

クエストの完了または失敗を報告する

プレイヤーがクエストのプレイを終えたことをサーバーに伝えます。以下の2つを報告する必要があります:

  • isComplete: プレイヤーがクエストをクリアしたか(true)失敗したか(false)。
  • rewards: プレイヤーがクエスト中に実際に獲得した報酬。クエスト開始時に受け取った最大値を超えてはいけません。

プレイヤーがクエストをクリアした場合(isComplete = true)、報告された報酬がプレイヤーに付与されます(例: アイテムがインベントリに追加、通貨がウォレットに追加)。
プレイヤーが失敗した場合(isComplete = false)、rewardsパラメータは無視され、クエスト定義に設定された失敗報酬が代わりに付与されます。

サーバーは報告された報酬を検証します。許可された最大値を超えたり、このクエストに存在しないアイテムを報告した場合はエラーになります。
クエストのゲームプレイが終わった時に使います。たとえば、プレイヤーがボスを倒した後や「ゲームオーバー」画面が表示された後です。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
gameSession GameSession
GameSession
rewards List<EzReward> [] 0 ~ 1000 items クエストで実際に得た報酬
isComplete bool
クエストをクリアしたか
config List<EzConfig> [] 0 ~ 32 items トランザクションの変数に適用する設定値

Result

説明
item EzProgress クエスト進行状況
transactionId string 発行されたトランザクションID
stampSheet string 報酬付与処理の実行に使用するスタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheet bool トランザクションの自動実行が有効か
atomicCommit bool トランザクションをアトミックにコミットするか
transaction string 発行されたトランザクション
transactionResult EzTransactionResult トランザクション実行結果

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    var result = await domain.EndAsync(
        isComplete: true,
        rewards: null,
        config: null
    );
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    var future = domain.EndFuture(
        isComplete: true,
        rewards: null,
        config: null
    );
    yield return future;
    if (future.Error != null)
    {
        onError.Invoke(future.Error, null);
        yield break;
    }
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Progress(
    );
    const auto Future = Domain->End(
        true // isComplete
        // rewards
        // config
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }

getProgress

プレイヤーの現在のクエスト進行状況を取得する

プレイヤーが現在プレイ中のクエストを、クエストグループとクエスト定義の詳細とともに取得します。
アプリ再起動後にクエストを再開するのに便利です。たとえば、プレイヤーが「ステージ1-3」の途中でアプリを閉じた場合、起動時にこれを呼んで未完了のクエストを検出し「クエストを再開しますか?」ダイアログを表示できます。
プレイヤーが進行中のクエストを持っていない場合、進行データは返されません。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
gameSession GameSession
GameSession

Result

説明
item EzProgress クエスト進行状況
questGroup EzQuestGroupModel クエストグループモデル
quest EzQuestModel クエストモデル

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Progress(
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
値の変更イベントハンドリング
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).Progress(
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->Progress(
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Quest::Model::FProgress> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);

start

クエストを開始する

プレイヤーがクエストを開始することをサーバーに伝えます。プレイヤーはクエストグループごとに同時に1つのクエストしか進行できません。すでに別のクエストが実行中の場合は失敗します(force = true を指定すると、前のクエストを破棄して新しく開始できます)。

クエストが正常に開始されると、レスポンスには以下が含まれます:

  • このクエストで入手可能な報酬の最大値(例: 「剣×3まで、ゴールド×100まで」)。ゲームプレイ中にプレイヤーが獲得できるものを決定するのに使います。
  • 再現可能なゲームプレイのための乱数シード。このシードを使うことで、同じ条件でゲームを再現できます。デバッグやクラッシュ後の再開に役立ちます。
  • このクエスト実行を一意に識別するトランザクションID。クエスト結果を報告する際に必要です。

プレイヤーがクエストの「開始」をタップした時に使います。たとえば「第1章」グループの「ステージ1-3」を開始する場合です。スタミナなどのクエストコストは自動的に消費されます。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
questGroupName string
~ 128文字 クエストグループモデル名
questName string
~ 128文字 クエストモデル名
gameSession GameSession
GameSession
force bool false すでに開始しているクエストがある場合にそれを破棄して開始するか
config List<EzConfig> [] 0 ~ 32 items トランザクションの変数に適用する設定値

Result

説明
transactionId string 発行されたトランザクションID
stampSheet string クエストの開始処理の実行に使用するスタンプシート
stampSheetEncryptionKeyId string スタンプシートの署名計算に使用した暗号鍵GRN
autoRunStampSheet bool トランザクションの自動実行が有効か
atomicCommit bool トランザクションをアトミックにコミットするか
transaction string 発行されたトランザクション
transactionResult EzTransactionResult トランザクション実行結果

Error

このAPIには特別な例外が定義されています。
GS2-SDK for GameEngine ではゲーム内でハンドリングが必要そうなエラーは一般的な例外から派生した特殊化した例外を用意することでハンドリングしやすくしています。
一般的なエラーの種類や、ハンドリング方法は こちら のドキュメントを参考にしてください。

基底クラス 説明
InProgressException BadRequestException クエストはすでに進行中です

実装例

try {
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var result = await domain.StartAsync(
        questGroupName: "group-0001",
        questName: "quest-0001",
        force: null,
        config: null
    );
} catch(Gs2.Gs2Quest.Exception.InProgressException e) {
    // Quest is already underway.
}
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var future = domain.StartFuture(
        questGroupName: "group-0001",
        questName: "quest-0001",
        force: null,
        config: null
    );
    yield return future;
    if (future.Error != null)
    {
        if (future.Error is Gs2.Gs2Quest.Exception.InProgressException)
        {
            // Quest is already underway.
        }
        onError.Invoke(future.Error, null);
        yield break;
    }
    // New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
    // エラーが発生すると TransactionException がスローされます。
    // TransactionException::Retry() でリトライが可能です。
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    const auto Future = Domain->Start(
        "group-0001", // questGroupName
        "quest-0001" // questName
        // force
        // config
    );
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        auto e = Future->GetTask().Error();
        if (e->IsChildOf(Gs2::Quest::Error::FInProgressError::Class))
        {
            // Quest is already underway.
        }
        return false;
    }

describeCompletedQuestLists

プレイヤーのクリア済みクエスト記録の一覧を取得する

全クエストグループにおけるプレイヤーのクリア済みクエスト記録を取得します。
各エントリはクエストグループ1つに対応し、そのグループ内でプレイヤーがクリアしたクエスト名の一覧を含みます。
クエスト進捗の概要を表示するのに使います。たとえば、クエスト選択画面で「第1章: 5/10クリア」「第2章: 0/8クリア」「イベントダンジョン: 3/3クリア」のように表示するのに便利です。
一部のクエストは特定の前提クエストのクリアが必要なため、どのクエストが解放されているかを判定するのにも役立ちます。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
gameSession GameSession
GameSession
pageToken string ~ 1024文字 データの取得を開始する位置を指定するトークン
limit int 30 1 ~ 1000 データの取得件数

Result

説明
items List<EzCompletedQuestList> クリア済みクエストリストの一覧
nextPageToken string リストの続きを取得するためのページトークン

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var items = await domain.CompletedQuestListsAsync(
    ).ToListAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    );
    var it = domain.CompletedQuestLists(
    );
    List<EzCompletedQuestList> items = new List<EzCompletedQuestList>();
    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->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    );
    const auto It = Domain->CompletedQuestLists(
    );
    TArray<Gs2::UE5::Quest::Model::FEzCompletedQuestListPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }

getCompletedQuestList

特定グループのプレイヤーのクリア済みクエスト記録を取得する

指定したクエストグループ内で、プレイヤーがクリアしたクエスト名の一覧を取得します。
特定のグループ内でプレイヤーがどのクエストをクリア済みか確認するのに使います。たとえば「第1章」の各ステージのクリア/未クリア状態を表示したり、次のステージを解放するための前提クエストをクリアしているかチェックする場合に便利です。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
questGroupName string
~ 128文字 クエストグループモデル名
このクリア済みクエストリストが属するクエストグループの名前です。ユーザーごと・クエストグループごとに1つの CompletedQuestList が存在します。
gameSession GameSession
GameSession

Result

説明
item EzCompletedQuestList クリア済みクエストリスト

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).CompletedQuestList(
        questGroupName: "main"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).CompletedQuestList(
        questGroupName: "main"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->CompletedQuestList(
        "main" // questGroupName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
値の変更イベントハンドリング
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).CompletedQuestList(
        questGroupName: "main"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).Me(
        gameSession: GameSession
    ).CompletedQuestList(
        questGroupName: "main"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->Me(
        GameSession
    )->CompletedQuestList(
        "main" // questGroupName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Quest::Model::FCompletedQuestList> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);

getQuestGroup

名前を指定してクエストグループ定義を取得する

名前を指定して、クエストグループを1件取得します。
取得できる情報には、グループ内のクエスト一覧と、オプションのチャレンジ期間設定(例: 特定の期間のみ挑戦可能なイベントダンジョン)が含まれます。
特定のクエストカテゴリの詳細を表示するのに使います。たとえば「第1章」の全ステージや「イベントダンジョン」カテゴリ内の挑戦可能なクエスト一覧を表示する場合に便利です。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
questGroupName string
~ 128文字 クエストグループモデル名
クエストグループモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
item EzQuestGroupModel クエストグループモデル

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->QuestGroupModel(
        "quest-group-0001" // questGroupName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
値の変更イベントハンドリング
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->QuestGroupModel(
        "quest-group-0001" // questGroupName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Quest::Model::FQuestGroupModel> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);

listQuestGroups

クエストグループ定義の一覧を取得する

このネームスペースに登録されているすべてのクエストグループを取得します。
クエストグループは、関連するクエストをまとめるカテゴリです。たとえば「第1章」「イベントダンジョン」「デイリークエスト」などです。
プレイヤーはグループごとに1つのクエストしか同時に進行できないため、グループは同時実行の管理にも使われます。
クエスト選択画面を構築するのに使います。たとえば「メインストーリー」「サブクエスト」「イベントダンジョン」のようなカテゴリをプレイヤーに表示する場合に便利です。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
items List<EzQuestGroupModel> クエストグループモデルのリスト

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    );
    var items = await domain.QuestGroupModelsAsync(
    ).ToListAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    );
    var it = domain.QuestGroupModels(
    );
    List<EzQuestGroupModel> items = new List<EzQuestGroupModel>();
    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->Quest->Namespace(
        "namespace-0001" // namespaceName
    );
    const auto It = Domain->QuestGroupModels(
    );
    TArray<Gs2::UE5::Quest::Model::FEzQuestGroupModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
値の変更イベントハンドリング
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeQuestGroupModels(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );

    // イベントハンドリングを停止
    domain.UnsubscribeQuestGroupModels(callbackId);
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeQuestGroupModels(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );

    // イベントハンドリングを停止
    domain.UnsubscribeQuestGroupModels(callbackId);
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribeQuestGroupModels(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );

    // イベントハンドリングを停止
    Domain->UnsubscribeQuestGroupModels(CallbackId);

getQuest

名前を指定してクエスト定義を取得する

グループ名とクエスト名を指定して、クエストを1件取得します。
取得できる情報には、クエストの報酬設定、消費アクション(開始コスト)、前提クエスト条件が含まれます。
プレイヤーがクエストを開始する前に詳細を表示するのに使います。たとえば「ステージ1-3: 報酬: 剣×1、ゴールド×100 | コスト: スタミナ×10 | 条件: ステージ1-2クリア」のようにクエスト詳細画面で表示するのに便利です。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
questGroupName string
~ 128文字 クエストグループモデル名
クエストグループモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
questName string
~ 128文字 クエストモデル名
クエストモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
item EzQuestModel

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    ).QuestModel(
        questName: "quest-0001"
    );
    var item = await domain.ModelAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    ).QuestModel(
        questName: "quest-0001"
    );
    var future = domain.ModelFuture();
    yield return future;
    var item = future.Result;
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->QuestGroupModel(
        "quest-group-0001" // questGroupName
    )->QuestModel(
        "quest-0001" // questName
    );
    const auto Future = Domain->Model();
    Future->StartSynchronousTask();
    if (Future->GetTask().IsError())
    {
        return false;
    }
値の変更イベントハンドリング
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    ).QuestModel(
        questName: "quest-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    ).QuestModel(
        questName: "quest-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.Subscribe(
        value => {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    domain.Unsubscribe(callbackId);
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->QuestGroupModel(
        "quest-group-0001" // questGroupName
    )->QuestModel(
        "quest-0001" // questName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->Subscribe(
        [](TSharedPtr<Gs2::Quest::Model::FQuestModel> value) {
            // 値が変化した時に呼び出される
            // value には変更後の値が渡ってくる
        }
    );

    // イベントハンドリングを停止
    Domain->Unsubscribe(CallbackId);

listQuests

グループ内のクエスト定義の一覧を取得する

指定したクエストグループに属するすべてのクエストを取得します。
各クエストには、報酬(プレイヤーが獲得できるもの)、コスト(開始に必要なアイテムや通貨)、前提条件(先にクリアが必要なクエスト)が定義されています。
カテゴリ内のクエスト一覧を表示するのに使います。たとえば「第1章」グループ内で「ステージ1-1」「ステージ1-2」「ステージ1-3(ロック中 — 1-2をクリアしてください)」のように表示するのに便利です。

Request

有効化条件 必須 デフォルト 値の制限 説明
namespaceName string
~ 128文字 ネームスペース名
ネームスペース固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。
questGroupName string
~ 128文字 クエストグループモデル名
クエストグループモデル固有の名前。英数字および -(ハイフン) _(アンダースコア) .(ピリオド)で指定します。

Result

説明
items List<EzQuestModel> クエストモデルのリスト

実装例

    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    var items = await domain.QuestModelsAsync(
    ).ToListAsync();
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    var it = domain.QuestModels(
    );
    List<EzQuestModel> items = new List<EzQuestModel>();
    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->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->QuestGroupModel(
        "quest-group-0001" // questGroupName
    );
    const auto It = Domain->QuestModels(
    );
    TArray<Gs2::UE5::Quest::Model::FEzQuestModelPtr> Result;
    for (auto Item : *It)
    {
        if (Item.IsError())
        {
            return false;
        }
        Result.Add(Item.Current());
    }
値の変更イベントハンドリング
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeQuestModels(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );

    // イベントハンドリングを停止
    domain.UnsubscribeQuestModels(callbackId);
    var domain = gs2.Quest.Namespace(
        namespaceName: "namespace-0001"
    ).QuestGroupModel(
        questGroupName: "quest-group-0001"
    );
    
    // イベントハンドリングを開始
    var callbackId = domain.SubscribeQuestModels(
        () => {
            // リストの要素が変化した時に呼び出される
        }
    );

    // イベントハンドリングを停止
    domain.UnsubscribeQuestModels(callbackId);
    const auto Domain = Gs2->Quest->Namespace(
        "namespace-0001" // namespaceName
    )->QuestGroupModel(
        "quest-group-0001" // questGroupName
    );
    
    // イベントハンドリングを開始
    const auto CallbackId = Domain->SubscribeQuestModels(
        []() {
            // リストの要素が変化した時に呼び出される
        }
    );

    // イベントハンドリングを停止
    Domain->UnsubscribeQuestModels(CallbackId);