![]() |
CloudBuilder
2.8.4
Making social games is easy !
|
#include <CUserManager.h>
Public Member Functions | |
void | LoginAnonymous (CResultHandler *aHandler) |
void | LoginNetwork (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | ResumeSession (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | Logout (CResultHandler *aHandler) |
void | Link (const char *aNetwork, CResultHandler *aHandler) |
void | Unlink (const char *aNetwork, CResultHandler *aHandler) |
void | Convert (const char *aNetwork, 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 (CResultHandler *aHandler, const CotCHelpers::CHJSON *aPropertiesList, const char *aDomain="private") |
DEPRECATED void | SetProperties (const CotCHelpers::CHJSON *aPropertiesList, CResultHandler *aHandler) |
void | GetProperties (CResultHandler *aHandler, const char *aDomain="private") |
void | SetProperty (CResultHandler *aHandler, const CotCHelpers::CHJSON *aProperty, const char *aDomain="private") |
void | GetProperty (CResultHandler *aHandler, const char *aField, const char *aDomain="private") |
void | DeleteProperty (CResultHandler *aHandler, const char *aField, const char *aDomain="private") |
void | Balance (const char *aDomain, CResultHandler *aHandler) |
DEPRECATED void | Transaction (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | TxHistory (const char *aDomain, const CotCHelpers::CHJSON *aJSONOptions, CResultHandler *aHandler) |
void | KeyValueRead (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | KeyValueWrite (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | KeyValueDelete (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | BinaryRead (const CotCHelpers::CHJSON *aConfiguration, CResultHandler *aHandler) |
void | BinaryWrite (const CotCHelpers::CHJSON *aConfiguration, const void *aPointer, size_t aSize, CResultHandler *aHandler) |
void | BinaryDelete (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 | Publish (const char *aNetwork, const CotCHelpers::CHJSON *aMessage, CResultHandler *aHandler) |
void | GetGodfatherCode (CResultHandler *aHandler, const char *aDomain="private") |
void | GetGodfather (CResultHandler *aHandler, const char *aDomain="private") |
void | SetGodfather (const char *aCode, const CotCHelpers::CHJSON *aOptions, CResultHandler *aHandler) |
void | GetGodchildren (CResultHandler *aHandler, const char *aDomain="private") |
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 (CResultHandler *aHandler, const CotCHelpers::CHJSON *aConfiguration, const CotCHelpers::CHJSON *aParameters) |
Static Public Member Functions | |
static CUserManager * | Instance () |
Friends | |
class | CClan |
struct | CFacebookGlue |
class | CGooglePlusGlue |
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 | ( | CResultHandler * | aHandler, |
const CotCHelpers::CHJSON * | aConfiguration, | ||
const CotCHelpers::CHJSON * | aParameters | ||
) |
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 | ( | CResultHandler * | aHandler, |
const char * | aDomain = "private" |
||
) |
Method used to retrieve all the godchildren for the currently logged in user.
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aDomain | is the domain in which the godfather link should be established. "private" means it's local to this game only. |
void CloudBuilder::CUserManager::GetGodfather | ( | CResultHandler * | aHandler, |
const char * | aDomain = "private" |
||
) |
Method used to retrieve the godfather of the currently logged in user.
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aDomain | is the domain in which the godfather link should be established. "private" means it's local to this game only. |
void CloudBuilder::CUserManager::GetGodfatherCode | ( | CResultHandler * | aHandler, |
const char * | aDomain = "private" |
||
) |
Method to call in order to generate a temporary code that can be used to obtain a new godchild.
aHandler | result handler whenever the call finishes (it might also be synchronous) |
aDomain | is the domain in which the godfather link should be established. "private" means it's local to this game only. |
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::Publish | ( | const char * | aNetwork, |
const CotCHelpers::CHJSON * | aMessage, | ||
CResultHandler * | aHandler | ||
) |
If the user is logged in with a Facebook linked account, you can use this method to publish something on this user's wall.
aNetwork | is the external social network on which the message should be published. |
aMessage | is a JSON object containing the message to be published on the wall. If the JSON object contains only one key, then the value has to be a string, and this string will be published to the wall, without any interaction with the user. Otherwise, the FB Share Dialog is presented to the user for confirmation and the JSON object should contain the following keys: 'link' : URL (http/https only) 'name' : title 'body' : message body 'picture' : image url (http/https only) |
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 ::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) |
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 |