API Reference of GS2-Quest SDK for Game Engine
Model
EzContents
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
metadata | string | ~ 256 chars | metadata | ||
completeAcquireActions | List<EzAcquireAction> | [] | ~ 10 items | Rewards for completing quests |
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 |
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 |
EzReward
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
action | enum [] | ✓ | ~ 128 chars | Types of actions to be performed in the stamp sheet | |
request | string | ✓ | ~ 5242880 chars | Request Model | |
itemId | string | ✓ | ~ 1024 chars | Obtain Resource GRN | |
value | int | ✓ | ~ 2147483646 | Quantity to be obtained |
EzConfig
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | |
value | string | ~ 51200 chars | Value |
EzProgress
Quest Progress
It is created at the beginning of the quest and deleted at the end.
When you exit the application in the middle of an ingame, this data will remain. It is possible to resume the game from the ongoing quest information maintained by the entity.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
progressId | string | ✓ | ~ 1024 chars | Quest Progress GRN | |
transactionId | string | ✓ | UUID | ~ 36 chars | Transaction ID |
questModelId | string | ✓ | ~ 1024 chars | Quest model GRN in progress | |
randomSeed | long | ✓ | ~ 9223372036854775805 | Random number seed | |
rewards | List<EzReward> | [] | ~ 1000 items | Maximum rewards earned from quests |
EzCompletedQuestList
List of completed quests
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
questGroupName | string | ✓ | ~ 128 chars | Quest Group Name | |
completeQuestNames | List<string> | ~ 1000 items | List of Names of the quests already conquered |
EzQuestGroupModel
Quest Group Model
A quest group is an entity for grouping multiple quests, and only one quest progression can be executed simultaneously within the group. This means that if you need to be able to progress quests in parallel, you must separate the groups.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Quest Group Name | |
metadata | string | ~ 1024 chars | metadata | ||
quests | List<EzQuestModel> | ~ 1000 items | Quests belonging to the group | ||
challengePeriodEventId | string | ~ 1024 chars | GS2-Schedule event GRN that sets the time period during which the quest can be attempted. |
EzQuestModel
Quest Model
A quest is an entity that holds the consideration required to start ingame and the reward for completing it.
The reward obtained upon completion of the quest can have multiple variations and can be drawn at the start of the quest. For example, the same content can be used to manage the clear flag of a quest, but two types of content can be prepared based on whether or not a rare monster appears.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
questModelId | string | ✓ | ~ 1024 chars | Quest Model GRN | |
name | string | ✓ | ~ 128 chars | Quest Model Name | |
metadata | string | ~ 1024 chars | metadata | ||
contents | List<EzContents> | ✓ | 1 ~ 10 items | Quest Description | |
challengePeriodEventId | string | ~ 1024 chars | GS2-Schedule event GRN that sets the time period during which the quest can be attempted. | ||
firstCompleteAcquireActions | List<EzAcquireAction> | [] | ~ 10 items | List of First Clear Reward Actions | |
consumeActions | List<EzConsumeAction> | [] | ~ 10 items | Quest entry fee | |
failedAcquireActions | List<EzAcquireAction> | [] | ~ 100 items | Reward for quest failure | |
premiseQuestNames | List<string> | [] | ~ 10 items | Name of the quest that must be completed in order to attempt the quest |
Methods
deleteProgress
Delete quest progress information.
Use this option if you want to explicitly remove progress information instead of using the force
option at the beginning of the quest.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | EzProgress | Quest Progress |
Implementation Example
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(
AccessToken
)->Progress(
);
const auto Future = Domain->DeleteProgress(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
end
Declare the start of a quest
If a quest has already been started by the same game player, it will fail.
If you still want to force a start, specify true for the force
option.
Once a quest has been started, information about the maximum reward available for that quest will be responded to. You can exhaust that information in the quest by directing it in the quest. In doing so, design the gameplay to be reproducible using the random number seed contained in the response, so that it is easier to investigate when a random number-caused problem occurs in the application.
A Quest Transaction ID
is responded to as an ID to uniquely identify the quest in progress.
When reporting the completion of a quest, the Quest Transaction ID
is used to identify which quest the completion report is for.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
rewards | List<EzReward> | [] | ~ 1000 items | The actual rewards from the quest | |
isComplete | bool | ✓ | Completed the quest | ||
config | List<EzConfig> | [] | ~ 32 items | Set values to be applied to stamp sheet variables |
Result
Type | Description | |
---|---|---|
item | EzProgress | Quest Progress |
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheet used to execute the reward granting process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is stamp sheet auto-execution enabled? |
Implementation Example
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Progress(
);
var result = await domain.EndAsync(
isComplete: true,
rewards: new Gs2.Unity.Gs2Quest.Model.EzReward[] {
new Gs2.Unity.Gs2Quest.Model.EzReward
{},
},
config: null
);
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Progress(
);
var future = domain.EndFuture(
isComplete: true,
rewards: new Gs2.Unity.Gs2Quest.Model.EzReward[] {
new Gs2.Unity.Gs2Quest.Model.EzReward
{},
},
config: null
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Progress(
);
const auto Future = Domain->End(
true,
[]
{
const auto v = MakeShared<TArray<TSharedPtr<Gs2::Quest::Model::FReward>>>();
v->Add({});
return v;
}(), // rewards
nullptr // config
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
getProgress
Obtain information on the progress of the quest.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | EzProgress | Quest Progress |
questGroup | EzQuestGroupModel | Quest Group Model |
quest | EzQuestModel | Quest Model |
Implementation Example
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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Progress(
);
const auto Future = Domain.Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Progress(
);
// 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.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Progress(
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->Progress(
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Quest::Model::FProgress> 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.
start
Declare the start of a quest
If a quest has already been started by the same game player, it will fail.
If you still want to force a start, specify true for the force
option.
Once a quest has been started, information about the maximum reward available for that quest will be responded to. You can exhaust that information in the quest by directing it in the quest. In doing so, design the gameplay to be reproducible using the random number seed contained in the response, so that it is easier to investigate when a random number-caused problem occurs in the application.
A Quest Transaction ID
is responded to as an ID to uniquely identify the quest in progress.
When reporting the completion of a quest, the Quest Transaction ID
is used to identify which quest the completion report is for.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
questGroupName | string | ✓ | ~ 128 chars | Quest Group Name | |
questName | string | ✓ | ~ 128 chars | Quest Name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
force | bool | ✓ | false | If have a quest already started, you can discard it and start it | |
config | List<EzConfig> | [] | ~ 32 items | Set values to be applied to stamp sheet variables |
Result
Type | Description | |
---|---|---|
transactionId | string | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheet used to execute the quest initiation process |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is stamp sheet auto-execution enabled? |
Error
Special exceptions are defined in this API. GS2-SDK for GameEngine provides specialized exceptions derived from general exceptions to facilitate handling of errors that may need to be handled in games. Please refer to the documentation here for more information on common error types and handling methods.
Type | Base Type | Description |
---|---|---|
InProgressException | BadRequestException | Quest is already underway. |
Implementation Example
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.InProgress e) {
// Quest is already underway.
}
// New Experience ではスタンプシートはSDKレベルで自動的に実行されます。
// エラーが発生すると TransactionException がスローされます。
// TransactionException::Retry() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
var domain = gs2.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() でリトライが可能です。
// In New Experience, stamp sheets are automatically executed at the SDK level.
// If an error occurs, a TransactionException is thrown.
// you can retry with TransactionException::Retry().
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
);
const auto Future = Domain->Start(
"group-0001",
"quest-0001",
nullptr, // force
nullptr // config
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
if (Gs2::Quest::Error::FInProgressError::TypeString == Task->GetTask().Error()->Type())
{
// Quest is already underway.
}
return false;
}
describeCompletedQuestLists
Get list of quest progress information
Each quest group is registered as a single Quest Progress Information The
Quest Progress Information` contains list of completed quest names in the quest group.
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
pageToken | string | ~ 1024 chars | Token specifying the position from which to start acquiring data | ||
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
Type | Description | |
---|---|---|
items | List<EzCompletedQuestList> | List of Quest Progressios |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
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(
AccessToken
);
const auto It = Domain->CompletedQuestLists(
);
for (auto Item : *It)
{
}
getCompletedQuestList
Get quest progress information
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
questGroupName | string | ✓ | ~ 128 chars | Quest Group Name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | EzCompletedQuestList | Quest Progression |
Implementation Example
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.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->CompletedQuestList(
"main" // questGroupName
);
const auto Future = Domain.Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).CompletedQuestList(
questGroupName: "main"
);
// 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.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).CompletedQuestList(
questGroupName: "main"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
AccessToken
)->CompletedQuestList(
"main" // questGroupName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Quest::Model::FCompletedQuestList> 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.
getQuestGroup
Get list of quest groups
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
questGroupName | string | ✓ | ~ 128 chars | Quest Group Name |
Result
Type | Description | |
---|---|---|
item | EzQuestGroupModel | Quest Group Model |
Implementation Example
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.Model();
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;
}
Value change event handling
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).QuestGroupModel(
questGroupName: "quest-group-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.Quest.Namespace(
namespaceName: "namespace-0001"
).QuestGroupModel(
questGroupName: "quest-group-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->QuestGroupModel(
"quest-group-0001" // questGroupName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Quest::Model::FQuestGroupModel> 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.
listQuestGroups
Get list of quest groups
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<EzQuestGroupModel> | List of Quest Group Models |
Implementation Example
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(
);
for (auto Item : *It)
{
}
Value change event handling
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeQuestGroupModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeQuestGroupModels(callbackId);
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
);
// Start event handling
const auto CallbackId = Domain->SubscribeQuestGroupModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeQuestGroupModels(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.
getQuest
Get Quest Model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
questGroupName | string | ✓ | ~ 128 chars | Quest Group Name | |
questName | string | ✓ | ~ 128 chars | Quest Model Name |
Result
Type | Description | |
---|---|---|
item | EzQuestModel |
Implementation Example
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.Model();
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;
}
Value change event handling
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).QuestGroupModel(
questGroupName: "quest-group-0001"
).QuestModel(
questName: "quest-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.Quest.Namespace(
namespaceName: "namespace-0001"
).QuestGroupModel(
questGroupName: "quest-group-0001"
).QuestModel(
questName: "quest-0001"
);
var future = domain.Model();
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
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Quest::Model::FQuestModel> 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.
listQuests
Get list of quest models
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 32 chars | Namespace name | |
questGroupName | string | ✓ | ~ 128 chars | Quest Group Name |
Result
Type | Description | |
---|---|---|
items | List<EzQuestModel> | List of Quest Models |
Implementation Example
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(
);
for (auto Item : *It)
{
}
Value change event handling
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).QuestGroupModel(
questGroupName: "quest-group-0001"
);
// Start event handling
var callbackId = domain.SubscribeQuestModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeQuestModels(callbackId);
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
);
// Start event handling
const auto CallbackId = Domain->SubscribeQuestModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeQuestModels(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.