API Reference of GS2-Mission SDK for Game Engine
Model
EzComplete
Mission Completion Status
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | ||
| completedMissionTaskNames | List<string> | [] | 0 ~ 1000 items | List of Completed Task Names | ||
| receivedMissionTaskNames | List<string> | [] | 0 ~ 1000 items | List of Reward has been received Task Names |
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 | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Counter Name | ||
| values | List<EzScopedValue> | [] | 0 ~ 32 items | Value |
EzCounterScopeModel
Counter Reset Timing Model
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| scopeType | String Enum enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | Scope type
| ||||||||||||||||||
| resetType | String Enum enum { “notReset”, “daily”, “weekly”, “monthly”, “days” } | ✓ | “notReset” | 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.) * Required if resetType is “monthly” | |||||||||||||||||
| resetDayOfWeek | String Enum enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓* | Day of the week to reset
* Required if resetType is “weekly” | ||||||||||||||||||
| resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓* | 0 ~ 23 | Hour of Reset * Required if resetType is “monthly”,“weekly”,“daily” | |||||||||||||||||
| conditionName | string | {scopeType} == “verifyAction” | ✓* | ~ 128 chars | Condition Name * Required if scopeType is “verifyAction” | |||||||||||||||||
| condition | EzVerifyAction | {scopeType} == “verifyAction” | ✓* | Condition * Required if scopeType is “verifyAction” | ||||||||||||||||||
| anchorTimestamp | long | {resetType} == “days” | ✓* | Base date and time for counting elapsed days Unix time, milliseconds * Required if resetType is “days” | ||||||||||||||||||
| days | int | {resetType} == “days” | ✓* | 1 ~ 2147483646 | Number of days to reset * Required if resetType is “days” |
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 | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Counter Model name Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| metadata | string | ~ 1024 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||
| 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 | Condition | Required | Default | Value Limits | Description | |||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Mission Group Model name Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||||||
| metadata | string | ~ 1024 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||||||||||||
| tasks | List<EzMissionTaskModel> | [] | 0 ~ 1000 items | List of Mission Task | ||||||||||||||||||
| resetType | String Enum enum { “notReset”, “daily”, “weekly”, “monthly”, “days” } | ✓ | “notReset” | 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.) * Required if resetType is “monthly” | |||||||||||||||||
| resetDayOfWeek | String Enum enum { “sunday”, “monday”, “tuesday”, “wednesday”, “thursday”, “friday”, “saturday” } | {resetType} == “weekly” | ✓* | Day of the week to reset
* Required if resetType is “weekly” | ||||||||||||||||||
| resetHour | int | {resetType} in [“monthly”, “weekly”, “daily”] | ✓* | 0 ~ 23 | Hour of Reset * Required if resetType is “monthly”,“weekly”,“daily” | |||||||||||||||||
| completeNotificationNamespaceId | string | ~ 1024 chars | Namespace GRN |
EzMissionTaskModel
Mission Task Model
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 | Condition | Required | Default | Value Limits | Description | |||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| name | string | ✓ | ~ 128 chars | Task Model Name Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||
| metadata | string | ~ 1024 chars | Metadata Arbitrary values can be set in the metadata. Since they do not affect GS2’s behavior, they can be used to store information used in the game. | |||||||||
| verifyCompleteType | String Enum enum { “counter”, “verifyActions” } | ✓ | “counter” | Completion criteria type
| ||||||||
| targetCounter | EzTargetCounterModel | {verifyCompleteType} == “counter” | ✓* | Target Counter * Required if verifyCompleteType is “counter” | ||||||||
| verifyCompleteConsumeActions | List<EzVerifyAction> | {verifyCompleteType} == “verifyActions” | [] | 0 ~ 10 items | Verify actions when task is accomplished * Enabled if verifyCompleteType is “verifyActions” | |||||||
| completeAcquireActions | List<EzAcquireAction> | [] | 0 ~ 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 |
EzTargetCounterModel
Target Counter
Information about the counter that serves as the achievement goal for the mission
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| counterName | string | ✓ | ~ 128 chars | Counter Model name Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||||||||||||||
| scopeType | String Enum enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | Scope type
| ||||||||||||||
| resetType | String Enum enum { “notReset”, “daily”, “weekly”, “monthly”, “days” } | {scopeType} == “resetTiming” | Target Reset timing
* Enabled if scopeType is “resetTiming” | |||||||||||||||
| conditionName | string | {scopeType} == “verifyAction” | ✓* | ~ 128 chars | Condition Name * Required if scopeType is “verifyAction” | |||||||||||||
| value | long | ✓ | 0 ~ 9223372036854775805 | Target value |
EzConfig
Configuration
Set values to be applied to transaction variables
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| key | string | ✓ | ~ 64 chars | Name | ||
| value | string | ~ 51200 chars | Value |
EzAcquireAction
Acquire Action
EzConsumeAction
Consume Action
EzVerifyAction
Verify Action
EzScopedValue
Counter value, reset timing, and other scope information
| Type | Condition | Required | Default | Value Limits | Description | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| scopeType | String Enum enum { “resetTiming”, “verifyAction” } | ✓ | “resetTiming” | Scope type
| ||||||||||||||
| resetType | String Enum enum { “notReset”, “daily”, “weekly”, “monthly”, “days” } | {scopeType} == “resetTiming” | ✓* | Reset timing
* Required if scopeType is “resetTiming” | ||||||||||||||
| conditionName | string | {scopeType} == “verifyAction” | ✓* | ~ 128 chars | Condition Name * Required if scopeType is “verifyAction” | |||||||||||||
| value | long | ✓ | 0 | 0 ~ 9223372036854775805 | Count value |
EzVerifyActionResult
Verify action execution result
EzConsumeActionResult
Consume action execution result
EzAcquireActionResult
Acquire action execution result
EzTransactionResult
Transaction execution results
Transaction execution results executed using server-side transaction auto-execution functionality
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| transactionId | string | ✓ | 36 ~ 36 chars | Transaction ID | ||
| verifyResults | List<EzVerifyActionResult> | 0 ~ 10 items | List of verify action execution results | |||
| consumeResults | List<EzConsumeActionResult> | [] | 0 ~ 10 items | List of consume action execution results | ||
| acquireResults | List<EzAcquireActionResult> | [] | 0 ~ 100 items | List of acquire action execution results |
Methods
batchReceiveRewards
Receive rewards for mission accomplishment in bulk
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | ||
| missionTaskNames | List<string> | ✓ | 1 ~ 100 items | Task name list | ||
| gameSession | GameSession | ✓ | GameSession | |||
| config | List<EzConfig> | [] | 0 ~ 32 items | Set values to be applied to transaction variables |
Result
| Type | Description | |
|---|---|---|
| transactionId | string | Issued 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 | Whether automatic transaction execution is enabled |
| atomicCommit | bool | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | EzTransactionResult | Transaction execution result |
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",
},
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.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",
},
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->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
// config
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}evaluateComplete
Evaluate accomplishment status
Re-evaluate the accomplishment status when adding a mission task later.
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | ||
| gameSession | GameSession | ✓ | GameSession |
Result
| Type | Description | |
|---|---|---|
| item | EzComplete | Updated Achievement |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var result = await domain.EvaluateCompleteAsync(
);
var item = await result.ModelAsync(); var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var future = domain.EvaluateCompleteFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->EvaluateComplete(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();getComplete
Retrieve accomplished missions by specifying the mission group
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | ||
| gameSession | GameSession | ✓ | GameSession |
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.ModelFuture();
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"
);
// 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); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listCompletes
Get list of accomplished missions
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| 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
);
// Start event handling
var callbackId = domain.SubscribeCompletes(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeCompletes(callbackId); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
receiveRewards
Get rewards for mission accomplishment
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Name | ||
| missionTaskName | string | ✓ | ~ 128 chars | Task Name Task-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| config | List<EzConfig> | [] | 0 ~ 32 items | Set values to be applied to transaction variables |
Result
| Type | Description | |
|---|---|---|
| transactionId | string | Issued 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 | Whether automatic transaction execution is enabled |
| atomicCommit | bool | Whether to commit the transaction atomically |
| transaction | string | Issued transaction |
| transactionResult | EzTransactionResult | Transaction execution result |
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",
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.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Complete(
missionGroupName: "mission-group-0001"
);
var future = domain.ReceiveRewardsFuture(
missionTaskName: "mission-task-0001",
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->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->ReceiveRewards(
"mission-task-0001" // missionTaskName
// config
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}deleteCounter
Reset counter
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| counterName | string | ✓ | ~ 128 chars | Counter Name |
Result
| Type | Description | |
|---|---|---|
| item | EzCounter | Deleted counters |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "counter-0001"
);
var result = await domain.DeleteCounterAsync(
); var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "counter-0001"
);
var future = domain.DeleteCounterFuture(
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
} const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Counter(
"counter-0001" // counterName
);
const auto Future = Domain->DeleteCounter(
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
const auto Result = Future->GetTask().Result();getCounter
Get a Counter
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| 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.ModelFuture();
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"
);
// 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); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listCounters
Get list of counters
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| 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
);
// Start event handling
var callbackId = domain.SubscribeCounters(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeCounters(callbackId); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
resetCounter
Reset part of the scope of the counter
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| gameSession | GameSession | ✓ | GameSession | |||
| counterName | string | ✓ | ~ 128 chars | Counter Name | ||
| scopes | List<EzScopedValue> | ✓ | 1 ~ 20 items | List of scopes |
Result
| Type | Description | |
|---|---|---|
| item | EzCounter | Deleted counters |
Implementation Example
var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "counter-0001"
);
var result = await domain.ResetCounterAsync(
scopes: new List<Gs2.Unity.Gs2Mission.Model.EzScopedValue> {
new Gs2.Unity.Gs2Mission.Model.EzScopedValue() {
ResetType = "daily",
},
new Gs2.Unity.Gs2Mission.Model.EzScopedValue() {
ResetType = "weekly",
},
}
);
var item = await result.ModelAsync(); var domain = gs2.Mission.Namespace(
namespaceName: "namespace-0001"
).Me(
gameSession: GameSession
).Counter(
counterName: "counter-0001"
);
var future = domain.ResetCounterFuture(
scopes: new List<Gs2.Unity.Gs2Mission.Model.EzScopedValue> {
new Gs2.Unity.Gs2Mission.Model.EzScopedValue() {
ResetType = "daily",
},
new Gs2.Unity.Gs2Mission.Model.EzScopedValue() {
ResetType = "weekly",
},
}
);
yield return future;
if (future.Error != null)
{
onError.Invoke(future.Error, null);
yield break;
}
var future2 = future.Result.ModelFuture();
yield return future2;
if (future2.Error != null)
{
onError.Invoke(future2.Error, null);
yield break;
}
var result = future2.Result; const auto Domain = Gs2->Mission->Namespace(
"namespace-0001" // namespaceName
)->Me(
GameSession
)->Counter(
"counter-0001" // counterName
);
const auto Future = Domain->ResetCounter(
[]
{
auto v = MakeShared<TArray<TSharedPtr<Gs2::UE5::Mission::Model::FEzScopedValue>>>();
v->Add(
MakeShared<Gs2::UE5::Mission::Model::FEzScopedValue>()
->WithResetType(TOptional<FString>("daily"))
);
v->Add(
MakeShared<Gs2::UE5::Mission::Model::FEzScopedValue>()
->WithResetType(TOptional<FString>("weekly"))
);
return v;
}() // scopes
);
Future->StartSynchronousTask();
if (Future->GetTask().IsError())
{
return false;
}
// obtain changed values / result values
const auto Future2 = Future->GetTask().Result()->Model();
Future2->StartSynchronousTask();
if (Future2->GetTask().IsError())
{
return Future2->GetTask().Error();
}
const auto Result = Future2->GetTask().Result();getCounterModel
Get Counter Model
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| counterName | string | ✓ | ~ 128 chars | Counter Model name Counter Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
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.ModelFuture();
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"
);
// 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); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listCounterModels
Get list of counter models
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
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"
);
// Start event handling
var callbackId = domain.SubscribeCounterModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeCounterModels(callbackId); 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.
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 | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Model name Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
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.ModelFuture();
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"
);
// 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); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listMissionGroupModels
Get list of mission group models
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
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"
);
// Start event handling
var callbackId = domain.SubscribeMissionGroupModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeMissionGroupModels(callbackId); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
getMissionTaskModel
Get mission task model by specifying mission task name
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Model name Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionTaskName | string | ✓ | ~ 128 chars | Task Model Name Task Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
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.ModelFuture();
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"
);
// 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); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
listMissionTaskModels
Get list of mission task models
Request
| Type | Condition | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|---|
| namespaceName | string | ✓ | ~ 128 chars | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). | ||
| missionGroupName | string | ✓ | ~ 128 chars | Mission Group Model name Mission Group Model-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
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"
);
// Start event handling
var callbackId = domain.SubscribeMissionTaskModels(
() => {
// Called when an element of the list changes.
}
);
// Stop event handling
domain.UnsubscribeMissionTaskModels(callbackId); 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.
Therefore, callbacks will not be invoked if the value is changed in any other way.
Event Handler
OnCompleteNotification
Push notification used when mission tasks are accomplished
| Name | Type | Description |
|---|---|---|
| namespaceName | string | Namespace name Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.). |
| 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;
});