Combu  2.1.14
Unity API Documentation
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
Combu.User Class Reference

User class implementing the Unity built-in Social interfaces (specialized IUserProfile, ILocalUser). More...

Inheritance diagram for Combu.User:
Combu.Profile

Public Member Functions

 User (bool authenticated)
 
 User (string jsonString)
 
 User (Hashtable hash)
 
virtual void FromUser (User source)
 
virtual void Authenticate (System.Action< bool > callback)
 Authenticate the user. More...
 
virtual void Authenticate (System.Action< bool, string > callback)
 Authenticate the user. More...
 
virtual void Authenticate (string password, System.Action< bool, string > callback)
 Authenticate the user with the specified password. More...
 
virtual void CreateGuest (System.Action< bool, string > callback)
 
virtual void LoadFriends (System.Action< bool > callback)
 Loads the friends of the current logged user. More...
 
virtual void LoadFriends (eContactType contactType, System.Action< bool > callback)
 Loads the friends of the current logged user. More...
 
virtual void LoadFriends< T > (eContactType contactType, System.Action< bool > callback)
 Loads the friends of the current logged user. More...
 
virtual void Update (System.Action< bool, string > callback)
 Update or Create this user to server, whether id is positive and greater than zero. More...
 
virtual void Delete (System.Action< bool, string > callback)
 Delete this instance from the server. More...
 
void Load (System.Action< bool > callback)
 Load of the current user from server. More...
 
virtual void ResetPassword (System.Action< bool, string > callback)
 Resets the password of this user. More...
 
virtual void ChangePassword (string newPassword, System.Action< bool, string > callback)
 Changes the password of this user. More...
 
virtual void AuthenticatePlatform (string platformKey, string platformId, System.Action< bool, string > callback)
 Authenticates the user from an external platform (like Facebook, Game Center, GooglePlay etc). Note you are the only responsible for the external authentication, Combu only stores the info that you send. More...
 
virtual void AuthenticatePlatform< T > (string platformKey, string platformId, System.Action< bool, string > callback)
 
virtual void LinkAccount (string username, string password, System.Action< bool, string > callback)
 Links the currently logged account to another: all the platforms Ids of the current user will be transferred to the new account and the current account will be deleted. More...
 
virtual void LinkPlatform (string platformKey, string platformId, System.Action< bool, string > callback)
 Links a new platform Id to the logged account. More...
 
void AddContact (string otherUsername, eContactType contactType, System.Action< bool, string > callback)
 Adds the contact. More...
 
void AddContact (Profile otherUser, eContactType contactType, System.Action< bool, string > callback)
 Adds the contact. More...
 
void RemoveContact (string otherUsername, System.Action< bool, string > callback)
 Removes the contact. More...
 
void RemoveContact (Profile otherUser, System.Action< bool, string > callback)
 Removes the contact. More...
 
- Public Member Functions inherited from Combu.Profile
 Profile (string jsonString)
 Initializes a new instance of the CBUser class from a JSON formatted string. More...
 
 Profile (Hashtable hash)
 Initializes a new instance of the CBUser class from a Hashtable. More...
 
virtual void FromJson (string jsonString)
 Initialize the object from a JSON formatted string. More...
 
virtual void FromHashtable (Hashtable hash)
 Initialize the object from a hashtable. More...
 

Static Public Member Functions

static void AuthenticateSession (long userId, string token, System.Action< bool, string > callback)
 
static void Delete (string username, string password, System.Action< bool, string > callback)
 Delete a user from the server. More...
 
static void Load (User[] updateUsers, System.Action< bool > callback)
 Reload the specified users from server (by Id). More...
 
static void Load (long userId, System.Action< User > callback)
 Loads a user by Id. More...
 
static void Load (string userName, System.Action< User > callback)
 Loads a user by userName. More...
 
static void Load (long[] userIds, System.Action< User[]> callback)
 Loads the users by Id. More...
 
static void Load (string[] userNames, System.Action< User[]> callback)
 Loads the users by userName. More...
 
static void Load< T > (string username, string email, SearchCustomData[] customData, bool isOnline, int pageNumber, int limit, System.Action< T[], int, int > callback)
 Loads the users by searching for the specified parameters. More...
 
static void Random< T > (SearchCustomData[] customData, int count, System.Action< T[]> callback)
 Loads a specified count of random users. More...
 
