Combu  3.2.2
Unity API Documentation
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Properties | List of all members
Combu.CombuManager Class Reference

Combu Manager class, it follows the Singleton pattern design (accessible through the 'instance' static property), it means that you shouldn't have more than one instance of this component in your scene. More...

Inheritance diagram for Combu.CombuManager:

Public Member Functions

void Connect ()
 Connect to server if not already initialized. More...
 
void CallWebservice (string url, WWWForm form, System.Action< string, string > onComplete)
 Calls a webservice. More...
 
void CancelRequest ()
 Cancels the current request (next frame). More...
 
CombuForm CreateForm ()
 Creates a new form to be passed to a webservice. More...
 
string GetUrl (string relativeUrl)
 Gets the absolute URL from a relative. More...
 
virtual void SetLocalUser (User user)
 Sets the local user. For internal use only (e.g. User.Authenticate), it's not recommended to call this method directly. More...
 
virtual void GetServerInfo (Action< bool, CombuServerInfo > callback)
 Gets the server info. More...
 
virtual void Ping (bool onlyIfAuthenticated=true, Action< bool > callback=null)
 Ping the server. More...
 

Static Public Member Functions

static byte[] CaptureScreenshot (int thumbnailHeight=720, List< Camera > excludeCams=null)
 Captures the screen shot. More...
 
static string EncryptMD5 (string inputString)
 Encrypts a string in MD5. More...
 
static string EncryptSHA1 (string inputString)
 Encrypts a string in SHA1. More...
 
static string EncryptAES (string inputString)
 Encrypts a string in AES. More...
 
static string DecryptAES (string inputString)
 Decrypts a string in AES. More...
 

Public Attributes

bool dontDestroyOnLoad = true
 Should call DontDestroyOnLoad on the CombuManager gameObject? Recommended: set to true More...
 
bool setAsDefaultSocialPlatform
 Should set Combu as the active social platform? The previous platform is accessible from defaultSocialPlatform More...
 
bool connectOnAwake = true
 Auto-connect to server on Awake. More...
 
bool useExperimentalThreaded
 Enable the use of the experimental job to run the decryption process in a separated thread. More...
 
float retryConnectAfterSeconds = 0f
 Upon failed connection to server, it will retry to connect after specified seconds (set 0 to disable auto-retry). More...
 
string appId
 The app identifier. More...
 
string appSecret
 The app secret key. More...
 
string urlRootProduction
 The URL root for the production environment. More...
 
string urlRootStage
 The URL root for the stage environment. More...
 
bool useStage
 If true sets the stage as current environment (default: false for production). More...
 
bool skipCertificateVerification
 Skip the verification of the SSL certificate in UnityWebRequest (Unity 2017.1 or newer) More...
 
bool logDebugInfo
 Print debug info in the console log. More...
 
bool rememberCredentials
 Store the user credentials in PlayerPrefs to auto-login on next connection. More...
 
float pingIntervalSeconds = 30f
 The ping interval in seconds (set 0 to disable automatic pings). Ping is currently used to mantain the online state of the local user and is automatically called only if the local user is authenticated. More...
 
int onlineSeconds = 120
 The max seconds from now to a user's lastSeen to consider the online state. More...
 
int playingSeconds = 120
 The max seconds from now to a user's lastSeen to consider the playing state. More...
 
string language = "en"
 The language to localize the error messages from web services. More...
 
GameObject achievementUIObject
 The achievement user interface object for CombuPlatform.ShowAchievementsUI(). More...
 
string achievementUIFunction
 The achievement user interface function for CombuPlatform.ShowAchievementsUI(). More...
 
GameObject leaderboardUIObject
 The leaderboard user interface object for CombuPlatform.ShowLeaderboardUI(). More...
 
string leaderboardUIFunction
 The leaderboard user interface function for CombuPlatform.ShowLeaderboardUI(). More...
 

Static Public Attributes

const string COMBU_VERSION = "3.2.2"
 Current API version. More...
 

Protected Member Functions

virtual void Awake ()
 
virtual void Start ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void AutoPing ()
 This is InvokeRepeated on enable and automatically pings the server. If the user was authenticated and the ping fails, the local user is automatically disconnected. More...
 
IEnumerator DownloadUrl (string url, WWWForm form, Action< string, string > onComplete)
 Downloads the content of an URL with the specified form. More...
 

Protected Attributes

ISocialPlatform _defaultSocialPlatform
 
CombuServerInfo _serverInfo
 
bool downloading
 

Static Protected Attributes

static CombuManager _instance
 The singleton instance of CombuManager More...
 
static CombuPlatform _platform
 The singleton instance of CombuPlatform. More...
 
static CombuEncryption encryption = new CombuEncryption()
 The instance of data encryption. More...
 

Properties

