Interface IUserSession
Represents a user session.
Namespace: OpenMod.API.Users
Assembly: OpenMod.API.dll
Syntax
public interface IUserSession
Properties
| Improve this Doc View SourceInstanceData
Gets the user data that is stored for process lifetime and will survive reloads.
Declaration
Dictionary<string, object?> InstanceData { get; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, System.Nullable<System.Object>> |
SessionData
Gets the user data for this session.
Declaration
Dictionary<string, object?> SessionData { get; }
Property Value
Type | Description |
---|---|
Dictionary<System.String, System.Nullable<System.Object>> |
SessionEndTime
Gets the time the users session has ended. Return null if the session has not started or has not ended yet.
Declaration
DateTime? SessionEndTime { get; }
Property Value
Type | Description |
---|---|
System.Nullable<DateTime> |
Examples
The time a user has left a server.
| Improve this Doc View SourceSessionStartTime
Gets the time the session has begun. Returns null if the session has not started.
Declaration
DateTime? SessionStartTime { get; }
Property Value
Type | Description |
---|---|
System.Nullable<DateTime> |
Examples
The time a user has joined a server.
Methods
| Improve this Doc View SourceDisconnectAsync(String)
Disconnects the user.
Declaration
Task DisconnectAsync(string reason = "")
Parameters
Type | Name | Description |
---|---|---|
System.String | reason | The optional disconnect reason to be showed to the user. |
Returns
Type | Description |
---|---|
Task |