user - TogetherGames/Public-Unity-CSharp GitHub Wiki

User

Together::User

Overview

The User class represents a Together User.


Members

long UserID

The ID of the User.

string UserGuid

The Guid assigned to the user that should be cached on the device. When the UserGuid is passed while sending the 'loginuser' message to the server, the User assigned the UserGuid will be returned.

int ActiveUserAccountTypeID

The type of account the User has. This member represents the last registration performed by the user. 0=Anonymous, 1=Facebook, 2=Twitter, 3=GooglePlus, 4=GameCenter, 5=Custom

string Name

The name of the User. For anonymous users, it will be in the format 'user_###' where ### equals the UserID of the User. For registered users, this will be equal to the Users name from some external social network. When a User registers via Facebook, Name will be set to their Facebook name.

string Username

The username for the User. It will be in the format 'user_###' where ### equals the UserID of the User. This value is generated when a new User logs into a together game for the first. This value can not be changed at this time.

string Email

The email of the User.

bool Active

A boolean indicating whether the User is active.

bool Anonymous

A boolean indicating whether the User has registered yet.

int LastActivityInSeconds

The number of seconds since the User has been active.

long GameID

The ID of the Client whose Game the User is currently playing.

long GameID

The ID of the Game the User is currently playing.

long PlatformID

The ID of the Platform the User is currently playing.

PropertyCollection Properties

A property collection containing all custom properties for the User.

FacebookUser FacebookUser

An instance of a FacebookUser object containing facebook user information. If FacebookUser is non null, then the User has performed a Facebook registration at some time.

CustomUser CustomUser

An instance of a CustomUser object containing custom user information. If CustomUser is non null, then the User has performed a Custom registration at some time.

ClientUserProfile ClientUserProfile

An instance of a ClientUserProfile object containing client specific properties for the User.

GameUserProfile GameUserProfile

An instance of a GameUserProfile object containing game specific properties for the User.

UserItemManager UserItemManager

An instance of a UserItemManager object so developers can have quick access to User's inventory of Items.

UserAchievementManager UserAchievementManager

An instance of a UserAchievementManager object so developers can have quick access to a User's UserAchievements.

UserGameManager UserGameManager

An instance of a UserGameManager object so developers can have quick access to the list of games a User has played.


Methods


GetFacebookUser()

Gets the FacebookUser associated to this Together User if it exists, otherwise returns null.

Returns FacebookUser
Syntax
User.GetFacebookUser(  )

GetCustomUser()

Gets the CustomUSer associated to this Together User if it exists, otherwise returns null.

Returns CustomUser
Syntax
User.GetCustomUser(  )

GetDetails()

Gets all the User's details. Upon success, this will automatically update the internal data. The UserID member is passed along to the server when this method is called.

Returns void
Syntax
User.GetDetails( callbackFunc )
Parameters

OnCompleteHandler callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------

Modify()

Modifies a User. Upon success, this will automatically update the internal data. The Properties, ClientUserProfile properties, and GameUserProfile properties are sent to the server when this method is called.

Returns void
Syntax
User.Modify( callbackFunc )
Parameters

OnCompleteHandler callbackFunc

The function to call upon completion.

--------------------------------------------------------------------------------
⚠️ **GitHub.com Fallback** ⚠️