Table of Contents

Class IdleHost

Namespace
McServerLauncher.ViewModels
Assembly
McServerLauncher.dll

What IdleShutdownController needs to know about, and to be able to do to, its server.

public sealed record IdleHost : IEquatable<IdleHost>
Inheritance
IdleHost
Implements
Inherited Members

Constructors

IdleHost(Func<int>, Func<bool>, Func<int>, Func<DateTime?>, Action<string?>, Action<int>, Func<Task>, Action<string>)

What IdleShutdownController needs to know about, and to be able to do to, its server.

public IdleHost(Func<int> Minutes, Func<bool> IsRunning, Func<int> PlayerCount, Func<DateTime?> WokeAtUtc, Action<string?> ShowCountdown, Action<int> AnnounceStop, Func<Task> StopAsync, Action<string> ReportError)

Parameters

Minutes Func<int>

The configured idle limit; 0 switches the feature off.

IsRunning Func<bool>

Whether the server is up.

PlayerCount Func<int>

How many players are connected.

WokeAtUtc Func<DateTime?>

When the server was last woken by a knock, if ever.

ShowCountdown Action<string>

Puts the countdown text on screen, or null to take it away.

AnnounceStop Action<int>

Tells the user the server is being stopped for being empty.

StopAsync Func<Task>

Stops the server the normal way.

ReportError Action<string>

Says a stop failed.

Properties

AnnounceStop

Tells the user the server is being stopped for being empty.

public Action<int> AnnounceStop { get; init; }

Property Value

Action<int>

IsRunning

Whether the server is up.

public Func<bool> IsRunning { get; init; }

Property Value

Func<bool>

Minutes

The configured idle limit; 0 switches the feature off.

public Func<int> Minutes { get; init; }

Property Value

Func<int>

PlayerCount

How many players are connected.

public Func<int> PlayerCount { get; init; }

Property Value

Func<int>

ReportError

Says a stop failed.

public Action<string> ReportError { get; init; }

Property Value

Action<string>

ShowCountdown

Puts the countdown text on screen, or null to take it away.

public Action<string?> ShowCountdown { get; init; }

Property Value

Action<string>

StopAsync

Stops the server the normal way.

public Func<Task> StopAsync { get; init; }

Property Value

Func<Task>

WokeAtUtc

When the server was last woken by a knock, if ever.

public Func<DateTime?> WokeAtUtc { get; init; }

Property Value

Func<DateTime?>