CloudBuilder  2.8.4
Making social games is easy !
Public Member Functions | Static Public Member Functions | Friends | List of all members
CloudBuilder::CTribeManager Class Reference

#include <CTribeManager.h>

Public Member Functions

void ListUsers (const char *aContainsString, int aLimit, int aSkip, CResultHandler *aHandler)
 
void ListFriends (CResultHandler *aHandler, const char *aDomain="private")
 
void BlacklistFriends (CResultHandler *aHandler, const char *aDomain="private")
 
void ChangeRelationshipStatus (CResultHandler *aHandler, const CotCHelpers::CHJSON *aOptions)
 
DEPRECATED void ChangeRelationshipStatus (const char *aFriendID, const char *aNewState, CResultHandler *aHandler)
 
void FriendsBestHighScore (CResultHandler *aHandler, int aCount, int aPage, const char *aMode, const char *aDomain="private")
 
DEPRECATED void FriendsBestHighScore (int aCount, int aPage, const char *aMode, CResultHandler *aHandler)
 
void ListNetworkFriends (CResultHandler *aHandler, const char *aNetwork, const char *aDomain="private")
 
DEPRECATED void ListNetworkFriends (const char *network, CResultHandler *aHandler)
 
void FindOpponents (CResultHandler *aHandler, const CotCHelpers::CHJSON *aFilter, const char *aDomain="private")
 
DEPRECATED void FindOpponents (const CotCHelpers::CHJSON *aFilter, CResultHandler *aHandler)
 
void Terminate ()
 
eErrorCode friendsGC (const CotCHelpers::CHJSON *friends)
 

Static Public Member Functions

static CTribeManagerInstance ()
 

Friends

struct CFacebookGlue
 
class CGooglePlusGlue
 
struct singleton_holder< CTribeManager >
 
void publishTribeAfterPermission (int err, void *params)
 
void publishUserAfterPermission (int err, void *params)
 

Detailed Description

The CTribeManager class is used to manage friends for a profile, and to allow this profile to send friendship requests to other profiles. This class manages all the notifications involved in the process.

Member Function Documentation

void CloudBuilder::CTribeManager::BlacklistFriends ( CResultHandler aHandler,
const char *  aDomain = "private" 
)

Method used to retrieve the application's blacklisted gamers of the currently logged in profile.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aDomainis the domain where you want to get blacklist friends. "private" means it's for this game only.
Returns
if noErr, the json passed to the handler may contain : "blacklisted" : [ {"gamer_id": "5402c6c3bcf7c96fa04e625f", profile" :{}} ],
void CloudBuilder::CTribeManager::ChangeRelationshipStatus ( CResultHandler aHandler,
const CotCHelpers::CHJSON aOptions 
)

Method used to change to a friendship inside the application.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aOptionsa json object which must contain "id" (string) : is a C string holding the gamer_id of the user to change the relation with. "status" (string) : is string with either: "add" : to be friend with "blacklist" : to blacklist the gamer "forget" : to remove any relationship "domain" (string) : the domain on which the friendship has to be modified. "osn" (json): an optional json object to specify the OS notification to be send (see the aNaotifiaction param of CUserManager::PushEvent)
Returns
if noErr, the json passed to the handler may contain : "done" : 1
void CloudBuilder::CTribeManager::FindOpponents ( CResultHandler aHandler,
const CotCHelpers::CHJSON aFilter,
const char *  aDomain = "private" 
)

Method used to retrieve random opponents for a match.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aFilteris a JSON object which describes the users' properties that should be matched to be considered for inclusion in the returned list.The syntax is the one used by MongoDB: http://docs.mongodb.org/manual/reference/operator/query/#query-selectors
aDomainis the domain where you want to retrieve opponents. "private" means it's for this game only.
void CloudBuilder::CTribeManager::FriendsBestHighScore ( CResultHandler aHandler,
int  aCount,
int  aPage,
const char *  aMode,
const char *  aDomain = "private" 
)

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

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
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 where you want to retrieve leaderboards. "private" means it's for this game only.
Returns
if noErr, the json passed to the handler may contain : { <aMode>: { "maxpage" : 10, "rankOfFirst" : 1, "page" : 1, "scores" : [] }
static CTribeManager* CloudBuilder::CTribeManager::Instance ( )
static

Use this method to obtain a reference to the CTribeManager.

Returns
the one and only instance of this manager
void CloudBuilder::CTribeManager::ListFriends ( CResultHandler aHandler,
const char *  aDomain = "private" 
)

Method used to retrieve the application's friends of the currently logged in profile.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aDomainis the domain where you want to get friends. "private" means it's for this game only.
Returns
if noErr, the json passed to the handler may contain : "friends" : [ {"gamer_id": "5402c6c3bcf7c96fa04e625f", profile" :{}} ],
void CloudBuilder::CTribeManager::ListNetworkFriends ( CResultHandler aHandler,
const char *  aNetwork,
const char *  aDomain = "private" 
)

Method used to retrieve all the friends in an external network, for the currently logged in profile.

Parameters
aHandlerresult handler whenever the call finishes (it might also be synchronous)
aNetworkis a string with possible values: facebook, google, gamecenter
aDomainis not used for the moment.
Returns
gives an indication if the request was correctly sent or not. enNoErr is sent if the request was sent.
void CloudBuilder::CTribeManager::ListUsers ( const char *  aContainsString,
int  aLimit,
int  aSkip,
CResultHandler aHandler 
)

Method used to check/retreive users from Clan of the Cloud community.

Parameters
aContainsStringis a C string which is a pseudo, an email or displayName
aLimitis the number of results you want to retrieve, default is 10
aSkipis the number of results to skip before returning users. the default is 0
aHandlerresult handler whenever the call finishes (it might also be synchronous)
Returns
if noErr, the json passed to the handler may contain : "count" : 50, "results" : [{ "_id" : "xxxx", "profile" : {} }] } where count is the maximum possible anwsers
void CloudBuilder::CTribeManager::Terminate ( )

You need to call this in CClan::Terminate().


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