API Reference of GS2-Mission SDK for Game Engine

Model

EzComplete

Mission Accomplishments

TypeRequireDefaultLimitationDescription
missionGroupNamestring~ 128 charsMission Group Name
completedMissionTaskNamesList<string>[]~ 1000 itemsList of Completed Task Names
receivedMissionTaskNamesList<string>[]~ 1000 itemsList of Reward has been received Task Names

EzCounterScopeModel

Counter Reset Timing Model

TypeRequireDefaultLimitationDescription
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
{scopeType} == “resetTiming”~ 128 charsReset timing
resetDayOfMonthint{resetType} == “monthly”1 ~ 31Date to reset (If the value exceeds the days of the month, it is treated as the last day.)
resetDayOfWeekenum {
    “sunday”,
    “monday”,
    “tuesday”,
    “wednesday”,
    “thursday”,
    “friday”,
    “saturday”
}
{resetType} == “weekly”~ 128 charsDay of the week to reset
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23Hour of Reset

Enumeration type definition to specify as resetType

Enumerator String DefinitionDescription
notResetNot resetting.
dailyDaily
weeklyWeekly
monthlyMonthly

Enumeration type definition to specify as resetDayOfWeek

Enumerator String DefinitionDescription
sundaySunday
mondayMonday
tuesdayTuesday
wednesdayWednesday
thursdayThuesday
fridayFriday
saturdaySaturday

EzConfig

Configration

Set values to be applied to transaction variables

TypeRequireDefaultLimitationDescription
keystring~ 64 charsName
valuestring~ 51200 charsValue

EzAcquireAction

Acquire Action

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:AcquirePointByUserId",
"Gs2Dictionary:AddEntriesByUserId",
"Gs2Enchant:ReDrawBalanceParameterStatusByUserId",
"Gs2Enchant:SetBalanceParameterStatusByUserId",
"Gs2Enchant:ReDrawRarityParameterStatusByUserId",
"Gs2Enchant:AddRarityParameterStatusByUserId",
"Gs2Enchant:SetRarityParameterStatusByUserId",
"Gs2Enhance:DirectEnhanceByUserId",
"Gs2Enhance:UnleashByUserId",
"Gs2Enhance:CreateProgressByUserId",
"Gs2Exchange:ExchangeByUserId",
"Gs2Exchange:IncrementalExchangeByUserId",
"Gs2Exchange:CreateAwaitByUserId",
"Gs2Exchange:AcquireForceByUserId",
"Gs2Exchange:SkipByUserId",
"Gs2Experience:AddExperienceByUserId",
"Gs2Experience:SetExperienceByUserId",
"Gs2Experience:AddRankCapByUserId",
"Gs2Experience:SetRankCapByUserId",
"Gs2Experience:MultiplyAcquireActionsByUserId",
"Gs2Formation:AddMoldCapacityByUserId",
"Gs2Formation:SetMoldCapacityByUserId",
"Gs2Formation:AcquireActionsToFormProperties",
"Gs2Formation:SetFormByUserId",
"Gs2Formation:AcquireActionsToPropertyFormProperties",
"Gs2Friend:UpdateProfileByUserId",
"Gs2Grade:AddGradeByUserId",
"Gs2Grade:ApplyRankCapByUserId",
"Gs2Grade:MultiplyAcquireActionsByUserId",
"Gs2Guild:IncreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Guild:SetMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:IncreaseMaximumIdleMinutesByUserId",
"Gs2Idle:SetMaximumIdleMinutesByUserId",
"Gs2Idle:ReceiveByUserId",
"Gs2Inbox:SendMessageByUserId",
"Gs2Inventory:AddCapacityByUserId",
"Gs2Inventory:SetCapacityByUserId",
"Gs2Inventory:AcquireItemSetByUserId",
"Gs2Inventory:AcquireItemSetWithGradeByUserId",
"Gs2Inventory:AddReferenceOfByUserId",
"Gs2Inventory:DeleteReferenceOfByUserId",
"Gs2Inventory:AcquireSimpleItemsByUserId",
"Gs2Inventory:SetSimpleItemsByUserId",
"Gs2Inventory:AcquireBigItemByUserId",
"Gs2Inventory:SetBigItemByUserId",
"Gs2JobQueue:PushByUserId",
"Gs2Limit:CountDownByUserId",
"Gs2Limit:DeleteCounterByUserId",
"Gs2LoginReward:DeleteReceiveStatusByUserId",
"Gs2LoginReward:UnmarkReceivedByUserId",
"Gs2Lottery:DrawByUserId",
"Gs2Lottery:ResetBoxByUserId",
"Gs2Mission:RevertReceiveByUserId",
"Gs2Mission:IncreaseCounterByUserId",
"Gs2Mission:SetCounterByUserId",
"Gs2Money:DepositByUserId",
"Gs2Money:RevertRecordReceipt",
"Gs2Money2:DepositByUserId",
"Gs2Quest:CreateProgressByUserId",
"Gs2Schedule:TriggerByUserId",
"Gs2Script:InvokeScript",
"Gs2SerialKey:RevertUseByUserId",
"Gs2SerialKey:IssueOnce",
"Gs2Showcase:DecrementPurchaseCountByUserId",
"Gs2Showcase:ForceReDrawByUserId",
"Gs2SkillTree:MarkReleaseByUserId",
"Gs2Stamina:RecoverStaminaByUserId",
"Gs2Stamina:RaiseMaxValueByUserId",
"Gs2Stamina:SetMaxValueByUserId",
"Gs2Stamina:SetRecoverIntervalByUserId",
"Gs2Stamina:SetRecoverValueByUserId",
"Gs2StateMachine:StartStateMachineByUserId",
}
~ 128 charsTypes of actions to be performed in the acquire action
requeststring~ 1048576 charsJSON of request

