Table of Contents

Class WakeOnDemandController

Namespace
McServerLauncher.ViewModels
Assembly
McServerLauncher.dll

Answers on a stopped server's port and starts the server when somebody tries to join.

public sealed class WakeOnDemandController : IDisposable
Inheritance
WakeOnDemandController
Implements
Inherited Members

Remarks

While the server sleeps, this holds its port, shows the server's own MOTD plus what is going on, and treats a Join as a request to wake it — unless the whitelist says the player may not (WakePolicy). The listener itself is WakeOnDemandListener; this is what connects it to one server.

WokeAtUtc is read by IdleShutdownController, which leaves a freshly woken server alone for WakeGrace.

Constructors

WakeOnDemandController(ServerConfig, WakeHost, ServerPropertiesService, WhitelistService, PlayersService)

public WakeOnDemandController(ServerConfig config, WakeHost host, ServerPropertiesService properties, WhitelistService whitelist, PlayersService players)

Parameters

config ServerConfig
host WakeHost
properties ServerPropertiesService
whitelist WhitelistService
players PlayersService

Properties

WokeAtUtc

When the server was last started by someone trying to join, if ever.

public DateTime? WokeAtUtc { get; }

Property Value

DateTime?

Methods

Dispose()

Same as Stop(); lets the owner treat the controller as disposable.

public void Dispose()

Start()

Answers on the server's port while it is stopped, if the owner asked for it.

public void Start()

Stop()

Frees the port: the server is starting, the world is being swapped, or the app is closing.

public void Stop()