Combu
3.2.2
Unity API Documentation
|
User class implementing the Unity built-in Social interfaces (specialized IUserProfile, ILocalUser). More...
Public Member Functions | |
User (bool authenticated) | |
User (string jsonString) | |
User (Hashtable hash) | |
virtual void | FromUser (User source) |
Sets the data from another user object. More... | |
virtual void | Authenticate (Action< bool > callback) |
Authenticate the user. More... | |
virtual void | Authenticate (Action< bool, string > callback) |
Authenticate the user. More... | |
virtual void | Authenticate (string password, Action< bool, string > callback) |
Authenticate the user with the specified password. More... | |
virtual void | CreateGuest (Action< bool, string > callback) |
Creates a guest account. More... | |
virtual void | LoadFriends (Action< bool > callback) |
Loads the friends of the current logged user. More... | |
virtual void | LoadFriends (eContactType contactType, Action< bool > callback) |
Loads the friends of the current logged user. More... | |
virtual void | LoadFriends< T > (eContactType contactType, Action< bool > callback) |
Loads the friends of the current logged user. More... | |
virtual void | Update (Action< bool, string > callback, bool requestUpdateFromServer=true, bool requestReplaceCustomData=false, bool requestReplaceAppCustomData=false) |
Update or Create this user to server, whether id is positive and greater than zero. More... | |
virtual void | Delete (Action< bool, string > callback) |
Delete this instance from the server. More... | |
void | Load (Action< bool > callback) |
Load of the current user from server. More... | |
virtual void | ResetPassword (Action< bool, string > callback) |
Resets the password of this user. More... | |
virtual void | ChangePassword (string newPassword, Action< bool, string > callback) |
Changes the password of this user. More... | |
virtual void | AuthenticatePlatform (string platformKey, string platformId, 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, Action< bool, string > callback) |
virtual void | LinkAccount (string username, string password, 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, Action< bool, string > callback) |
Links a new platform Id to the logged account. More... | |
void | GetContact (string idOrUsername, Action< bool, string, eContactType?, User > callback) |
Gets the contact information with loggedAccount if there's a pending request or is in the friends/ignored lists. If there's no relation found then the callback will return a failure. More... | |
void | GetContact< T > (string idOrUsername, Action< bool, string, eContactType?, User > callback) |
Gets the contact information with loggedAccount if there's a pending request or is in the friends/ignored lists. If there's no relation found then the callback will return a failure. More... | |
void | AddContact (string otherUsername, eContactType contactType, Action< bool, string > callback) |
Adds the contact. More... | |
void | AddContact (long otherId, eContactType contactType, Action< bool, string > callback) |
Adds the contact. More... | |
void | AddContact (Profile otherUser, eContactType contactType, Action< bool, string > callback) |
Adds the contact. More... | |
void | RemoveContact (string otherUsername, Action< bool, string > callback) |
Removes the contact. More... | |
void | RemoveContact (long otherId, Action< bool, string > callback) |
Removes the contact. More... | |
void | RemoveContact (Profile otherUser, 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 bool | CanAutoLogin (out string username, out string password) |
Determines if can auto-login and output the stored username and password. More... | |
static void | AutoLogin (Action< bool, string > callback) |
Automatically logins with the credentials stored in PlayerPrefs. More... | |
static void | AutoLogin< T > (Action< bool, string > callback) |
static void | ResendActivationCode (string usernameEmailOrId, Action< bool, string > callback) |
Resends the activation code by email. More... | |
static void | Delete (string username, string password, Action< bool, string > callback) |
Delete a user from the server. More... | |
static void | Load (User[] updateUsers, Action< bool > callback) |
Reload the specified users from server (by Id). More... | |
static void | Load (long userId, Action< User > callback) |
Loads a user by Id. More... | |
static void | Load (string userName, Action< User > callback) |
Loads a user by userName. More... | |
static void | Load (long[] userIds, Action< User[]> callback) |
Loads the users by Id. More... | |
static void | Load (string[] userNames, 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, Action< T[], int, int > callback) |
Loads the users by searching for the specified parameters. More... | |
static void | Random< T > (SearchCustomData[] customData, int count, Action< T[]> callback) |
Loads a specified count of random users. More... | |
static void | Exists (string username, string email, Action< bool, string > callback) |
Verify if it exists an account with the specified username and email. More... | |
static void | ResetPassword (long idUser, Action< bool, string > callback) |
Resets the password of a user by Id Account. More... | |
static void | ResetPassword (string username, Action< bool, string > callback) |
Resets the password of a user by Username. More... | |
static void | ChangePassword (long idUser, string username, string resetCode, string newPassword, Action< bool, string > callback) |
Changes the password of a user. More... | |
static void | LoadPlatform (IEnumerable< string > platformKeys, IEnumerable< string > platformIds, Action< User[]> callback) |
static void | LoadPlatform< T > (IEnumerable< string > platformKeys, IEnumerable< string > platformIds, Action< T[]> callback) |
Public Attributes | |
string | password |
Public Attributes inherited from Combu.Profile | |
string | |
The email address. More... | |
Hashtable | customData = new Hashtable() |
The global custom data shared between apps. More... | |
Hashtable | appCustomData = new Hashtable() |
The custom data for the current app scope. More... | |
Protected Member Functions | |
virtual void | StoreUserCredentials (string storeUserName, string storePassword) |
Stores the user credentials. More... | |
Properties | |
IUserProfile[] | friends [get] |
IUserProfile[] | ignored [get] |
IUserProfile[] | requests [get] |
IUserProfile[] | pendingRequests [get] |
bool | authenticated [get] |
virtual bool | underage [get] |
Properties inherited from Combu.Profile | |
List< ProfilePlatform > | platforms [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 |
User class implementing the Unity built-in Social interfaces (specialized IUserProfile, ILocalUser).
void Combu.User.AddContact | ( | long | otherId, |
eContactType | contactType, | ||
Action< bool, string > | callback | ||
) |
Adds the contact.
otherId | Other identifier. |
contactType | Contact type. |
callback | Callback. |
void Combu.User.AddContact | ( | Profile | otherUser, |
eContactType | contactType, | ||
Action< bool, string > | callback | ||
) |
Adds the contact.
otherUser | Other user. |
contactType | Contact type. |
callback | Callback. |
void Combu.User.AddContact | ( | string | otherUsername, |
eContactType | contactType, | ||
Action< bool, string > | callback | ||
) |
Adds the contact.
otherUsername | Other username. |
contactType | Contact type. |
callback | Callback. |
|
virtual |
Authenticate the user.
callback | Callback. |
|
virtual |
Authenticate the user.
callback | Callback. |
|
virtual |
Authenticate the user with the specified password.
password | Password. |
callback | Callback. |
T | Type for User. |
|
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.
platformKey | Platform key. |
platformId | Platform identifier. |
callback | Callback. |
|
static |
Automatically logins with the credentials stored in PlayerPrefs.
callback | Callback. |
|
static |
Determines if can auto-login and output the stored username and password.
true
if can auto-login; otherwise, false
.username | Username stored. |
password | Password stored. |
|
static |
Changes the password of a user.
idUser | Identifier user. |
username | Username. |
resetCode | Reset code. |
newPassword | New password. |
callback | Callback. |
|
virtual |
Changes the password of this user.
newPassword | New password. |
callback | Callback. |
|
virtual |
Creates a guest account.
callback | Callback. |
|
virtual |
Delete this instance from the server.
callback | Callback. |
|
static |
Delete a user from the server.
username | Username. |
password | Password. |
callback | Callback. |
|
static |
Verify if it exists an account with the specified username and email.
username | Username. |
Email. | |
callback | Callback. |
|
virtual |
Sets the data from another user object.
source | Source. |
void Combu.User.GetContact | ( | string | idOrUsername, |
Action< bool, string, eContactType?, User > | callback | ||
) |
Gets the contact information with loggedAccount if there's a pending request or is in the friends/ignored lists. If there's no relation found then the callback will return a failure.
idOrUsername | User id or username. |
callback | Callback. |
void Combu.User.GetContact< T > | ( | string | idOrUsername, |
Action< bool, string, eContactType?, User > | callback | ||
) |
Gets the contact information with loggedAccount if there's a pending request or is in the friends/ignored lists. If there's no relation found then the callback will return a failure.
idOrUsername | User id or username. |
callback | Callback. |
T | : | User | |
T | : | new() |
|
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.
username | Username. |
password | Password. |
callback | Callback. |
|
virtual |
Links a new platform Id to the logged account.
platformKey | Platform key. |
platformId | Platform identifier. |
callback | Callback. |
void Combu.User.Load | ( | Action< bool > | callback | ) |
Load of the current user from server.
callback | Callback. |
|
static |
Loads a user by Id.
userId | User Id. |
callback | Callback. |
|
static |
Loads the users by Id.
userIds | User Ids. |
callback | Callback. |
updateUser | If passed its data will be replaced with the server result. |
|
static |
Loads a user by userName.
userName | User Name. |
callback | Callback. |
|
static |
Loads the users by userName.
userNames | User Names. |
callback | Callback. |
|
static |
Reload the specified users from server (by Id).
updateUsers | List of users. |
callback | Callback. |
|
static |
Loads the users by searching for the specified parameters.
username | Username. |
Email. | |
customData | Custom data. |
pageNumber | Page number. |
limit | Limit. |
callback | Callback. |
T | : | User | |
T | : | new() |
|
virtual |
Loads the friends of the current logged user.
callback | Callback. |
|
virtual |
Loads the friends of the current logged user.
contactType | Contact type. |
callback | Callback. |
|
virtual |
Loads the friends of the current logged user.
contactType | Contact type. |
callback | Callback. |
T | Type for User. |
T | : | User | |
T | : | new() |
|
static |
Loads a specified count of random users.
customData | Custom data. |
count | Count. |
callback | Callback. |
T | : | User | |
T | : | new() |
void Combu.User.RemoveContact | ( | long | otherId, |
Action< bool, string > | callback | ||
) |
Removes the contact.
otherId | Other identifier. |
callback | Callback. |
void Combu.User.RemoveContact | ( | Profile | otherUser, |
Action< bool, string > | callback | ||
) |
Removes the contact.
otherUser | Other user. |
callback | Callback. |
void Combu.User.RemoveContact | ( | string | otherUsername, |
Action< bool, string > | callback | ||
) |
Removes the contact.
otherUsername | Other username. |
callback | Callback. |
|
static |
Resends the activation code by email.
usernameEmailOrId | Username, e-mail or identifier. |
callback | Callback. |
|
virtual |
Resets the password of this user.
callback | Callback. |
|
static |
Resets the password of a user by Id Account.
idUser | Identifier user. |
callback | Callback. |
|
static |
Resets the password of a user by Username.
username | Username. |
callback | Callback. |
|
protectedvirtual |
Stores the user credentials.
storeUserName | User name. |
storePassword | Password. |
|
virtual |
Update or Create this user to server, whether id is positive and greater than zero.
callback | Callback. |