Class Users
Your games will not authenticate users by using their username and password. Instead, users have a token to verify themselves along with their username.
Inherited Members
Namespace: GameJolt.Services
Assembly: GameJolt.dll
Syntax
public sealed class Users : Service
Methods
| Improve this Doc View SourceAuth(String, String, Action<Response<Credentials>>)
Authenticates the user's information. This should be done before you make any calls for the user, to make sure the user's credentials (username and token) are valid. The callback is called with the authenticated user credentials or null if the authentication has failed.
Declaration
public void Auth(string name, string token, Action<Response<Credentials>> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The user's username. |
System.String | token | The user's token (not his password!) |
System.Action<Response<Credentials>> | callback | Action that is called on completion or error. |
AuthAsync(String, String)
Authenticates the user's information. This should be done before you make any calls for the user, to make sure the user's credentials (username and token) are valid. When the returned is awaited, the resulting Credentials object can be used to perform user queries.
Declaration
public Task<Response<Credentials>> AuthAsync(string name, string token)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The user's username. |
System.String | token | The user's token (not his password!) |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response<Credentials>> |
Fetch(Int32, Action<Response<User>>)
Returns a user's data, like name, id, avatar, etc.
Declaration
public void Fetch(int id, Action<Response<User>> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The user's GameJolt id. |
System.Action<Response<User>> | callback | Action that is called on completion or error. |
Fetch(Int32[], Action<Response<User[]>>)
Returns the data for several user's at once.
Declaration
public void Fetch(int[] ids, Action<Response<User[]>> callback)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | ids | Array of user ids. |
System.Action<Response<User[]>> | callback | Action that is called on completion or error. |
Fetch(String, Action<Response<User>>)
Returns a user's data, like name, id, avatar, etc.
Declaration
public void Fetch(string name, Action<Response<User>> callback)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The user's username. |
System.Action<Response<User>> | callback | Action that is called on completion or error. |
FetchAsync(Int32)
Returns a user's data, like name, id, avatar, etc.
Declaration
public Task<Response<User>> FetchAsync(int id)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | id | The user's GameJolt id. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response<User>> |
FetchAsync(Int32[])
Returns the data for several user's at once.
Declaration
public Task<Response<User[]>> FetchAsync(int[] ids)
Parameters
Type | Name | Description |
---|---|---|
System.Int32[] | ids | Array of user ids. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response<User[]>> |
FetchAsync(String)
Returns a user's data, like name, id, avatar, etc.
Declaration
public Task<Response<User>> FetchAsync(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The user's username. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<Response<User>> |