Chuyển tới nội dung chính

ProjectVAuthenticationSnapshot class

The sign-in state the Login scene draws: status, the signed-in player and the last error. Read-only; every change arrives as a new instance.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Authentication

public sealed class ProjectVAuthenticationSnapshot

Constructors​

ProjectVAuthenticationSnapshot(ProjectVAuthenticationStatus status, string? userId, string? username, DateTimeOffset? expiresAt, ProjectVAuthenticationError? error)​

Creates a snapshot. Mostly useful for tests and fake presenters.

public ProjectVAuthenticationSnapshot(ProjectVAuthenticationStatus status, string? userId, string? username, DateTimeOffset? expiresAt, ProjectVAuthenticationError? error);

Parameters

NameTypeDescription
statusProjectVAuthenticationStatusThe sign-in status.
userIdstring?The signed-in player's ID, or null when nobody is signed in.
usernamestring?The signed-in player's display name, or null.
expiresAtDateTimeOffset?When the current sign-in expires, or null.
errorProjectVAuthenticationError?Why the last command failed, or null when it worked.

Properties​

PropertyTypeDescription
StatusProjectVAuthenticationStatusWhere the player is in sign-in right now.
UserIdstring?The signed-in player's ID; null unless IsAuthenticated is true.
Usernamestring?The signed-in player's display name; null unless IsAuthenticated is true.
ExpiresAtDateTimeOffset?When the current sign-in expires; null unless IsAuthenticated is true.
ErrorProjectVAuthenticationError?Why the last command failed, or null. Can be set while Status is SignedOut, for example when a saved sign-in was no longer accepted.
IsBusyboolTrue while a command is running; show a spinner and disable the sign-in buttons.
IsAuthenticatedboolTrue when a player is signed in.