EzConsumeAction

Consume Action

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2AdReward:ConsumePointByUserId",
"Gs2Dictionary:DeleteEntriesByUserId",
"Gs2Enhance:DeleteProgressByUserId",
"Gs2Exchange:DeleteAwaitByUserId",
"Gs2Experience:SubExperienceByUserId",
"Gs2Experience:SubRankCapByUserId",
"Gs2Formation:SubMoldCapacityByUserId",
"Gs2Grade:SubGradeByUserId",
"Gs2Guild:DecreaseMaximumCurrentMaximumMemberCountByGuildName",
"Gs2Idle:DecreaseMaximumIdleMinutesByUserId",
"Gs2Inbox:OpenMessageByUserId",
"Gs2Inbox:DeleteMessageByUserId",
"Gs2Inventory:ConsumeItemSetByUserId",
"Gs2Inventory:ConsumeSimpleItemsByUserId",
"Gs2Inventory:ConsumeBigItemByUserId",
"Gs2JobQueue:DeleteJobByUserId",
"Gs2Limit:CountUpByUserId",
"Gs2LoginReward:MarkReceivedByUserId",
"Gs2Mission:ReceiveByUserId",
"Gs2Mission:BatchReceiveByUserId",
"Gs2Mission:DecreaseCounterByUserId",
"Gs2Money:WithdrawByUserId",
"Gs2Money:RecordReceipt",
"Gs2Money2:WithdrawByUserId",
"Gs2Money2:VerifyReceiptByUserId",
"Gs2Quest:DeleteProgressByUserId",
"Gs2Ranking2:CreateGlobalRankingReceivedRewardByUserId",
"Gs2Ranking2:CreateClusterRankingReceivedRewardByUserId",
"Gs2Schedule:DeleteTriggerByUserId",
"Gs2SerialKey:UseByUserId",
"Gs2Showcase:IncrementPurchaseCountByUserId",
"Gs2SkillTree:MarkRestrainByUserId",
"Gs2Stamina:DecreaseMaxValueByUserId",
"Gs2Stamina:ConsumeStaminaByUserId",
}
~ 128 charsTypes of actions to be performed in the consume action
requeststring~ 1048576 charsJSON of request

EzVerifyAction

Verify Action

TypeRequireDefaultLimitationDescription
actionenum {
"Gs2Dictionary:VerifyEntryByUserId",
"Gs2Distributor:IfExpressionByUserId",
"Gs2Distributor:AndExpressionByUserId",
"Gs2Distributor:OrExpressionByUserId",
"Gs2Enchant:VerifyRarityParameterStatusByUserId",
"Gs2Experience:VerifyRankByUserId",
"Gs2Experience:VerifyRankCapByUserId",
"Gs2Grade:VerifyGradeByUserId",
"Gs2Grade:VerifyGradeUpMaterialByUserId",
"Gs2Guild:VerifyCurrentMaximumMemberCountByGuildName",
"Gs2Guild:VerifyIncludeMemberByUserId",
"Gs2Inventory:VerifyInventoryCurrentMaxCapacityByUserId",
"Gs2Inventory:VerifyItemSetByUserId",
"Gs2Inventory:VerifyReferenceOfByUserId",
"Gs2Inventory:VerifySimpleItemByUserId",
"Gs2Inventory:VerifyBigItemByUserId",
"Gs2Limit:VerifyCounterByUserId",
"Gs2Matchmaking:VerifyIncludeParticipantByUserId",
"Gs2Mission:VerifyCompleteByUserId",
"Gs2Mission:VerifyCounterValueByUserId",
"Gs2Ranking2:VerifyGlobalRankingScoreByUserId",
"Gs2Ranking2:VerifyClusterRankingScoreByUserId",
"Gs2Ranking2:VerifySubscribeRankingScoreByUserId",
"Gs2Schedule:VerifyTriggerByUserId",
"Gs2Schedule:VerifyEventByUserId",
"Gs2SerialKey:VerifyCodeByUserId",
}
~ 128 charsTypes of actions to be performed in the verify task
requeststring~ 1048576 charsJSON 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.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsCounter Name
valuesList<EzScopedValue>~ 32 itemsValue

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.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsCounter Name
metadatastring~ 1024 charsmetadata
scopesList<EzCounterScopeModel>[]1 ~ 20 itemsList of Counter reset timing
challengePeriodEventIdstring~ 1024 charsGS2-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.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsMission Group Name
metadatastring~ 1024 charsmetadata
tasksList<EzMissionTaskModel>~ 1000 itemsList of Mission Task
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
“notReset”~ 128 charsReset timing
resetDayOfMonthint{resetType} == “monthly”1 ~ 31Date to reset (If the value exceeds the days of the month, it is treated as the last day.)
resetDayOfWeekenum {
    “sunday”,
    “monday”,
    “tuesday”,
    “wednesday”,
    “thursday”,
    “friday”,
    “saturday”
}
{resetType} == “weekly”~ 128 charsDay of the week to reset
resetHourint{resetType} in [“monthly”, “weekly”, “daily”]~ 23Hour of Reset
completeNotificationNamespaceIdstring~ 1024 charsNamespace GRN

Enumeration type definition to specify as resetType

Enumerator String DefinitionDescription
notResetNot resetting.
dailyDaily
weeklyWeekly
monthlyMonthly

Enumeration type definition to specify as resetDayOfWeek

Enumerator String DefinitionDescription
sundaySunday
mondayMonday
tuesdayTuesday
wednesdayWednesday
thursdayThuesday
fridayFriday
saturdaySaturday

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.

