API Reference of GS2-Mission SDK for Game Engine
Model
EzComplete
Mission Accomplishments
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | |
completedMissionTaskNames | List<string> | [] | ~ 1000 items | List of Completed Task Names | |
receivedMissionTaskNames | List<string> | [] | ~ 1000 items | List of Reward has been received Task Names |
EzCounterScopeModel
Counter Reset Timing Model
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ~ 128 chars | Reset timing | |
resetDayOfMonth | int | {resetType} == “monthly” | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ~ 128 chars | Day of the week to reset | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ~ 23 | Hour of Reset |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Enumeration type definition to specify as resetDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
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 |
EzAcquireAction
Acquire Action
EzConsumeAction
Consume Action
EzVerifyAction
Verify Action
EzCounter
Counter
A counter is an entity that keeps track of mission progress for each game player. Counter values are aggregated by the duration of the associated task.
Therefore, one counter can have multiple values. For example, for a quest clear count counter, the number of times the quest was completed this month, this week, and today. For example, a quest clear count counter could have the following values.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Counter Name | |
values | List<EzScopedValue> | ~ 32 items | Value |
EzCounterModel
Counter Model
The counter model is an entity that can be set as a condition for accomplishing mission tasks. Since counter values can be referenced by multiple mission groups, a single counter can be set as an accomplishment condition for multiple mission groups, such as weekly and daily missions.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Counter Name | |
metadata | string | ~ 1024 chars | metadata | ||
scopes | List<EzCounterScopeModel> | ✓ | [] | 1 ~ 20 items | List of Counter reset timing |
challengePeriodEventId | string | ~ 1024 chars | GS2-Schedule event GRN that sets the period during which the counter can be operated. |
EzMissionGroupModel
Mission Group Model
A mission group is an entity that groups tasks by counter reset timing. For example, one group for daily missions. One group for Weekly Mission.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Mission Group Name | |
metadata | string | ~ 1024 chars | metadata | ||
tasks | List<EzMissionTaskModel> | ~ 1000 items | List of Mission Task | ||
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | ✓ | “notReset” | ~ 128 chars | Reset timing |
resetDayOfMonth | int | {resetType} == “monthly” | 1 ~ 31 | Date to reset (If the value exceeds the days of the month, it is treated as the last day.) | |
resetDayOfWeek | enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ~ 128 chars | Day of the week to reset | |
resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ~ 23 | Hour of Reset | |
completeNotificationNamespaceId | string | ~ 1024 chars | Namespace GRN |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Enumeration type definition to specify as resetDayOfWeek
Enumerator String Definition | Description |
---|---|
sunday | Sunday |
monday | Monday |
tuesday | Tuesday |
wednesday | Wednesday |
thursday | Thuesday |
friday | Friday |
saturday | Saturday |
EzMissionTaskModel
Mission Task Model Master
A mission task is an entity that defines the conditions under which a reward will be given if the value of the associated counter exceeds a certain level.
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
name | string | ✓ | ~ 128 chars | Task Name | |
metadata | string | ~ 1024 chars | metadata | ||
verifyCompleteType | enum { “counter”, “verifyActions” } | ✓ | “counter” | ~ 128 chars | Completion criteria type |
targetCounter | EzTargetCounterModel | {verifyCompleteType} == “counter” | Target Counter | ||
verifyCompleteConsumeActions | List<EzVerifyAction> | {verifyCompleteType} == “consumeActions” | ~ 10 items | Verify actions when task is accomplished | |
completeAcquireActions | List<EzAcquireAction> | [] | ~ 100 items | Rewards for mission accomplishment | |
challengePeriodEventId | string | ~ 1024 chars | GS2-Schedule event GRN with a set period of time during which rewards can be received | ||
premiseMissionTaskName | string | ~ 128 chars | Name of the tasks accomplish to attempt this task |
Enumeration type definition to specify as verifyCompleteType
Enumerator String Definition | Description |
---|---|
counter | Counter |
verifyActions | Verify Actions |
EzTargetCounterModel
Target Counter
Information about the counter that serves as the achievement goal for the mission
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
counterName | string | ✓ | ~ 128 chars | Counter Name | |
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ~ 128 chars | Target Reset timing | |
value | long | ✓ | 1 ~ 9223372036854775805 | Target value |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
EzScopedValue
Reset timing
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
resetType | enum { “notReset”, “daily”, “weekly”, “monthly” } | {scopeType} == “resetTiming” | ~ 128 chars | Reset timing | |
value | long | ✓ | 0 | ~ 9223372036854775805 | Count value |
Enumeration type definition to specify as resetType
Enumerator String Definition | Description |
---|---|
notReset | Not resetting. |
daily | Daily |
weekly | Weekly |
monthly | Monthly |
Methods
batchReceiveRewards
Receive rewards for mission accomplishment in bulk
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | |
missionTaskNames | List<string> | ✓ | 1 ~ 100 items | Task name list | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
transactionId | string | Issed transaction ID |
stampSheet | string | Stamp sheet to receive rewards for mission accomplishment |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is transaction auto-execution enabled? |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var result = await domain.BatchReceiveRewardsAsync(
missionTaskNames: new List<string> {
"mission-task-0001",
"mission-task-0002",
}
);
// 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.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var future = domain.BatchReceiveRewardsFuture(
missionTaskNames: new List<string> {
"mission-task-0001",
"mission-task-0002",
}
);
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->BatchReceiveRewards(
[]
{
auto v = TOptional<TArray<FString>>();
v->Add("mission-task-0001");
v->Add("mission-task-0002");
return v;
}() // missionTaskNames
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
getComplete
Retrieve accomplished missions by specifying the mission group
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
item | EzComplete | status of achievement |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-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.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Complete(
"mission-group-0001" // missionGroupName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Mission::Model::FComplete> 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.
listCompletes
Get list of accomplished missions
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<EzComplete> | List of status of achievement |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.CompletesAsync(
).ToListAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Completes(
);
List<EzComplete> items = new List<EzComplete>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->Completes(
);
TArray<Gs2::UE5::Mission::Model::FEzCompletePtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeCompletes(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeCompletes(callbackId);
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Completes(
);
List<EzComplete> items = new List<EzComplete>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeCompletes(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeCompletes(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.
receiveRewards
Obtain rewards for mission accomplishment
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | |
missionTaskName | string | ✓ | ~ 128 chars | Task Name | |
accessToken | string | ✓ | ~ 128 chars | User Id |
Result
Type | Description | |
---|---|---|
transactionId | string | Issed transaction ID |
stampSheet | string | Stamp sheet to receive rewards for mission accomplishment |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is transaction auto-execution enabled? |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var result = await domain.ReceiveRewardsAsync(
missionTaskName: "mission-task-0001"
);
// 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.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var future = domain.ReceiveRewardsFuture(
missionTaskName: "mission-task-0001"
);
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->ReceiveRewards(
"mission-task-0001" // missionTaskName
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
getCounter
Retrieve accomplished missions by specifying the mission group
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
accessToken | string | ✓ | ~ 128 chars | User Id | |
counterName | string | ✓ | ~ 128 chars | Counter Name |
Result
Type | Description | |
---|---|---|
item | EzCounter | Counter |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "quest_complete"
);
var item = await domain.ModelAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "quest_complete"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Counter(
"quest_complete" // counterName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "quest_complete"
);
// 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.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "quest_complete"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Counter(
"quest_complete" // counterName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Mission::Model::FCounter> 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.
listCounters
Get list of accomplished missions
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<EzCounter> | List of Counter |
nextPageToken | string | Page token to retrieve the rest of the listing |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var items = await domain.CountersAsync(
).ToListAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Counters(
);
List<EzCounter> items = new List<EzCounter>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
const auto It = Domain->Counters(
);
TArray<Gs2::UE5::Mission::Model::FEzCounterPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
// Start event handling
var callbackId = domain.SubscribeCounters(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeCounters(callbackId);
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
);
var it = domain.Counters(
);
List<EzCounter> items = new List<EzCounter>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
);
// Start event handling
const auto CallbackId = Domain->SubscribeCounters(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeCounters(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.
getCounterModel
Get Counter Model
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
counterName | string | ✓ | ~ 128 chars | Counter Name |
Result
Type | Description | |
---|---|---|
item | EzCounterModel | Counter Model |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).CounterModel(
counterName: "counter-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).CounterModel(
counterName: "counter-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->CounterModel(
"counter-0001" // counterName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).CounterModel(
counterName: "counter-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.Mission.Namespace(
namespaceName: "namespace-0001"
).CounterModel(
counterName: "counter-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->CounterModel(
"counter-0001" // counterName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Mission::Model::FCounterModel> 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.
listCounterModels
Get list of counter models
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<EzCounterModel> | List of Counter Model |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.CounterModelsAsync(
).ToListAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.CounterModels(
);
List<EzCounterModel> items = new List<EzCounterModel>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->CounterModels(
);
TArray<Gs2::UE5::Mission::Model::FEzCounterModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeCounterModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeCounterModels(callbackId);
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.CounterModels(
);
List<EzCounterModel> items = new List<EzCounterModel>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeCounterModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeCounterModels(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.
getMissionGroupModel
Get mission group model by specifying mission group name
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name |
Result
Type | Description | |
---|---|---|
item | EzMissionGroupModel | Mission group model |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->MissionGroupModel(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-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.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->MissionGroupModel(
"mission-group-0001" // missionGroupName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Mission::Model::FMissionGroupModel> 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.
listMissionGroupModels
Get list of mission group models
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name |
Result
Type | Description | |
---|---|---|
items | List<EzMissionGroupModel> | List of Mission Group Model |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
var items = await domain.MissionGroupModelsAsync(
).ToListAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.MissionGroupModels(
);
List<EzMissionGroupModel> items = new List<EzMissionGroupModel>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
);
const auto It = Domain->MissionGroupModels(
);
TArray<Gs2::UE5::Mission::Model::FEzMissionGroupModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
// Start event handling
var callbackId = domain.SubscribeMissionGroupModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeMissionGroupModels(callbackId);
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
);
var it = domain.MissionGroupModels(
);
List<EzMissionGroupModel> items = new List<EzMissionGroupModel>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
);
// Start event handling
const auto CallbackId = Domain->SubscribeMissionGroupModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeMissionGroupModels(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.
getMissionTaskModel
Obtain a mission task model by specifying the mission task name
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | |
missionTaskName | string | ✓ | ~ 128 chars | Task Name |
Result
Type | Description | |
---|---|---|
item | EzMissionTaskModel | Mission task model |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
).MissionTaskModel(
missionTaskName: "mission-task-0001"
);
var item = await domain.ModelAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
).MissionTaskModel(
missionTaskName: "mission-task-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->MissionGroupModel(
"mission-group-0001" // missionGroupName
)->MissionTaskModel(
"mission-task-0001" // missionTaskName
);
const auto Future = Domain->Model();
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
).MissionTaskModel(
missionTaskName: "mission-task-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.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
).MissionTaskModel(
missionTaskName: "mission-task-0001"
);
var future = domain.Model();
yield return future;
var item = future.Result;
const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->MissionGroupModel(
"mission-group-0001" // missionGroupName
)->MissionTaskModel(
"mission-task-0001" // missionTaskName
);
// Start event handling
const auto CallbackId = Domain->Subscribe(
[](TSharedPtr<Gs2::Mission::Model::FMissionTaskModel> 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.
listMissionTaskModels
Get list of mission task models
Request
Type | Require | Default | Limitation | Description | |
---|---|---|---|---|---|
namespaceName | string | ✓ | ~ 128 chars | Namespace name | |
missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name |
Result
Type | Description | |
---|---|---|
items | List<EzMissionTaskModel> | List of Mission Task Model |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
var items = await domain.MissionTaskModelsAsync(
).ToListAsync();
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
var it = domain.MissionTaskModels(
);
List<EzMissionTaskModel> items = new List<EzMissionTaskModel>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->MissionGroupModel(
"mission-group-0001" // missionGroupName
);
const auto It = Domain->MissionTaskModels(
);
TArray<Gs2::UE5::Mission::Model::FEzMissionTaskModelPtr> Result;
for (auto Item : *It)
{
if (Item.IsError())
{
return false;
}
Result.Add(Item.Current());
}
Value change event handling
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
// Start event handling
var callbackId = domain.SubscribeMissionTaskModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeMissionTaskModels(callbackId);
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).MissionGroupModel(
missionGroupName: "mission-group-0001"
);
var it = domain.MissionTaskModels(
);
List<EzMissionTaskModel> items = new List<EzMissionTaskModel>();
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->MissionGroupModel(
"mission-group-0001" // missionGroupName
);
// Start event handling
const auto CallbackId = Domain->SubscribeMissionTaskModels(
[]() {
// Called when an element of the list changes.
}
);
// Stop event handling
Domain->UnsubscribeMissionTaskModels(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.
Event Handler
OnCompleteNotification
Notification used when mission tasks are accomplished
Name | Type | Description |
---|---|---|
namespaceName | string | Namespace name |
groupName | string | Mission Group Name |
userId | string | User Id |
taskName | string | Mission Task Name |
Implementation Example
gs2.Mission.OnCompleteNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var groupName = notification.GroupName;
var userId = notification.UserId;
var taskName = notification.TaskName;
};
gs2.Mission.OnCompleteNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var groupName = notification.GroupName;
var userId = notification.UserId;
var taskName = notification.TaskName;
};
Gs2->Mission->OnCompleteNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto GroupName = Notification->GroupNameValue;
const auto UserId = Notification->UserIdValue;
const auto TaskName = Notification->TaskNameValue;
});