IProjectVStartupPresenter interface
The startup contract for the Login scene: start it once the game content is loaded, observe the state, and show the screen that matches each ProjectVStartupStatus.
Namespace: SilverTiger.ProjectV.Unity.Presentation.Startup
public interface IProjectVStartupPresenter
Properties​
| Property | Type | Description |
|---|---|---|
Current | ProjectVStartupSnapshot | The startup state right now; never null. Starts as WaitingForContent. |
Methods​
SubscribeAsync(Action<ProjectVStartupSnapshot> listener)​
Calls listener with the current state right away, then again on every change.
Task<IDisposable> SubscribeAsync(Action<ProjectVStartupSnapshot> listener);
Parameters
| Name | Type | Description |
|---|---|---|
listener | Action<ProjectVStartupSnapshot> | Redraws the startup UI; must not be null. An exception it throws on a later change is ignored. |
Returns
Task<IDisposable>: The subscription; dispose it when the scene closes.
Exceptions
| Exception | When |
|---|---|
ArgumentNullException | listener is null. |
ObjectDisposedException | The presenter was already shut down. |
StartAsync(bool contentReady, CancellationToken cancellationToken)​
Runs startup: checks the server, signs the player back in if possible, then loads the game data. Calling it again while startup runs joins the same run. Call it again after a blocking status to retry.
Task<ProjectVStartupCommandResult> StartAsync(bool contentReady, CancellationToken cancellationToken);
Parameters
| Name | Type | Description |
|---|---|---|
contentReady | bool | True once the game content has loaded. When false and startup is not running, nothing starts and the state stays WaitingForContent. |
cancellationToken | CancellationToken | Stops waiting for the result. Startup itself keeps running, and the state keeps updating. |
Returns
Task<ProjectVStartupCommandResult>: The state where startup stopped. ProjectVStartupSnapshot.IsReady means open the game; ProjectVStartupSnapshot.RequiresLogin means show the sign-in options; ProjectVStartupSnapshot.IsBlocking means show the matching message. When cancellationToken fires first, the status is Failed with the Cancelled category.
Exceptions
| Exception | When |
|---|---|
ObjectDisposedException | The presenter was already shut down. |