static string? sessionToken [get]
 Gets the session token. More...
 
static CombuManager instance [get]
 Gets the current singleton instance. More...
 
static CombuPlatform platform [get]
 Gets the Combu ISocialPlatform implementation. More...
 
static UserlocalUser [get]
 Gets the local user. More...
 
static bool isInitialized [get]
 Gets a value indicating whether the Singleton instance of Combu.CombuManager is initialized. More...
 
ISocialPlatform defaultSocialPlatform [get]
 Gets the default social platform defined (this is set before Combu is set as activate, eventually). More...
 
bool isDownloading [get]
 Gets a value indicating whether this Combu.CombuManager is downloading from a webservice. More...
 
bool isCancelling [get]
 Gets a value indicating whether this Combu.CombuManager is cancelling a webservice request. More...
 
bool isAuthenticated [get]
 Gets a value indicating whether Combu.CombuManager.localUser is authenticated. More...
 
CombuServerInfo serverInfo [get]
 Gets the server info. More...
 

Detailed Description

Combu Manager class, it follows the Singleton pattern design (accessible through the 'instance' static property), it means that you shouldn't have more than one instance of this component in your scene.

Member Function Documentation

◆ AutoPing()

virtual void Combu.CombuManager.AutoPing ( )
protectedvirtual

This is InvokeRepeated on enable and automatically pings the server. If the user was authenticated and the ping fails, the local user is automatically disconnected.

◆ CallWebservice()

void Combu.CombuManager.CallWebservice ( string  url,
WWWForm  form,
System.Action< string, string >  onComplete 
)

Calls a webservice.

Parameters
urlURL.
formForm.
onCompleteOn complete callback.

◆ CancelRequest()

void Combu.CombuManager.CancelRequest ( )

Cancels the current request (next frame).

◆ CaptureScreenshot()

static byte [] Combu.CombuManager.CaptureScreenshot ( int  thumbnailHeight = 720,
List< Camera >  excludeCams = null 
)
static

Captures the screen shot.

Returns
The screen shot.
Parameters
thumbnailHeightThumbnail height.
excludeCamsExclude cams.

◆ Connect()

void Combu.CombuManager.Connect ( )

Connect to server if not already initialized.

◆ CreateForm()

CombuForm Combu.CombuManager.CreateForm ( )

Creates a new form to be passed to a webservice.

Returns
The form.

◆ DecryptAES()

static string Combu.CombuManager.DecryptAES ( string  inputString)
static

Decrypts a string in AES.

Returns
The decrypted string.
Parameters
inputStringInput string.

◆ DownloadUrl()

IEnumerator Combu.CombuManager.DownloadUrl ( string  url,
WWWForm  form,
Action< string, string >  onComplete 
)
protected

Downloads the content of an URL with the specified form.

Returns
The URL.
Parameters
urlURL.
formForm.
onCompleteOn complete.

◆ EncryptAES()

static string Combu.CombuManager.EncryptAES ( string  inputString)
static

Encrypts a string in AES.

Returns
The encrypted string.
Parameters
inputStringInput string.

◆ EncryptMD5()

static string Combu.CombuManager.EncryptMD5 ( string  inputString)
static

Encrypts a string in MD5.

Returns
The encrypted string.
Parameters
inputStringInput string.

◆ EncryptSHA1()

static string Combu.CombuManager.EncryptSHA1 ( string  inputString)
static

Encrypts a string in SHA1.

Returns
The encrypted string.
Parameters
inputStringInput string.

◆ GetServerInfo()

virtual void Combu.CombuManager.GetServerInfo ( Action< bool, CombuServerInfo callback)
virtual

Gets the server info.

Parameters
callbackCallback.

◆ GetUrl()

string Combu.CombuManager.GetUrl ( string  relativeUrl)

Gets the absolute URL from a relative.

Returns
The URL.
Parameters
relativeUrlRelative URL.

◆ Ping()

virtual void Combu.CombuManager.Ping ( bool  onlyIfAuthenticated = true,
Action< bool >  callback = null 
)
virtual

Ping the server.

Parameters
onlyIfAuthenticatedIf set to true then it runs only if local user is authenticated.
callbackCallback.

◆ SetLocalUser()

virtual void Combu.CombuManager.SetLocalUser ( User  user)
virtual

Sets the local user. For internal use only (e.g. User.Authenticate), it's not recommended to call this method directly.

Parameters
userUser.

Member Data Documentation

◆ _instance

CombuManager Combu.CombuManager._instance
staticprotected

The singleton instance of CombuManager

◆ _platform

CombuPlatform Combu.CombuManager._platform
staticprotected

The singleton instance of CombuPlatform.

◆ achievementUIFunction

string Combu.CombuManager.achievementUIFunction

The achievement user interface function for CombuPlatform.ShowAchievementsUI().

