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> | | [] | | List of Completed Task Names |
receivedMissionTaskNames | List<string> | | [] | | List of Reward has been received Task Names |
EzCounterScopeModel
| Type | Require | Default | Limitation | Description |
---|
resetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | ✓ | | ~ 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 |
EzConfig
| Type | Require | Default | Limitation | Description |
---|
key | string | ✓ | | ~ 64 chars | Name |
value | string | | | ~ 51200 chars | Value |
EzAcquireAction
| Type | Require | Default | Limitation | Description |
---|
action | enum [] | ✓ | | ~ 128 chars | Types of actions to be performed in the stamp sheet |
request | string | ✓ | | ~ 1048576 chars | JSON of request |
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> | | | | 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> | ✓ | [] | | 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> | | | | 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 |
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 |
counterName | string | ✓ | | ~ 128 chars | Counter Name |
targetValue | long | ✓ | | 1 ~ 9223372036854775805 | Target value |
completeAcquireActions | List<EzAcquireAction> | | [] | | 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 |
EzScopedValue
| Type | Require | Default | Limitation | Description |
---|
resetType | enum [’notReset’, ‘daily’, ‘weekly’, ‘monthly’] | ✓ | | ~ 128 chars | Reset timing |
value | long | ✓ | 0 | ~ 9223372036854775805 | Count value |
Methods
getComplete
Retrieve accomplished missions by specifying the mission group
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 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(
AccessToken
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto item = Domain.Model();
listCompletes
Get list of accomplished missions
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
pageToken | string | | | ~ 1024 chars | Token specifying the position from which to start acquiring data |
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description |
---|
items | List<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(
AccessToken
);
const auto It = Domain->Completes(
);
for (auto Item : *It)
{
}
receiveRewards
Obtain rewards for mission accomplishment
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 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 | Transaction ID of the stamp sheet issued |
stampSheet | string | Stamp sheet to receive rewards for mission accomplishment |
stampSheetEncryptionKeyId | string | Cryptographic key GRN used for stamp sheet signature calculations |
autoRunStampSheet | bool | Is stamp sheet 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.ReceiveRewards(
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(
AccessToken
)->Complete(
"mission-group-0001" // missionGroupName
);
const auto Future = Domain->ReceiveRewards(
"mission-task-0001"
);
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 | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
counterName | string | ✓ | | ~ 128 chars | Counter Name |
Result
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(
AccessToken
)->Counter(
"quest_complete" // counterName
);
const auto item = Domain.Model();
listCounters
Get list of accomplished missions
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
accessToken | string | ✓ | | ~ 128 chars | User Id |
pageToken | string | | | ~ 1024 chars | Token specifying the position from which to start acquiring data |
limit | int | ✓ | 30 | 1 ~ 1000 | Number of data acquired |
Result
| Type | Description |
---|
items | List<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(
AccessToken
);
const auto It = Domain->Counters(
);
for (auto Item : *It)
{
}
getCounterModel
Get Counter Model
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
counterName | string | ✓ | | ~ 128 chars | Counter Name |
Result
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 item = Domain.Model();
listCounterModels
Get list of counter models
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
Result
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(
);
for (auto Item : *It)
{
}
getMissionGroupModel
Get mission group model by specifying mission group name
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | ✓ | | ~ 128 chars | Mission Group Name |
Result
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 item = Domain.Model();
listMissionGroupModels
Get list of mission group models
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
Result
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(
);
for (auto Item : *It)
{
}
getMissionTaskModel
Obtain a mission task model by specifying the mission task name
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | ✓ | | ~ 128 chars | Mission Group Name |
missionTaskName | string | ✓ | | ~ 128 chars | Task Name |
Result
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 item = Domain.Model();
listMissionTaskModels
Get list of mission task models
Request
| Type | Require | Default | Limitation | Description |
---|
namespaceName | string | ✓ | | ~ 32 chars | Namespace name |
missionGroupName | string | ✓ | | ~ 128 chars | Mission Group Name |
Result
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(
);
for (auto Item : *It)
{
}
Event Handler
OnCompleteNotification
Notification used when mission tasks are accomplished
Name | Type | Description |
---|
namespaceName | string | Namespace name |
groupName | string | Mission Group Name |
taskName | string | Mission Task Name |
Implementation Example
gs2.Mission.OnCompleteNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var groupName = notification.GroupName;
var taskName = notification.TaskName;
};
gs2.Mission.OnCompleteNotification += notification =>
{
var namespaceName = notification.NamespaceName;
var groupName = notification.GroupName;
var taskName = notification.TaskName;
};
Gs2->Mission->OnCompleteNotification().AddLambda([](const auto Notification)
{
const auto NamespaceName = Notification->NamespaceNameValue;
const auto GroupName = Notification->GroupNameValue;
const auto TaskName = Notification->TaskNameValue;
});