Class PlayitManager
- Namespace
- McServerLauncher.Services
- Assembly
- McServerLauncher.dll
Playit.gg integration that relies on the background Playit agent already keeping the tunnels up 24/7. The app does not launch its own playit binary: it only queries and, when possible, starts/stops the agent.
- On Windows the agent is a Windows service ("playitd"), managed via ServiceController.
- On Linux it is typically a systemd unit, managed via
systemctl(start/stop may need privileges).
public class PlayitManager
- Inheritance
-
PlayitManager
- Inherited Members
Properties
IsInstalled
True if the Playit agent is installed on the system.
public bool IsInstalled { get; }
Property Value
IsRunning
public bool IsRunning { get; }
Property Value
Shared
Shared instance: the agent is machine-wide state, so every ServerViewModel polls this one instead of creating its own (avoids N status queries per tick with N servers).
public static PlayitManager Shared { get; }
Property Value
State
public PlayitState State { get; }
Property Value
Methods
RefreshState(bool)
Queries the current agent status and updates State. Calls are throttled
(several view models poll the shared instance); pass force to bypass
the throttle, e.g. right after starting/stopping the service.
public void RefreshState(bool force = false)
Parameters
forcebool
RefreshStateAsync(bool)
Same as RefreshState(bool), awaitable — for callers that need the state updated before they continue (starting or stopping the service).
public Task RefreshStateAsync(bool force = false)
Parameters
forcebool
Returns
StartServiceAsync()
Starts the Playit agent (Windows service / Linux systemd unit). May require privileges.
public Task StartServiceAsync()
Returns
StopServiceAsync()
Stops the Playit agent (Windows service / Linux systemd unit). May require privileges.
public Task StopServiceAsync()
Returns
Events
StateChanged
public event Action<PlayitState>? StateChanged