◆ achievementUIObject

GameObject Combu.CombuManager.achievementUIObject

The achievement user interface object for CombuPlatform.ShowAchievementsUI().

◆ appId

string Combu.CombuManager.appId

The app identifier.

◆ appSecret

string Combu.CombuManager.appSecret

The app secret key.

◆ COMBU_VERSION

const string Combu.CombuManager.COMBU_VERSION = "3.2.2"
static

Current API version.

◆ connectOnAwake

bool Combu.CombuManager.connectOnAwake = true

Auto-connect to server on Awake.

◆ dontDestroyOnLoad

bool Combu.CombuManager.dontDestroyOnLoad = true

Should call DontDestroyOnLoad on the CombuManager gameObject? Recommended: set to true

◆ encryption

CombuEncryption Combu.CombuManager.encryption = new CombuEncryption()
staticprotected

The instance of data encryption.

◆ language

string Combu.CombuManager.language = "en"

The language to localize the error messages from web services.

◆ leaderboardUIFunction

string Combu.CombuManager.leaderboardUIFunction

The leaderboard user interface function for CombuPlatform.ShowLeaderboardUI().

◆ leaderboardUIObject

GameObject Combu.CombuManager.leaderboardUIObject

The leaderboard user interface object for CombuPlatform.ShowLeaderboardUI().

◆ logDebugInfo

bool Combu.CombuManager.logDebugInfo

Print debug info in the console log.

◆ onlineSeconds

int Combu.CombuManager.onlineSeconds = 120

The max seconds from now to a user's lastSeen to consider the online state.

◆ pingIntervalSeconds

float Combu.CombuManager.pingIntervalSeconds = 30f

The ping interval in seconds (set 0 to disable automatic pings). Ping is currently used to mantain the online state of the local user and is automatically called only if the local user is authenticated.

◆ playingSeconds

int Combu.CombuManager.playingSeconds = 120

The max seconds from now to a user's lastSeen to consider the playing state.

◆ rememberCredentials

bool Combu.CombuManager.rememberCredentials

Store the user credentials in PlayerPrefs to auto-login on next connection.

◆ retryConnectAfterSeconds

float Combu.CombuManager.retryConnectAfterSeconds = 0f

Upon failed connection to server, it will retry to connect after specified seconds (set 0 to disable auto-retry).

◆ setAsDefaultSocialPlatform

bool Combu.CombuManager.setAsDefaultSocialPlatform

Should set Combu as the active social platform? The previous platform is accessible from defaultSocialPlatform

◆ skipCertificateVerification

bool Combu.CombuManager.skipCertificateVerification

Skip the verification of the SSL certificate in UnityWebRequest (Unity 2017.1 or newer)

◆ urlRootProduction

string Combu.CombuManager.urlRootProduction

The URL root for the production environment.

◆ urlRootStage

string Combu.CombuManager.urlRootStage

The URL root for the stage environment.

◆ useExperimentalThreaded

bool Combu.CombuManager.useExperimentalThreaded

Enable the use of the experimental job to run the decryption process in a separated thread.

◆ useStage

bool Combu.CombuManager.useStage

If true sets the stage as current environment (default: false for production).

Property Documentation

◆ defaultSocialPlatform

ISocialPlatform Combu.CombuManager.defaultSocialPlatform
get

Gets the default social platform defined (this is set before Combu is set as activate, eventually).

The default social platform.

◆ instance

CombuManager Combu.CombuManager.instance
staticget

Gets the current singleton instance.

The instance.

◆ isAuthenticated

bool Combu.CombuManager.isAuthenticated
get

Gets a value indicating whether Combu.CombuManager.localUser is authenticated.

true if is authenticated; otherwise, false.

◆ isCancelling

bool Combu.CombuManager.isCancelling
get

Gets a value indicating whether this Combu.CombuManager is cancelling a webservice request.

true if is cancelling; otherwise, false.

◆ isDownloading

bool Combu.CombuManager.isDownloading
get

Gets a value indicating whether this Combu.CombuManager is downloading from a webservice.

true if is downloading; otherwise, false.

◆ isInitialized

bool Combu.CombuManager.isInitialized
staticget

Gets a value indicating whether the Singleton instance of Combu.CombuManager is initialized.

true if is initialized; otherwise, false.

◆ localUser

User? Combu.CombuManager.localUser
staticget

Gets the local user.

The local user.

◆ platform

CombuPlatform Combu.CombuManager.platform
staticget

Gets the Combu ISocialPlatform implementation.

The platform.

◆ serverInfo

CombuServerInfo Combu.CombuManager.serverInfo
get

Gets the server info.

The server info.

◆ sessionToken

string? Combu.CombuManager.sessionToken
staticget

Gets the session token.

The session token.