Class PlayitConnection
- Namespace
- McServerLauncher.Views
- Assembly
- McServerLauncher.dll
Shared "connect your Playit account" flow, used both from the per-server tunnel actions and from the Settings dialog. Encapsulates the setup-code dialog, persisting the resulting agent secret (encrypted) and wiring PlayitApiService, so the user never touches keys or files.
public static class PlayitConnection
- Inheritance
-
PlayitConnection
- Inherited Members
Methods
ConnectAsync(Window, AppSettings, AppSettingsService)
Shows the setup-code dialog, stores the result (encrypted) and wires it. Returns the credential, or null if cancelled.
public static Task<string?> ConnectAsync(Window owner, AppSettings settings, AppSettingsService service)
Parameters
ownerWindowsettingsAppSettingsserviceAppSettingsService
Returns
Credential(AppSettings)
The stored credential (per-user agent key, or a legacy write key), or null if none.
public static string? Credential(AppSettings s)
Parameters
Returns
Disconnect(AppSettings, AppSettingsService)
Clears the stored Playit connection (agent key + any legacy key) and stops the agent.
public static void Disconnect(AppSettings settings, AppSettingsService service)
Parameters
settingsAppSettingsserviceAppSettingsService
EnsureAsync(Window, AppSettings, AppSettingsService)
Returns the stored credential if already connected; otherwise runs the connect flow. Returns null if the user cancels.
public static Task<string?> EnsureAsync(Window owner, AppSettings settings, AppSettingsService service)
Parameters
ownerWindowsettingsAppSettingsserviceAppSettingsService
Returns
IsConnected(AppSettings)
True if the user has connected their Playit account (or has a legacy key).
public static bool IsConnected(AppSettings s)