Game Jolt Unity API  v2.5.8
Public Member Functions | Protected Member Functions | Properties | List of all members
GameJolt.API.Objects.User Class Reference

User objects. More...

Inheritance diagram for GameJolt.API.Objects.User:
GameJolt.API.Objects.Base

Public Member Functions

 User (int id)
 Initializes a new instance of the User class. More...
 
 User (string name, string token)
 Initializes a new instance of the User class. More...
 
 User (JSONClass data)
 Initializes a new instance of the User class. More...
 
void SignIn (Action< bool > signedInCallback=null, Action< bool > userFetchedCallback=null, bool rememberMe=false)
 Signs in the user. More...
 
void SignOut ()
 Signs out the user. More...
 
void Get (Action< User > callback=null)
 Get the User information. More...
 
void DownloadAvatar (Action< bool > callback=null)
 Downloads the User avatar. More...
 
override string ToString ()
 Returns a string that represents the current User. More...
 
- Public Member Functions inherited from GameJolt.API.Objects.Base
void BulkUpdate (JSONClass data)
 Bulks update the object attributes. More...
 

Protected Member Functions

override void PopulateFromJson (JSONClass data)
 Map JSON data to the object's attributes. More...
 

Properties

string Name [get, set]
 Gets or sets the name. More...
 
string Token [get, set]
 Gets or sets the token. More...
 
bool IsAuthenticated [get]
 Gets a value indicating whether this User is authenticated. More...
 
int ID [get, set]
 Gets or sets the ID. More...
 
UserType Type [get]
 Gets the user type. More...
 
UserStatus Status [get]
 Gets the user status. More...
 
string AvatarURL [get, set]
 Gets or sets the user avatar URL. More...
 
Sprite Avatar [get, set]
 Gets or sets the user avatar. More...
 
string SignedUp [get]
 How long ago the user signed up. Example: "1 year ago" More...
 
int SignedUpTimestamp [get]
 The timestamp (in seconds) of when the user signed up. Example: 1502471604 More...
 
string LastLoggedIn [get]
 How long ago the user was last logged in. Will be "Online Now" if the user is currently online. Example: 2 minutes ago More...
 
int LastLoggedInTimestamp [get]
 The timestamp (in seconds) of when the user was last logged in. Example: 1502471604 More...
 
bool IsOnline [get]
 Whether this user is currently logged in into Game Jolt. More...
 
string DeveloperName [get]
 The user's display name. More...
 
string DeveloperWebsite [get]
 The user's website (or empty string if not specified) More...
 
string DeveloperDescription [get]
 The user's profile description. HTML tags and line breaks will be removed. More...
 

Detailed Description

User objects.

Constructor & Destructor Documentation

◆ User() [1/3]

GameJolt.API.Objects.User.User ( int  id)
inline

Initializes a new instance of the User class.

Parameters
idThe User ID.

◆ User() [2/3]

GameJolt.API.Objects.User.User ( string  name,
string  token 
)
inline

Initializes a new instance of the User class.

Parameters
nameThe User name.
tokenThe User token.

◆ User() [3/3]

GameJolt.API.Objects.User.User ( JSONClass  data)
inline

Initializes a new instance of the User class.

Parameters
dataAPI JSON data.

Member Function Documentation

◆ DownloadAvatar()

void GameJolt.API.Objects.User.DownloadAvatar ( Action< bool >  callback = null)
inline

Downloads the User avatar.

Parameters
callbackA callback function accepting a single parameter, a boolean indicating success.

Will set the Avatar field on the user.

◆ Get()

void GameJolt.API.Objects.User.Get ( Action< User callback = null)
inline

Get the User information.

Parameters
callbackA callback function accepting a single parameter, a User.

Shortcut for GameJolt.API.Users.Get(this);

◆ PopulateFromJson()

override void GameJolt.API.Objects.User.PopulateFromJson ( JSONClass  data)
inlineprotectedvirtual

Map JSON data to the object's attributes.

Parameters
dataJSON data from the API calls.

Implements GameJolt.API.Objects.Base.

◆ SignIn()

void GameJolt.API.Objects.User.SignIn ( Action< bool >  signedInCallback = null,
Action< bool >  userFetchedCallback = null,
bool  rememberMe = false 
)
inline

Signs in the user.

Parameters
signedInCallbackA callback function accepting a single parameter, a boolean indicating whether the user has been signed-in successfully.
userFetchedCallbackA callback function accepting a single parameter, a boolean indicating whether the user's information have been fetched successfully.
rememberMeWhether the user's credentials should be stored in the player prefs.

◆ SignOut()

void GameJolt.API.Objects.User.SignOut ( )
inline

Signs out the user.

◆ ToString()

override string GameJolt.API.Objects.User.ToString ( )
inline

Returns a string that represents the current User.

Returns
A string that represents the current User.

Property Documentation

◆ Avatar

Sprite GameJolt.API.Objects.User.Avatar
getset

Gets or sets the user avatar.

The user avatar.

Settings this will only affect your game and won't be saved to GameJolt.

◆ AvatarURL

string GameJolt.API.Objects.User.AvatarURL
getset

Gets or sets the user avatar URL.

The user avatar URL.

Settings this will only affect your game and won't be saved to GameJolt.

◆ DeveloperDescription

string GameJolt.API.Objects.User.DeveloperDescription
get

The user's profile description. HTML tags and line breaks will be removed.

◆ DeveloperName

string GameJolt.API.Objects.User.DeveloperName
get

The user's display name.

◆ DeveloperWebsite

string GameJolt.API.Objects.User.DeveloperWebsite
get

The user's website (or empty string if not specified)

◆ ID

int GameJolt.API.Objects.User.ID
getset

Gets or sets the ID.

The ID.

Settings this will only affect your game and won't be saved to GameJolt.

◆ IsAuthenticated

bool GameJolt.API.Objects.User.IsAuthenticated
get

Gets a value indicating whether this User is authenticated.

true if this User is authenticated; otherwise, false.

◆ IsOnline

bool GameJolt.API.Objects.User.IsOnline
get

Whether this user is currently logged in into Game Jolt.

◆ LastLoggedIn

string GameJolt.API.Objects.User.LastLoggedIn
get

How long ago the user was last logged in. Will be "Online Now" if the user is currently online. Example: 2 minutes ago

◆ LastLoggedInTimestamp

int GameJolt.API.Objects.User.LastLoggedInTimestamp
get

The timestamp (in seconds) of when the user was last logged in. Example: 1502471604

◆ Name

string GameJolt.API.Objects.User.Name
getset

Gets or sets the name.

The name.

Setting the name to a different value (case insensitive) will cause an authenticated User to not be authenticated anymore.

Settings this will only affect your game and won't be saved to GameJolt.

◆ SignedUp

string GameJolt.API.Objects.User.SignedUp
get

How long ago the user signed up. Example: "1 year ago"

◆ SignedUpTimestamp

int GameJolt.API.Objects.User.SignedUpTimestamp
get

The timestamp (in seconds) of when the user signed up. Example: 1502471604

◆ Status

UserStatus GameJolt.API.Objects.User.Status
get

Gets the user status.

The user status.

◆ Token

string GameJolt.API.Objects.User.Token
getset

Gets or sets the token.

The token.

Setting the token to a different value (case insensitive) will cause an authenticated User to not be authenticated anymore.

Settings this will only affect your game and won't be saved to GameJolt.

◆ Type

UserType GameJolt.API.Objects.User.Type
get

Gets the user type.

The user type.


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