OpenMod Docs OpenMod Docs
OpenMod Docs OpenMod Docs
OpenMod .NET Plugin Framework.

Interface IUserSession

Represents a user session.

Namespace: OpenMod.API.Users
Assembly: OpenMod.API.dll
Syntax
public interface IUserSession

Properties

| Improve this Doc View Source

InstanceData

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>>
| Improve this Doc View Source

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>>
| Improve this Doc View Source

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 Source

SessionStartTime

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 Source

DisconnectAsync(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

Extension Methods

DisposeHelper.DisposeSyncOrAsync(Object)