static void Exists (string username, string email, System.Action< bool, string > callback)
 Verify if it exists an account with the specified username and email. More...
 
static void ResetPassword (long idUser, System.Action< bool, string > callback)
 Resets the password of a user by Id Account. More...
 
static void ResetPassword (string username, System.Action< bool, string > callback)
 Resets the password of a user by Username. More...
 
static void ChangePassword (long idUser, string username, string resetCode, string newPassword, System.Action< bool, string > callback)
 Changes the password of a user. More...
 

Public Attributes

string password
 
- Public Attributes inherited from Combu.Profile
string email
 The email address. More...
 
Hashtable customData = new Hashtable()
 The custom data. More...
 

Properties

IUserProfile[] friends [get]
 
IUserProfile[] ignored [get]
 
IUserProfile[] requests [get]
 
bool authenticated [get]
 
virtual bool underage [get]
 
- Properties inherited from Combu.Profile
List< ProfilePlatformplatforms [get]
 
string id [get]
 Gets the identifier value as string. More...
 
long idLong [get]
 Gets the identifier value as long. id is just a ToString() of idLong, since Ids are stored as long in the database. More...
 
string userName [get, set]
 Gets or sets the name of the user. More...
 
bool isFriend [get]
 Gets a value indicating whether this Combu.Profile is a friend of the local user. More...
 
virtual UserState state [get]
 Gets the online state. More...
 
Texture2D image [get, set]
 Gets or sets the image. More...
 
string sessionToken [get]
 Gets the session token. More...
 
System.DateTime lastSeen [get]
 Gets the last seen date/time. More...
 

Additional Inherited Members

- Protected Attributes inherited from Combu.Profile
long _id = 0
 
string _userName = ""
 
Texture2D _image
 
string _sessionToken = ""
 
System.DateTime _lastSeen
 

Detailed Description

User class implementing the Unity built-in Social interfaces (specialized IUserProfile, ILocalUser).

Member Function Documentation

void Combu.User.AddContact ( string  otherUsername,
eContactType  contactType,
System.Action< bool, string >  callback 
)

Adds the contact.

Parameters
otherUsernameOther username.
contactTypeContact type.
callbackCallback.
void Combu.User.AddContact ( Profile  otherUser,
eContactType  contactType,
System.Action< bool, string >  callback 
)

Adds the contact.

Parameters
otherUserOther user.
contactTypeContact type.
callbackCallback.
virtual void Combu.User.Authenticate ( System.Action< bool >  callback)
virtual

Authenticate the user.

Parameters
callbackCallback.
virtual void Combu.User.Authenticate ( System.Action< bool, string >  callback)
virtual

Authenticate the user.

Parameters
callbackCallback.
virtual void Combu.User.Authenticate ( string  password,
System.Action< bool, string >  callback 
)
virtual

Authenticate the user with the specified password.

Parameters
passwordPassword.
callbackCallback.
Template Parameters
TType for User.
virtual void Combu.User.AuthenticatePlatform ( string  platformKey,
string  platformId,
System.Action< bool, string >  callback 
)
virtual

Authenticates the user from an external platform (like Facebook, Game Center, GooglePlay etc). Note you are the only responsible for the external authentication, Combu only stores the info that you send.

Parameters
platformKeyPlatform key.
platformIdPlatform identifier.
callbackCallback.
virtual void Combu.User.ChangePassword ( string  newPassword,
System.Action< bool, string >  callback 
)
virtual

Changes the password of this user.

Parameters
newPasswordNew password.
callbackCallback.
static void Combu.User.ChangePassword ( long  idUser,
string  username,
string  resetCode,
string  newPassword,
System.Action< bool, string >  callback 
)
static

Changes the password of a user.

Parameters
idUserIdentifier user.
usernameUsername.
resetCodeReset code.
newPasswordNew password.
callbackCallback.
virtual void Combu.User.Delete ( System.Action< bool, string >  callback)
virtual

Delete this instance from the server.

Parameters
callbackCallback.
static void Combu.User.Delete ( string  username,
string  password,
System.Action< bool, string >  callback 
)
static

Delete a user from the server.

Parameters
usernameUsername.
passwordPassword.
callbackCallback.
static void Combu.User.Exists ( string  username,
string  email,
System.Action< bool, string >  callback 
)
static

