CloudBuilder C++ SDK  v3.0.0
Making social games is easy !
Functions
Login related tasks

Functions

void CloudBuilder::CUserManager::LoginAnonymous (const CotCHelpers::CHJSON *aOptions, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::LoginNetwork (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::ResumeSession (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::LoginWithShortCode (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Logout (CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Link (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Unlink (const char *aNetwork, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::Convert (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler)
 

Detailed Description

Function Documentation

◆ Convert()

void CloudBuilder::CUserManager::Convert ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Can convert the current account to a Facebook, Googleplus, GameCenter or e-mail account. To be done only when being logged in with an anonymous account.

Parameters
aConfigurationis a JSON object holding the necessary details. The mandatory keys are:
  • "network": string containing the network: "facebook", "googleplus", "gamecenter" or "email".
  • "id": in case the network is "email", contains the e-mail to be used.
  • "secret": in case the network is "email", contains the password to be used.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "done" : 1

◆ Link()

void CloudBuilder::CUserManager::Link ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method used to Link an account with Facebook, Googleplus, GameCenter.

Parameters
aConfigurationis a JSON object holding the necessary connection details The mandatory keys are:
  • "network" : facebookId, googleplusId, gamecenterId, gamecenter (no IDs to be supplied, logs in locally).
  • "id" : string containing the ID of the user. (respectivly facebook user ID, googleplus ID, gamecenter ID)
  • "secret" : string containing the secret associated with the user ID. (respectivly accesstoken, token, n/s)
  • "options" : used with network="gamecenter" to provide additional options for login (see LoginNetwork).
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "done" : 1

◆ LoginAnonymous()

void CloudBuilder::CUserManager::LoginAnonymous ( const CotCHelpers::CHJSON aOptions,
CResultHandler aHandler 
)

Method used to login using no identifer. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aOptionsis a JSON object holding optional data, see CloudBuilder::CUserManager::LoginNetwork for more about possible options. Can be NULL if no options are to be passed.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}

◆ LoginNetwork()

void CloudBuilder::CUserManager::LoginNetwork ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method used to log in with a with an account of a social network. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aConfigurationis a JSON object holding the necessary connection details. The mandatory keys are:
  • "network" : facebookId, googleplusId, gamecenter, email (facebook and goggleplus are deprecated)
  • "id" : string containing the ID of the user. (respectively facebook ID, googleplus ID, gamecenter ID, email)
  • "secret" : string containing the secret associated with the user ID. (respectivly accesstoken, token, n/s, password) optionally pass an 'options' key which may contain:
  • 'preventRegistration' : doesn't create a new account if not already existing. In this it can raise an error named 'PreventRegistration'.
  • 'thenBatch' : value should contain { "thenBatch" : { "domain" : "yourDomain" , "name" : "batchToCall" , "params" : { your JSON parameters } } }
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}

◆ LoginWithShortCode()

void CloudBuilder::CUserManager::LoginWithShortCode ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method used to log in using a generated short code. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aConfigurationis a JSON object holding the necessary connection details. The mandatory keys are:
  • "shortcode" : string containing the generated short code. optionally pass an 'options' key which may contain:
  • 'thenBatch' : value should contain { "thenBatch" : { "domain" : "yourDomain" , "name" : "batchToCall" , "params" : { your JSON parameters } } }
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}

◆ Logout()

void CloudBuilder::CUserManager::Logout ( CResultHandler aHandler)

Method used to log out a previously logged in profile. After calling this, you need to log again using any of LoginAnonymous, LoginNetwork or Login before being able to call other methods.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "done" : 1

◆ ResumeSession()

void CloudBuilder::CUserManager::ResumeSession ( const CotCHelpers::CHJSON aConfiguration,
CResultHandler aHandler 
)

Method used to log in with a profile previously stored as the result of a LoginAnonymous or LoginNetwork. This method will fail (enOperationAlreayInProgress) if any other login related operation is already launched.

Parameters
aConfigurationis a JSON object holding the necessary connection details. The mandatory keys are:
  • "id" : string containing the ID of the user.
  • "secret" : string containing the secret associated with the user ID. optionally pass an 'options' key which may contain:
    • 'thenBatch' : value should contain { "thenBatch" : { "domain" : "yourDomain" , "name" : "batchToCall" , "params" : { your JSON parameters } } }
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "gamer_id" : "xxxxx", "gamer_secret" : "xxxxxx" "profile" : {}

◆ Unlink()

void CloudBuilder::CUserManager::Unlink ( const char *  aNetwork,
CResultHandler aHandler 
)

Method used to Unlink an account with Facebook, Googleplus, GameCenter.

Parameters
aNetworkis a string containing the network : "facebook", "googleplus", "gamecenter"
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain: "done" : 1