TypeRequireDefaultLimitationDescription
namestring~ 128 charsTask Name
metadatastring~ 1024 charsmetadata
verifyCompleteTypeenum {
    “counter”,
    “verifyActions”
}
“counter”~ 128 charsCompletion criteria type
targetCounterEzTargetCounterModel{verifyCompleteType} == “counter”Target Counter
verifyCompleteConsumeActionsList<EzVerifyAction>{verifyCompleteType} == “consumeActions”~ 10 itemsVerify actions when task is accomplished
completeAcquireActionsList<EzAcquireAction>[]~ 100 itemsRewards for mission accomplishment
challengePeriodEventIdstring~ 1024 charsGS2-Schedule event GRN with a set period of time during which rewards can be received
premiseMissionTaskNamestring~ 128 charsName of the tasks accomplish to attempt this task

Enumeration type definition to specify as verifyCompleteType

Enumerator String DefinitionDescription
counterCounter
verifyActionsVerify Actions

EzTargetCounterModel

Target Counter

Information about the counter that serves as the achievement goal for the mission

TypeRequireDefaultLimitationDescription
counterNamestring~ 128 charsCounter Name
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
{scopeType} == “resetTiming”~ 128 charsTarget Reset timing
valuelong1 ~ 9223372036854775805Target value

Enumeration type definition to specify as resetType

Enumerator String DefinitionDescription
notResetNot resetting.
dailyDaily
weeklyWeekly
monthlyMonthly

EzScopedValue

Reset timing

TypeRequireDefaultLimitationDescription
resetTypeenum {
    “notReset”,
    “daily”,
    “weekly”,
    “monthly”
}
{scopeType} == “resetTiming”~ 128 charsReset timing
valuelong0~ 9223372036854775805Count value

Enumeration type definition to specify as resetType

Enumerator String DefinitionDescription
notResetNot resetting.
dailyDaily
weeklyWeekly
monthlyMonthly

Methods

batchReceiveRewards

Receive rewards for mission accomplishment in bulk

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamesList<string>1 ~ 100 itemsTask name list
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
transactionIdstringIssed transaction ID
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetboolIs 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

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
itemEzCompletestatus 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);

listCompletes

Get list of accomplished missions

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<EzComplete>List of status of achievement
nextPageTokenstringPage 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);

receiveRewards

Obtain rewards for mission accomplishment

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamestring~ 128 charsTask Name
accessTokenstring~ 128 charsUser Id

Result

TypeDescription
transactionIdstringIssed transaction ID
stampSheetstringStamp sheet to receive rewards for mission accomplishment
stampSheetEncryptionKeyIdstringCryptographic key GRN used for stamp sheet signature calculations
autoRunStampSheetboolIs 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

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
counterNamestring~ 128 charsCounter Name

Result

TypeDescription
itemEzCounterCounter

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);

listCounters

Get list of accomplished missions

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
accessTokenstring~ 128 charsUser Id
pageTokenstring~ 1024 charsToken specifying the position from which to start acquiring data
limitint301 ~ 1000Number of data acquired

Result

TypeDescription
itemsList<EzCounter>List of Counter
nextPageTokenstringPage 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);

getCounterModel

Get Counter Model

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
counterNamestring~ 128 charsCounter Name

Result

TypeDescription
itemEzCounterModelCounter 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);

listCounterModels

Get list of counter models

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemsList<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);

getMissionGroupModel

Get mission group model by specifying mission group name

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name

Result

TypeDescription
itemEzMissionGroupModelMission 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);

listMissionGroupModels

Get list of mission group models

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name

Result

TypeDescription
itemsList<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);

getMissionTaskModel

Obtain a mission task model by specifying the mission task name

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name
missionTaskNamestring~ 128 charsTask Name

Result

TypeDescription
itemEzMissionTaskModelMission 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);

listMissionTaskModels

Get list of mission task models

Request

TypeRequireDefaultLimitationDescription
namespaceNamestring~ 128 charsNamespace name
missionGroupNamestring~ 128 charsMission Group Name

Result

TypeDescription
itemsList<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);

Event Handler

OnCompleteNotification

Notification used when mission tasks are accomplished

NameTypeDescription
namespaceNamestringNamespace name
groupNamestringMission Group Name
userIdstringUser Id
taskNamestringMission 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;
    });