Class AuthenticationResult
Namespace: Void.Proxy.Api.Events.Authentication
Assembly: Void.Proxy.Api.dll
Describes the outcome of an authentication attempt.
public record AuthenticationResult : IEquatable<AuthenticationResult>Inheritance
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?)
Describes the outcome of an authentication attempt.
public AuthenticationResult(bool IsAuthenticated, string? Message = null)Parameters
IsAuthenticated bool
true when authentication succeeded; otherwise, false.
Message string?
Optional human-readable context for the outcome.
Properties
AlreadyAuthenticated
Gets a successful result indicating that the connection was authenticated before the current attempt.
public static AuthenticationResult AlreadyAuthenticated { get; }Property Value
Authenticated
Gets a successful authentication result with a default human-readable message.
public static AuthenticationResult Authenticated { get; }Property Value
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
See Also
AuthenticationResult.AlreadyAuthenticated, AuthenticationResult.NoResult
IsAuthenticated
true when authentication succeeded; otherwise, false.
public bool IsAuthenticated { get; init; }Property Value
Message
Optional human-readable context for the outcome.
public string? Message { get; init; }Property Value
NoResult
Gets a sentinel authentication result that indicates no final outcome has been produced yet.
public static AuthenticationResult NoResult { get; }Property Value
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
See Also
AuthenticationResult.Authenticated
NotAuthenticatedPlayer
Gets a failed result attributed to player authentication.
public static AuthenticationResult NotAuthenticatedPlayer { get; }Property Value
NotAuthenticatedServer
Gets a failed result attributed to destination-server authentication.
public static AuthenticationResult NotAuthenticatedServer { get; }