CloudBuilder  2.8.4
Making social games is easy !
Classes | Typedefs | Enumerations | Functions
CloudBuilder Namespace Reference

Classes

class  CClan
 
class  CCloudResult
 
struct  CEventListener
 
class  CFilesystemHandler
 
class  CFilesystemManager
 
class  CGameManager
 
struct  chain
 
class  CInputFile
 
struct  CMatch
 
struct  CMatchEventListener
 
struct  CMatchManager
 
class  COutputFile
 
struct  CStoreManager
 
class  CTribeManager
 
class  CUserManager
 

Typedefs

typedef CDelegate< void(eErrorCode errorCode, const CCloudResult *result)> CResultHandler
 
typedef CDelegate< void(eErrorCode aErrorCode, const CCloudResult *aResult, CMatch *)> CMatchResultHandler
 

Enumerations

enum  eErrorCode {
  enNoErr = 0, enFirstError = 1000, enSetupNotCalled, enNotLogged, enEventListenerAlreadyRegistered, enNetworkError, enServerError, enNotImplemented,
  enAlreadyLogged, enBadAppCredential, enExternalCommunityNotSetup, enBadParameters, enUserNotLoggedInGooglePlayServices, enExternalCommunityError, enGooglePlusAppNotInstalled, enUserCanceledGooglePlusPost,
  enErrorGooglePlayServices, enCanceled, enAlreadyLoggedWhileRestoringASession, enOperationAlreadyInProgress, enFriendYourself, enObjectDestroyed, enNoMatchToResume, enExternalCommunityRefusedPermission,
  enProductNotFound, enLogicError, enErrorWithExternalStore, enUserCanceledPurchase, enInternalError, enLastError
}
 

Functions

template<class O >
CResultHandlerMakeResultHandler (O *object, void(O::*method)(eErrorCode, const CCloudResult *))
 
template<class O , typename T >
CResultHandlerMakeResultHandler (O *object, void(O::*method)(eErrorCode, const CCloudResult *, T), T param)
 
template<class O , typename T , typename U >
CResultHandlerMakeResultHandler (O *object, void(O::*method)(eErrorCode, const CCloudResult *, T, U), T p1, U p2)
 
template<class O , typename T , typename U , typename V >
CResultHandlerMakeResultHandler (O *object, void(O::*method)(eErrorCode, const CCloudResult *, T, U, V), T p1, U p2, V p3)
 
FACTORY_FCT const char * errorString (eErrorCode err)
 

Detailed Description

Namespace CloudBuilder is the default namespace for all Clan of the Cloud APIs.

Typedef Documentation

typedef CDelegate<void (eErrorCode errorCode, const CCloudResult *result)> CloudBuilder::CResultHandler

Result handler for asynchronous methods. Create either with:

  • new CResultHandler(this, &Object::myMethod);
  • MakeResultHandler(this, &Object::myMethod, parameter)

And make it point to a method taking an eErrorCode and a const CCloudResult (and a parameter if you use the second variant). E.g.: void Object::Method(eErrorCode errorCode, const CCloudResult *result, int param) { } -> MakeResultHandler(this, &Object::Method, 123);

Enumeration Type Documentation

Enum used to specify errors returns by CotC functions and methods. To be kept in sync with EErrorCode.java (Android) and the Unity wrapper.

Enumerator
enNoErr 

No error.

enSetupNotCalled 

1001 - Trying to access some features, but CClan::Setup has not been called.

enNotLogged 

1002 - Trying to access some features, but the user is not logged yet.

enEventListenerAlreadyRegistered 

1003 - Trying to register an event listener twice for a domain

enNetworkError 

1004 - Networking problem (unable to reach the server)

enServerError 

1005 - Internal server error. Contact CotC.

enNotImplemented 

1006 - Functionality not yet implemented. Contact CotC.

enAlreadyLogged 

1007 - The user is already logged in another session.

enBadAppCredential 

1008 - Invalid parameters passed to CClan::Setup.

enExternalCommunityNotSetup 

1009 - Trying to use external community features but CClan constructor did not specify it.

enBadParameters 

1010 - Something is missing in the JSON you sent with your query.

enUserNotLoggedInGooglePlayServices 

1011 - User is not logged into GooglePlayServices.

enExternalCommunityError 

1012 - An error occured when communicating with an external community on the client side.

enGooglePlusAppNotInstalled 

1013 - The Google+ application is not installed on the device.

enUserCanceledGooglePlusPost 

1014 - The user has canceled posting on Google+.

enErrorGooglePlayServices 

1015 - An error occured when using GooglePlay services.

enCanceled 

1016 - The operation has been canceled

enAlreadyLoggedWhileRestoringASession 

1017 - The operation has been canceled

enOperationAlreadyInProgress 

1018 - This operation (or a similar one) is already in progress, and this request was discarded as a result

enFriendYourself 

1019 - You can not be a friend with yourself

enObjectDestroyed 

1020 - You are trying to use an object that was created prior to a Terminate call

enNoMatchToResume 

1021 - No match to resume

enExternalCommunityRefusedPermission 

1022 - The permission has not been given by the user to perform the operation

enProductNotFound 

1023 - Product not found

enLogicError 

1024 - Logic error

enErrorWithExternalStore 

1025 - Generic problem with the external "app" store

enUserCanceledPurchase 

1026 - The user canceled the purchase

enInternalError 

1027 - Internal error with the library

enLastError 

You shouldn't receive this error, it's just a convenient value.

Function Documentation

FACTORY_FCT const char* CloudBuilder::errorString ( eErrorCode  err)

Call this function when you want a written description for an error

Parameters
erris the error whose description is required.
Returns
is the string explaining the error.
template<class O >
CResultHandler* CloudBuilder::MakeResultHandler ( O *  object,
void(O::*)(eErrorCode, const CCloudResult *)  method 
)

Builds a CResultHandler.

Parameters
objectobject to which the method belongs.
methodthe method to be called on the object
Returns
a CResultHandler to pass to various API calls
template<class O , typename T >
CResultHandler* CloudBuilder::MakeResultHandler ( O *  object,
void(O::*)(eErrorCode, const CCloudResult *, T)  method,
param 
)

Builds a CResultHandler with additional parameters.

Parameters
objectobject to which the method belongs.
methodthe method to be called on the object
paramadditional parameter; a parameter with the same type as the one passed should be accept as last argument by the method
Returns
a CResultHandler to pass to various API calls
Note
Other variants of this method accepting up to 3 parameters exist, and use the same schema.