Nakama .NET Client SDK 3.8.0
Nakama .NET Client SDK
Loading...
Searching...
No Matches
Nakama.Session Class Reference

More...

Inheritance diagram for Nakama.Session:
Nakama.ISession

Public Member Functions

bool HasExpired (DateTime offset)
 Check the session has expired against the offset time.
Parameters
offsetThe datetime to compare against this session.
Returns
If the session has expired.

 
bool HasRefreshExpired (DateTime offset)
 Check if the refresh token has expired against the offset time.
Parameters
offsetThe datetime to compare against this refresh token.
Returns
If refresh token has expired.

 
override string ToString ()
 

Static Public Member Functions

static ISession Restore (string authToken, string refreshToken=null)
 Restore a session from the auth token.
 

Static Public Attributes

static readonly DateTime Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
 

Properties

string AuthToken [get]
 The authorization token used to construct this session.
 
bool Created [get]
 If the user account for this session was just created.
 
long CreateTime [get]
 The UNIX timestamp when this session was created.
 
long ExpireTime [get]
 The UNIX timestamp when this session will expire.
 
bool IsExpired [get]
 If the session has expired.
 
bool IsRefreshExpired [get]
 If the refresh token has expired.
 
long RefreshExpireTime [get]
 The UNIX timestamp when the refresh token will expire.
 
string RefreshToken [get]
 Refresh token that can be used for session token renewal.
 
IDictionary< string, string > Vars [get]
 Any custom properties associated with this session.
 
string Username [get]
 The username of the user who owns this session.
 
string UserId [get]
 The ID of the user who owns this session.
 
- Properties inherited from Nakama.ISession

Detailed Description

Member Function Documentation

◆ HasExpired()

bool Nakama.Session.HasExpired ( DateTime  offset)
inline

Check the session has expired against the offset time.

Parameters
offsetThe datetime to compare against this session.
Returns
If the session has expired.

Implements Nakama.ISession.

◆ HasRefreshExpired()

bool Nakama.Session.HasRefreshExpired ( DateTime  offset)
inline

Check if the refresh token has expired against the offset time.

Parameters
offsetThe datetime to compare against this refresh token.
Returns
If refresh token has expired.

Implements Nakama.ISession.

◆ Restore()

static ISession Nakama.Session.Restore ( string  authToken,
string  refreshToken = null 
)
inlinestatic

Restore a session from the auth token.

A null or empty authentication token will return null.

Parameters
authTokenThe authorization token to restore as a session.
refreshTokenThe refresh token for the session.
Returns
A session.

◆ ToString()

override string Nakama.Session.ToString ( )
inline

Member Data Documentation

◆ Epoch

readonly DateTime Nakama.Session.Epoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)
static

Property Documentation

◆ AuthToken

string Nakama.Session.AuthToken
get

The authorization token used to construct this session.

Implements Nakama.ISession.

◆ Created

bool Nakama.Session.Created
get

If the user account for this session was just created.

Implements Nakama.ISession.

◆ CreateTime

long Nakama.Session.CreateTime
get

The UNIX timestamp when this session was created.

Implements Nakama.ISession.

◆ ExpireTime

long Nakama.Session.ExpireTime
get

The UNIX timestamp when this session will expire.

Implements Nakama.ISession.

◆ IsExpired

bool Nakama.Session.IsExpired
get

If the session has expired.

Implements Nakama.ISession.

◆ IsRefreshExpired

bool Nakama.Session.IsRefreshExpired
get

If the refresh token has expired.

Implements Nakama.ISession.

◆ RefreshExpireTime

long Nakama.Session.RefreshExpireTime
get

The UNIX timestamp when the refresh token will expire.

Implements Nakama.ISession.

◆ RefreshToken

string Nakama.Session.RefreshToken
get

Refresh token that can be used for session token renewal.

Implements Nakama.ISession.

◆ UserId

string Nakama.Session.UserId
get

The ID of the user who owns this session.

Implements Nakama.ISession.

◆ Username

string Nakama.Session.Username
get

The username of the user who owns this session.

Implements Nakama.ISession.

◆ Vars

IDictionary<string, string> Nakama.Session.Vars
get

Any custom properties associated with this session.

Implements Nakama.ISession.


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