Verify if it exists an account with the specified username and email.

Parameters
usernameUsername.
emailEmail.
callbackCallback.
virtual void Combu.User.LinkAccount ( string  username,
string  password,
System.Action< bool, string >  callback 
)
virtual

Links the currently logged account to another: all the platforms Ids of the current user will be transferred to the new account and the current account will be deleted.

Parameters
usernameUsername.
passwordPassword.
callbackCallback.
virtual void Combu.User.LinkPlatform ( string  platformKey,
string  platformId,
System.Action< bool, string >  callback 
)
virtual

Links a new platform Id to the logged account.

Parameters
platformKeyPlatform key.
platformIdPlatform identifier.
callbackCallback.
static void Combu.User.Load ( User[]  updateUsers,
System.Action< bool >  callback 
)
static

Reload the specified users from server (by Id).

Parameters
updateUsersList of users.
callbackCallback.
void Combu.User.Load ( System.Action< bool >  callback)

Load of the current user from server.

Parameters
callbackCallback.
static void Combu.User.Load ( long  userId,
System.Action< User callback 
)
static

Loads a user by Id.

Parameters
userIdUser Id.
callbackCallback.
static void Combu.User.Load ( string  userName,
System.Action< User callback 
)
static

Loads a user by userName.

Parameters
userNameUser Name.
callbackCallback.
static void Combu.User.Load ( long[]  userIds,
System.Action< User[]>  callback 
)
static

Loads the users by Id.

Parameters
userIdsUser Ids.
callbackCallback.
updateUserIf passed its data will be replaced with the server result.
static void Combu.User.Load ( string[]  userNames,
System.Action< User[]>  callback 
)
static

Loads the users by userName.

Parameters
userNamesUser Names.
callbackCallback.
static void Combu.User.Load< T > ( string  username,
string  email,
SearchCustomData[]  customData,
bool  isOnline,
int  pageNumber,
int  limit,
System.Action< T[], int, int >  callback 
)
static

Loads the users by searching for the specified parameters.

Parameters
usernameUsername.
emailEmail.
customDataCustom data.
pageNumberPage number.
limitLimit.
callbackCallback.
Type Constraints
T :User 
T :new() 
virtual void Combu.User.LoadFriends ( System.Action< bool >  callback)
virtual

Loads the friends of the current logged user.

Parameters
callbackCallback.
virtual void Combu.User.LoadFriends ( eContactType  contactType,
System.Action< bool >  callback 
)
virtual

Loads the friends of the current logged user.

Parameters
contactTypeContact type.
callbackCallback.
virtual void Combu.User.LoadFriends< T > ( eContactType  contactType,
System.Action< bool >  callback 
)
virtual

Loads the friends of the current logged user.

Parameters
contactTypeContact type.
callbackCallback.
Template Parameters
TType for User.
Type Constraints
T :User 
T :new() 
static void Combu.User.Random< T > ( SearchCustomData[]  customData,
int  count,
System.Action< T[]>  callback 
)
static

Loads a specified count of random users.

Parameters
customDataCustom data.
countCount.
callbackCallback.
Type Constraints
T :User 
T :new() 
void Combu.User.RemoveContact ( string  otherUsername,
System.Action< bool, string >  callback 
)

Removes the contact.

Parameters
otherUsernameOther username.
callbackCallback.
void Combu.User.RemoveContact ( Profile  otherUser,
System.Action< bool, string >  callback 
)

Removes the contact.

Parameters
otherUserOther user.
callbackCallback.
virtual void Combu.User.ResetPassword ( System.Action< bool, string >  callback)
virtual

Resets the password of this user.

Parameters
callbackCallback.
static void Combu.User.ResetPassword ( long  idUser,
System.Action< bool, string >  callback 
)
static

Resets the password of a user by Id Account.

Parameters
idUserIdentifier user.
callbackCallback.
static void Combu.User.ResetPassword ( string  username,
System.Action< bool, string >  callback 
)
static

Resets the password of a user by Username.

Parameters
usernameUsername.
callbackCallback.
virtual void Combu.User.Update ( System.Action< bool, string >  callback)
virtual

Update or Create this user to server, whether id is positive and greater than zero.

Parameters
callbackCallback.

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