CloudBuilder  2.8.4
Making social games is easy !
Functions
Profile related tasks

Functions

void CloudBuilder::CUserManager::UserExist (const char *aIdent, const char *aNetwork, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::MailPassword (const CotCHelpers::CHJSON *aJSON, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::ChangePassword (const char *aNewPassword, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::ChangeEmail (const char *aNewEmail, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::SetProfile (const CotCHelpers::CHJSON *aJson, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::GetProfile (CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::SetProperties (CResultHandler *aHandler, const CotCHelpers::CHJSON *aPropertiesList, const char *aDomain="private")
 
DEPRECATED void CloudBuilder::CUserManager::SetProperties (const CotCHelpers::CHJSON *aPropertiesList, CResultHandler *aHandler)
 
void CloudBuilder::CUserManager::GetProperties (CResultHandler *aHandler, const char *aDomain="private")
 
void CloudBuilder::CUserManager::SetProperty (CResultHandler *aHandler, const CotCHelpers::CHJSON *aProperty, const char *aDomain="private")
 
void CloudBuilder::CUserManager::GetProperty (CResultHandler *aHandler, const char *aField, const char *aDomain="private")
 
void CloudBuilder::CUserManager::DeleteProperty (CResultHandler *aHandler, const char *aField, const char *aDomain="private")
 

Detailed Description

Function Documentation

void CloudBuilder::CUserManager::ChangeEmail ( const char *  aNewEmail,
CResultHandler aHandler 
)

Once logged, the user registered with 'email' network can change his/her email.

Parameters
aNewEmailthe new email
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : { "done" : 1 }
void CloudBuilder::CUserManager::ChangePassword ( const char *  aNewPassword,
CResultHandler aHandler 
)

Once logged, the user registered with 'email' network can change his/her paswword.

Parameters
aNewPasswordthe new password
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : { "done" : 1 }
void CloudBuilder::CUserManager::DeleteProperty ( CResultHandler aHandler,
const char *  aField,
const char *  aDomain = "private" 
)

Method to delete a single property of the global JSON object stored for this user and domain.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aFieldthe key to delete
aDomainis the domain in which this property has to be deleted. "private" means it is valid only for this game.
Returns
if noErr and no binary key was passed in the configuration, the json passed to the handler may contain: { "done": 1 }
void CloudBuilder::CUserManager::GetProfile ( CResultHandler aHandler)

Method used to retrieve some optional data of the logged in profile previously set by method SetProfile.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : { "displayname" : "xxx", "email" : "xxx', "lang" : "en" }
void CloudBuilder::CUserManager::GetProperties ( CResultHandler aHandler,
const char *  aDomain = "private" 
)

Method to get the list of previously saved properties used to find opponents for a match.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aDomainis the domain in which the properties have to be loaded. "private" means they are valid only for this game.
Returns
if noErr, the json passed to the handler may contain : "properties" : { "level" : 10, "board" : "square", }
void CloudBuilder::CUserManager::GetProperty ( CResultHandler aHandler,
const char *  aField,
const char *  aDomain = "private" 
)

Method to get the list of previously saved properties used to find opponents for a match.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aFieldthe key to retreive
aDomainis the domain in which this property has to be loaded. "private" means it is valid only for this game.
Returns
if noErr, the json passed to the handler may contain : "properties" : { "level" : 10, }
void CloudBuilder::CUserManager::MailPassword ( const CotCHelpers::CHJSON aJSON,
CResultHandler aHandler 
)

Method used to send an mail to a user registered with 'email' network and who lost his/her paswword.

Parameters
aJSONis a JSON object holding:
  • email : the user email
  • from : an email address to set the sender
  • title : the title of the mail to be sent
  • body : the body (text) of the email to be sent, the body should consain the tag [[SHORTCODE]] which will be replaced by the actual generated short code.
aHandlerresult handler whenever the call finishes (it might also be synchronous) When the user receives the email, it will contain a short code. This short code needs to be used in the loginNetwork method with the network set to "restore" , the id to "" (empty) and the secret to the actual short code.
void CloudBuilder::CUserManager::SetProfile ( const CotCHelpers::CHJSON aJson,
CResultHandler aHandler 
)

Method used to associate some optional data to the logged in profile in a JSON dictionary. You can fill fields with key "email", "displayName", "lang", "firstName", "lastName", "addr1", "addr2", "addr3" and "avatar". Other fields will be ignored. These fields must be strings, and some are pre-populated when the account is created, using the available info from the social network used to create the account.

Parameters
aJsonis a JSON object holding the data to save for this user. The object can hold the whole profile or just a subset of the keys.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "done" : 1
void CloudBuilder::CUserManager::SetProperties ( CResultHandler aHandler,
const CotCHelpers::CHJSON aPropertiesList,
const char *  aDomain = "private" 
)

Method to save a list of properties that will be used to find opponents. You can optionnally use it to save other informations which do not need to be used for your match making needs though.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aPropertiesListis a JSON containing only basic types (bool, string, number. To save a date, use the UTC date in JSON string format (2013-05-17T10:43:59.599Z). i.e. { "level" : 10, "board" : "square" }
aDomainis the domain in which the properties have to be saved. "private" means they are valid only for this game.
Returns
if noErr, the json passed to the handler may contain : "properties" : { "level" : 10, "board" : "square", }
void CloudBuilder::CUserManager::SetProperty ( CResultHandler aHandler,
const CotCHelpers::CHJSON aProperty,
const char *  aDomain = "private" 
)

Method to save one property that will be used to find opponents. You can optionnally use it to save other informations which do not need to be used for your match making needs though.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aPropertyis a JSON containing a key and a value only basic types (bool, string, number. To save a date, use the UTC date in JSON string format (2013-05-17T10:43:59.599Z). i.e. { "key" : "level", "value" : 10 }
aDomainis the domain in which this property has to be saved. "private" means it is valid only for this game.
Returns
if noErr, the json passed to the handler may contain : "properties" : { "level" : 10, }
void CloudBuilder::CUserManager::UserExist ( const char *  aIdent,
const char *  aNetwork,
CResultHandler aHandler 
)

Method used to check if a user is registered with a network.

Parameters
aIdentis the ID within the specified social network.
aNetworkthe social network to look into.
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "gamer_id" : <aident>