Skip to content

Class AuthenticationResult

Namespace: Void.Proxy.Api.Events.Authentication
Assembly: Void.Proxy.Api.dll

public record AuthenticationResult : IEquatable<AuthenticationResult>

Inheritance

objectAuthenticationResult

Implements

IEquatable<AuthenticationResult>

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

AuthenticationResult(bool, string?)

public AuthenticationResult(bool IsAuthenticated, string? Message = null)

Parameters

IsAuthenticated bool

Message string?

Properties

AlreadyAuthenticated

public static AuthenticationResult AlreadyAuthenticated { get; }

Property Value

AuthenticationResult

Authenticated

Gets a successful authentication result with a default human-readable message.

public static AuthenticationResult Authenticated { get; }

Property Value

AuthenticationResult

Examples

var result = AuthenticationResult.Authenticated;
if (result.IsAuthenticated)
{
    // Continue login flow.
}

Remarks

Each access creates a new record instance instead of returning a cached object.

Use this value for successful authentication branches that should compare by record value semantics (for example, checks against or other predefined outcomes).

See Also

AuthenticationResult.AlreadyAuthenticated, AuthenticationResult.NoResult

IsAuthenticated

public bool IsAuthenticated { get; init; }

Property Value

bool

Message

public string? Message { get; init; }

Property Value

string?

NoResult

Gets a sentinel authentication result that indicates no final outcome has been produced yet.

public static AuthenticationResult NoResult { get; }

Property Value

AuthenticationResult

Examples

if (result == AuthenticationResult.NoResult)
    continue;

Remarks

This value is used as a control signal while processing server login packets: handlers return it to continue waiting for more packets.

Equality checks against are value-based because is a record, even though each access creates a new instance.

See Also

AuthenticationResult.Authenticated

NotAuthenticatedPlayer

public static AuthenticationResult NotAuthenticatedPlayer { get; }

Property Value

AuthenticationResult

NotAuthenticatedServer

public static AuthenticationResult NotAuthenticatedServer { get; }

Property Value

AuthenticationResult