Progression #

Read more about the Progression system in Hiro here.

Get all progressions #

Get progressions.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
void onProgressionsGet(const Hiro::ProgressionList& progressionList)
{
    for (auto it = progressionList.progressions.begin(); it != progressionList.progressions.end(); it++)
    {
        std::cout << "Found progression: " << it->second.name << '\n';
    }
}

void onError(const Nakama::NError& error)
{
    std::cout << Nakama::toString(error.code) << ": " << error.message << '\n';
}

Hiro::ProgressionGetRequest request;

hiroClient->progressionsGet(session, request, onProgressionsGet, onError);

Purchase progression #

Purchase a progression for permanent unlock, if supported.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
void onProgressionsPurchase(const Hiro::ProgressionList& progressionList)
{
    for (auto it = progressionList.progressions.begin(); it != progressionList.progressions.end(); it++)
    {
        std::cout << "Found progression: " << it->second.name << '\n';
    }
}

void onError(const Nakama::NError& error)
{
    std::cout << Nakama::toString(error.code) << ": " << error.message << '\n';
}

Hiro::ProgressionPurchaseRequest request;
request.id = "progression_1";

hiroClient->progressionsPurchase(session, request, onProgressionsPurchase, onError);