Table of Contents

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 sealed class PlayitManager : IDisposable
Inheritance
PlayitManager
Implements
Inherited Members

Properties

IsInstalled

True if the Playit agent is installed on the system.

public bool IsInstalled { get; }

Property Value

bool

IsRunning

public bool IsRunning { get; }

Property Value

bool

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

PlayitManager

State

public PlayitState State { get; }

Property Value

PlayitState

Methods

Dispose()

Lets go of the probe gate. The shared manager lives as long as the app, so nothing calls this.

public void Dispose()

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

force bool

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

force bool

Returns

Task

StartServiceAsync()

Starts the Playit agent (Windows service / Linux systemd unit). May require privileges.

public Task StartServiceAsync()

Returns

Task

StopServiceAsync()

Stops the Playit agent (Windows service / Linux systemd unit). May require privileges.

public Task StopServiceAsync()

Returns

Task

Events

StateChanged

public event Action<PlayitState>? StateChanged

Event Type

Action<PlayitState>