API Reference of GS2-Quest SDK for Game Engine
Model
EzContents
Contents
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
metadata | string | ~ 256 chars | metadata | ||
completeAcquireActions | List<EzAcquireAction> | [] | ~ 10 items | Rewards for completing quests |
EzConsumeAction
Consume Action
EzVerifyAction
Verify Action
EzAcquireAction
Acquire Action
EzReward
Reward
EzConfig
Configration
Set values to be applied to transaction variables
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
key | string | ✓ | ~ 64 chars | Name | |
value | string | ~ 51200 chars | Value |
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 | |
failedRewards | List<EzReward> | [] | ~ 1000 items | Maximum rewards earned when quest fails |
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 | |
verifyActions | List<EzVerifyAction> | [] | ~ 10 items | List of verification actions for quest participation conditions | |
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 |
EzVerifyActionResult
Verify action execution result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the verify task | |
verifyRequest | string | ✓ | ~ 1048576 chars | JSON of request | |
statusCode | int | ~ 999 | Status code | ||
verifyResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
EzConsumeActionResult
Consume action execution result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the consume action | |
consumeRequest | string | ✓ | ~ 1048576 chars | JSON of request | |
statusCode | int | ~ 999 | Status code | ||
consumeResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
EzAcquireActionResult
Acquire action execution result
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
action | enum { } | ✓ | ~ 128 chars | Types of actions to be performed in the acquire action | |
acquireRequest | string | ✓ | ~ 1048576 chars | JSON of request | |
statusCode | int | ~ 999 | Status code | ||
acquireResult | string | ~ 1048576 chars | Result payload |
Enumeration type definition to specify as action
Enumerator String Definition | Description |
---|
EzTransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | |
verifyResults | List<EzVerifyActionResult> | ~ 10 items | List of verify action execution results | ||
consumeResults | List<EzConsumeActionResult> | ~ 10 items | List of consume action execution results | ||
acquireResults | List<EzAcquireActionResult> | ~ 100 items | List of acquire action execution results |
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 | ✓ | ~ 128 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(
GameSession
)->Progress(
);
const auto Future = Domain->DeleteProgress(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();
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 | ✓ | ~ 128 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 transaction variables |
Result
Type | Description | |
---|---|---|
item | EzProgress | Quest Progress |
transactionId | string | Issed transaction ID |
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 transaction auto-execution enabled? |
atomicCommit | bool | Transaction to commit atomically |
transaction | string | Issued transaction |
transactionResult | EzTransactionResult | Transaction execution result |
Implementation Example
var domain = gs2.Quest.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Progress(
);
var result = await domain.EndAsync(
isComplete: true,
rewards: null,
config: null
);
// 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: null,
config: null
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
// 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(
GameSession
)->Progress(
);
const auto Future = Domain->End(
true // isComplete
// rewards
// 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 | ✓ | ~ 128 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.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;
}
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.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->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 | ✓ | ~ 128 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 transaction variables |
Result
Type | Description | |
---|---|---|
transactionId | string | Issed transaction ID |
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 transaction auto-execution enabled? |
atomicCommit | bool | Transaction to commit atomically |
transaction | string | Issued transaction |
transactionResult | EzTransactionResult | Transaction execution result |
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.
}
// 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;
}
// 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(
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
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 | ✓ | ~ 128 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(
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
Get quest progress information
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 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.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;
}
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.ModelFuture();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Quest->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->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 | ✓ | ~ 128 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.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;
}
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.ModelFuture();
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 | ✓ | ~ 128 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(
);
TArray<Gs2::UE5::Quest::Model::FEzQuestGroupModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
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 | ✓ | ~ 128 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.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;
}
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.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
);
// 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 | ✓ | ~ 128 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(
);
TArray<Gs2::UE5::Quest::Model::FEzQuestModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
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.