CloudBuilder C++ SDK  v3.0.0
Making social games is easy !
Public Member Functions | Static Public Member Functions | Friends | List of all members
CloudBuilder::CGameManager Class Reference

#include <CGameManager.h>

Public Member Functions

void Score (long long aHighScore, const char *aMode, const char *aScoreType, const char *aInfoScore, bool aForce, const char *aDomain, CResultHandler *aHandler)
 
void GetRank (long long aHighScore, const char *aMode, const char *aDomain, CResultHandler *aHandler)
 
void BestHighScore (int aCount, int aPage, const char *aMode, const char *aDomain, CResultHandler *aHandler)
 
void CenteredScore (int aCount, const char *aMode, const char *aDomain, CResultHandler *aHandler)
 
void UserBestScores (const char *aDomain, CResultHandler *aHandler)
 
void GetValue (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void GetBinary (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void Batch (CResultHandler *aHandler, const CotCHelpers::CHJSON *aConfiguration, const CotCHelpers::CHJSON *aParameters)
 
DEPRECATED void Score (CResultHandler *aHandler, long long aHighScore, const char *aMode, const char *aScoreType, const char *aInfoScore, bool aForce, const char *aDomain="private")
 
DEPRECATED void GetRank (CResultHandler *aHandler, long long aHighScore, const char *aMode, const char *aDomain="private")
 
DEPRECATED void BestHighScore (CResultHandler *aHandler, int aCount, int aPage, const char *aMode, const char *aDomain="private")
 
DEPRECATED void CenteredScore (CResultHandler *aHandler, int aCount, const char *aMode, const char *aDomain="private")
 
DEPRECATED void UserBestScores (CResultHandler *aHandler, const char *aDomain="private")
 
DEPRECATED void BinaryRead (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
DEPRECATED void KeyValueRead (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 

Static Public Member Functions

static CGameManagerInstance ()
 

Friends

class CClan
 
struct singleton_holder< CGameManager >
 

Detailed Description

The CGameManager class is helpful when you want to store global data for your application. These data will be accessible to all users who have installed and are using this application. It can be useful for introducing new levels, new assets, or anything that you wish to add to the application in future updates. It also provides helper methods to store and retrieve high scores.

Member Function Documentation

◆ Batch()

void CloudBuilder::CGameManager::Batch ( CResultHandler aHandler,
const CotCHelpers::CHJSON aConfiguration,
const CotCHelpers::CHJSON aParameters 
)

Run a batch on the server side. Batch is edited on BackOffice server.

Parameters
aConfigurationJSON data describing the dat to pass to the batch
  • domain: the domain on which the action is to be taken (if not passed, the private domain is used)
  • name: the name identifying the batch
aParametersJSON data describing the data to pass to the batch
  • input: user defined data
aHandlerthe handler called with the result when the call completes
Returns
if noErr, the json passed to the handler will contain the result of the executed batch

◆ BestHighScore()

void CloudBuilder::CGameManager::BestHighScore ( int  aCount,
int  aPage,
const char *  aMode,
const char *  aDomain,
CResultHandler aHandler 
)

Method used to retrieve the best High Scores for this application.

Parameters
aCountis the number of best scores you want to retrieve, default is 10
aPageis the number of the page to retrieve. the default is 1
aModeis a C string holding the game mode for which you want to retrieve the best High Scores.
aDomainis the domain in which the best scores have to be retrieved. "private" means it's local to this game only.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: { <aMode>: { "maxpage" : 10, "rankOfFirst" : 1, "page" : 1, "scores" : [] }

◆ CenteredScore()

void CloudBuilder::CGameManager::CenteredScore ( int  aCount,
const char *  aMode,
const char *  aDomain,
CResultHandler aHandler 
)

Method used to retrieve scores centered on the user score for this application.

Parameters
aCountis the number of best scores you want to retrieve, default is 10
aModeis a C string holding the game mode for which you want to retrieve the best High Scores.
aDomainis the domain in which the best scores have to be retrieved. "private" means it's local to this game only.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: { <aMode>: { "maxpage" : 10, "rankOfFirst" : 1, "page" : 1, "scores" : [] }

◆ GetBinary()

void CloudBuilder::CGameManager::GetBinary ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method to read a single key containing binary data stored for this domain.

Parameters
aConfigurationJSON allowing for extensible configuration, that may contain:
  • domain: the domain on which the action is to be taken (if not passed, the private domain is used)
  • key: name of the key to retrieve
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: { "url" : "<signed URL>", } CCloudResult.HasBinary() must be true and you can acces to the data through :

◆ GetRank()

void CloudBuilder::CGameManager::GetRank ( long long  aHighScore,
const char *  aMode,
const char *  aDomain,
CResultHandler aHandler 
)

Method used to retrieve the rank of a High Score for this application.

Parameters
aHighScoreis the score whose rank you want to retrieve.
aModeis a C string holding the game mode for which you want to retrieve rank for this score.
aDomainis the domain in which the rank has to be retrieved. "private" means it's local to this game only.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "rank" : 1

◆ GetValue()

void CloudBuilder::CGameManager::GetValue ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method to get a single key of the global JSON object stored for this game and domain.

Parameters
aConfigurationis a JSON configuration, that may contain
  • domain: the domain on which the action is to be taken (if not passed, the private domain is used)
  • key: name of the key to retrieve from the global JSON object (if not passed, all keys are returned)
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr and no binary key was passed in the configuration, the json passed to the handler may contain: { "<key1>" : "value1", "<key2>" : "value2", ... }

◆ Instance()

static CGameManager* CloudBuilder::CGameManager::Instance ( )
static

Use this method to obtain a reference to the CGameManager.

Returns
the one and only instance of this manager

◆ Score()

void CloudBuilder::CGameManager::Score ( long long  aHighScore,
const char *  aMode,
const char *  aScoreType,
const char *  aInfoScore,
bool  aForce,
const char *  aDomain,
CResultHandler aHandler 
)

Method used to post a High Score for this application.

Parameters
aHighScoreis the score you want to post.
aModeis a C string holding the game mode for which this score should be considered.
aScoreTypestring with "hightolow" or "lowtohigh"
aInfoScoreis an optional string wich describe the score
aForceis an optional boolean used in case we authorize the new high score to be inferior to the previous one.
aDomainis the domain in which the score has to be pushed. "private" means it's local to this game only.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain:
"done" : 1,
"rank" : 123
done means that the score has been recorded as the highest, while rank is the effective rank of the player (returned even if the player has not actually been classed, that is if done is 0).

◆ UserBestScores()

void CloudBuilder::CGameManager::UserBestScores ( const char *  aDomain,
CResultHandler aHandler 
)

Method used to retrieve the best Scores of the logged user.

Parameters
aDomainis the domain in which the best scores have to be retrieved. "private" means it's local to this game only.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain list of : <modes>: { "timestamp": "2014-09-12T15:30:56.938Z", "score": 100, "info": "some text", "order": "lowtohigh", "rank": 3 }

The documentation for this class was generated from the following file: