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
MinutesFunc<int>The configured idle limit; 0 switches the feature off.
IsRunningFunc<bool>Whether the server is up.
PlayerCountFunc<int>How many players are connected.
WokeAtUtcFunc<DateTime?>When the server was last woken by a knock, if ever.
ShowCountdownAction<string>Puts the countdown text on screen, or null to take it away.
AnnounceStopAction<int>Tells the user the server is being stopped for being empty.
StopAsyncFunc<Task>Stops the server the normal way.
ReportErrorAction<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
IsRunning
Whether the server is up.
public Func<bool> IsRunning { get; init; }
Property Value
Minutes
The configured idle limit; 0 switches the feature off.
public Func<int> Minutes { get; init; }
Property Value
PlayerCount
How many players are connected.
public Func<int> PlayerCount { get; init; }
Property Value
ReportError
Says a stop failed.
public Action<string> ReportError { get; init; }
Property Value
ShowCountdown
Puts the countdown text on screen, or null to take it away.
public Action<string?> ShowCountdown { get; init; }
Property Value
StopAsync
Stops the server the normal way.
public Func<Task> StopAsync { get; init; }
Property Value
WokeAtUtc
When the server was last woken by a knock, if ever.
public Func<DateTime?> WokeAtUtc { get; init; }