![]() |
CloudBuilder C++ SDK
v3.0.0
Making social games is easy !
|
#include <CUserManager.h>
Public Member Functions | |
| void | LoginAnonymous (const CotCHelpers::CHJSON *aOptions, CResultHandler *aHandler) |
| void | LoginNetwork (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | ResumeSession (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | LoginWithShortCode (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | Logout (CResultHandler *aHandler) |
| void | Link (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | Unlink (const char *aNetwork, CResultHandler *aHandler) |
| void | Convert (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | UserExist (const char *aIdent, const char *aNetwork, CResultHandler *aHandler) |
| void | MailPassword (const CotCHelpers::CHJSON *aJSON, CResultHandler *aHandler) |
| void | ChangePassword (const char *aNewPassword, CResultHandler *aHandler) |
| void | ChangeEmail (const char *aNewEmail, CResultHandler *aHandler) |
| void | SetProfile (const CotCHelpers::CHJSON *aJson, CResultHandler *aHandler) |
| void | GetProfile (CResultHandler *aHandler) |
| void | SetProperties (const CotCHelpers::CHJSON *aPropertiesList, const char *aDomain, CResultHandler *aHandler) |
| void | GetProperties (const char *aDomain, CResultHandler *aHandler) |
| void | SetProperty (const CotCHelpers::CHJSON *aProperty, const char *aDomain, CResultHandler *aHandler) |
| void | GetProperty (const char *aField, const char *aDomain, CResultHandler *aHandler) |
| void | DeleteProperty (const char *aField, const char *aDomain, CResultHandler *aHandler) |
| void | Balance (const char *aDomain, CResultHandler *aHandler) |
| void | TxHistory (const char *aDomain, const CotCHelpers::CHJSON *aJSONOptions, CResultHandler *aHandler) |
| void | GetValue (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | SetValue (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | DeleteValue (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | GetBinary (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | SetBinary (const CotCHelpers::CHJSON *aConfiguration, const void *aPointer, size_t aSize, CResultHandler *aHandler) |
| void | DeleteBinary (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | RegisterEventListener (const char *aDomain, CEventListener *aListener) |
| void | UnregisterEventListener (const char *aDomain, CEventListener *aListener) |
| void | PushEvent (const char *aDomain, const char *aGamerID, const CotCHelpers::CHJSON *aEvent, const CotCHelpers::CHJSON *aNotification, CResultHandler *aHandler) |
| const char * | GetDisplayName () |
| const char * | GetGamerID () |
| const char * | GetMail () |
| void | GetGodfatherCode (const char *aDomain, CResultHandler *aHandler) |
| void | GetGodfather (const char *aDomain, CResultHandler *aHandler) |
| void | SetGodfather (const char *aCode, const CotCHelpers::CHJSON *aOptions, CResultHandler *aHandler) |
| void | GetGodchildren (const char *aDomain, CResultHandler *aHandler) |
| void | Outline (CResultHandler *aHandler) |
| void | RegisterForNotification () |
| void | ListAchievements (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | EarnAchievement (const char *aUnit, int aIncrement=1, const CotCHelpers::CHJSON *aGamerData=NULL, CResultHandler *aHandler=NULL) |
| void | TransactionExtended (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | SetAchievementData (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| void | Batch (const CotCHelpers::CHJSON *aConfiguration, const CotCHelpers::CHJSON *aParameters, CResultHandler *aHandler) |
| DEPRECATED void | LoginAnonymous (CResultHandler *aHandler) |
| DEPRECATED void | Link (CResultHandler *aHandler, const CotCHelpers::CHJSON *aConfiguration) |
| DEPRECATED void | Link (const char *aNetwork, CResultHandler *aHandler) |
| DEPRECATED void | Convert (CResultHandler *aHandler, const CotCHelpers::CHJSON *aConfiguration) |
| DEPRECATED void | SetProperties (CResultHandler *aHandler, const CotCHelpers::CHJSON *aPropertiesList, const char *aDomain="private") |
| DEPRECATED void | GetProperties (CResultHandler *aHandler, const char *aDomain="private") |
| DEPRECATED void | SetProperty (CResultHandler *aHandler, const CotCHelpers::CHJSON *aProperty, const char *aDomain="private") |
| DEPRECATED void | GetProperty (CResultHandler *aHandler, const char *aField, const char *aDomain="private") |
| DEPRECATED void | DeleteProperty (CResultHandler *aHandler, const char *aField, const char *aDomain="private") |
| DEPRECATED void | Publish (const char *aNetwork, const CotCHelpers::CHJSON *aMessage, CResultHandler *aHandler) |
| DEPRECATED void | GetGodfatherCode (CResultHandler *aHandler, const char *aDomain="private") |
| DEPRECATED void | GetGodfather (CResultHandler *aHandler, const char *aDomain="private") |
| DEPRECATED void | GetGodchildren (CResultHandler *aHandler, const char *aDomain="private") |
| DEPRECATED void | KeyValueRead (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| DEPRECATED void | KeyValueWrite (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| DEPRECATED void | KeyValueDelete (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| DEPRECATED void | BinaryRead (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| DEPRECATED void | BinaryWrite (const CotCHelpers::CHJSON *aConfiguration, const void *aPointer, size_t aSize, CResultHandler *aHandler) |
| DEPRECATED void | BinaryDelete (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
| DEPRECATED void | Batch (CResultHandler *aHandler, const CotCHelpers::CHJSON *aConfiguration, const CotCHelpers::CHJSON *aParameters) |
Static Public Member Functions | |
| static CUserManager * | Instance () |
Friends | |
| class | CClan |
| struct | singleton_holder< CUserManager > |
| void | publishUserAfterPermission (int err, void *params) |
| void | AchieveRegisterDevice (unsigned long len, const void *bytes) |
| FACTORY_FCT void | CUserManager_ResetAchievements (const char *domain, CResultHandler *handler) |
The CloudBuilder::CUserManager is the second class you will use once you are connected with CloudBuilder::CClan::Setup method. This class manages a user profile. The class is a singleton and is not designed to be overridden. In version 2, we use the concept of delegates to get the results, in the same way it was designed in the C# wrapper.
| void CloudBuilder::CUserManager::Batch | ( | const CotCHelpers::CHJSON * | aConfiguration, |
| const CotCHelpers::CHJSON * | aParameters, | ||
| CResultHandler * | aHandler | ||
| ) |
Run a user authenticated batch on the server side. Batch is edited on BackOffice server.
| aConfiguration | JSON data describing the dat to pass to the batch
|
| aParameters | JSON data describing the data to pass to the batch
|
| aHandler | the handler called with the result when the call completes |
| void CloudBuilder::CUserManager::EarnAchievement | ( | const char * | aUnit, |
| int | aIncrement = 1, |
||
| const CotCHelpers::CHJSON * | aGamerData = NULL, |
||
| CResultHandler * | aHandler = NULL |
||
| ) |
Helper method that allows easily to post a success. For this to work, you need to have an achievement that uses the same unit as the name of the achievement.
| aUnit | the name of the achievement, and unit to increment |
| aIncrement | by how much to increment the unit; you may as well decrement it by passing a negative value |
| aGamerData | gamer data to store for the gamer/achievement, merged with the current data (that is, existing keys are not affected) |
| aHandler | handler called with the result of a call to CUserManager::Transaction |
| const char* CloudBuilder::CUserManager::GetDisplayName | ( | ) |
Method used to retrieve the displayName given by the user at creation time or by a call to SetProfile.
| const char* CloudBuilder::CUserManager::GetGamerID | ( | ) |
Method used to retrieve the GamerID.
| void CloudBuilder::CUserManager::GetGodchildren | ( | const char * | aDomain, |
| CResultHandler * | aHandler | ||
| ) |
Method used to retrieve all the godchildren for the currently logged in user.
| aDomain | is the domain in which the godfather link should be established. "private" means it's local to this game only. |
| aHandler | result handler whenever the call finishes (it might also be synchronous) |
| void CloudBuilder::CUserManager::GetGodfather | ( | const char * | aDomain, |
| CResultHandler * | aHandler | ||
| ) |
Method used to retrieve the godfather of the currently logged in user.
| aDomain | is the domain in which the godfather link should be established. "private" means it's local to this game only. |
| aHandler | result handler whenever the call finishes (it might also be synchronous) |
| void CloudBuilder::CUserManager::GetGodfatherCode | ( | const char * | aDomain, |
| CResultHandler * | aHandler | ||
| ) |
Method to call in order to generate a temporary code that can be used to obtain a new godchild.
| aDomain | is the domain in which the godfather link should be established. "private" means it's local to this game only. |
| aHandler | result handler whenever the call finishes (it might also be synchronous) |
| const char* CloudBuilder::CUserManager::GetMail | ( | ) |
Method used to retrieve the email address given by the user at creation time or by a call to SetProfile .
|
static |
Use this method to obtain a reference to the CUserManager.
| void CloudBuilder::CUserManager::ListAchievements | ( | const CotCHelpers::CHJSON * | aConfiguration, |
| CResultHandler * | aHandler | ||
| ) |
Fetches information about the status of the achievements configured for this game. Additional configuration can be provided in the form of JSON data.
| aConfiguration | JSON data
|
| aHandler | result handler, which will receiving the following data: |
| void CloudBuilder::CUserManager::Outline | ( | CResultHandler * | aHandler | ) |
Method used to retrieve global user information, including profile, friends, devices, ... It's the same JSON as the one received upon the Login/ResumeSession process.
| aHandler | result handler whenever the call finishes (it might also be synchronous) |
| void CloudBuilder::CUserManager::RegisterForNotification | ( | ) |
Method used to signal that the currently logged in user is ready to receive push notifications. Usually, this is called internally by CotC at login time, unless CClan::Setup has been called with an option to delay the registration.
| void CloudBuilder::CUserManager::SetAchievementData | ( | const CotCHelpers::CHJSON * | aConfiguration, |
| CResultHandler * | aHandler | ||
| ) |
Allows to store arbitrary data for a given achievement and the current player (appears in the 'gamerData' node of achievements).
| aConfiguration | JSON data describing the operation to perform
|
| aHandler | the handler called with the result when the call completes |
| void CloudBuilder::CUserManager::SetGodfather | ( | const char * | aCode, |
| const CotCHelpers::CHJSON * | aOptions, | ||
| CResultHandler * | aHandler | ||
| ) |
Method to call to attribute a godfather to the currently logged in user.
| aCode | is a string as generated by Cloudbuilder::CUserManager::GetGodfatherCode. |
| aOptions | is a JSON object containing optionnal information. The JSON object may contains the following keys: 'maturity' : integer, age in number of days of the godchildren. (since the register date), if maturity is 0 or missing, no checks are made. 'domain' : "private" or the wanted domain 'reward' : a transaction Json rewarding the godfather formed as { transaction : { "unit" : amount}, description : "reward transaction", domain : "com.clanoftcloud.text.DOMAIN" } where desciption and domain are optionnals 'osn' : {"en" : "You've been rewarded"} if you want an OS notification for the godfather app NB : the godfather will reveive an event of type 'godchildren' containing the id of the godchildren and the balace/achievements field if rewarded |
| aHandler | result handler whenever the call finishes (it might also be synchronous) |
"done" : "1", }
| void CloudBuilder::CUserManager::TransactionExtended | ( | const CotCHelpers::CHJSON * | aConfiguration, |
| CResultHandler * | aHandler | ||
| ) |
Method to send a transaction for this user.
| aConfiguration | the JSON describing the configuration, which may include:
|
| aHandler | the handler called with the result when the call completes |
1.8.15