Class ServerShutdown
- Namespace
- Unity.Multiplayer.Core
A clean shutdown, requested once from any thread (a SIGTERM or SIGINT handler, the stop admin command, a
quit) and carried out on the game's thread: stop taking players, let the game save, close the session, quit,
with a deadline after which the process quits anyway.
public sealed class ServerShutdown
- Inheritance
-
ServerShutdown
- Inherited Members
Properties
IsRequested
True once Request(string, double) has been called.
public bool IsRequested { get; }
Property Value
Reason
Why the first request came; null before one.
public string Reason { get; }
Property Value
RequestedAt
When the first request came, on the clock passed to Request(string, double).
public double RequestedAt { get; }
Property Value
Methods
IsOverdue(double, double)
True when a shutdown was requested more than graceSeconds before now.
public bool IsOverdue(double now, double graceSeconds)
Parameters
Returns
Request(string, double)
Asks for a shutdown. Only the first call counts; it returns true, later ones false.
public bool Request(string reason, double now)
Parameters
reasonstringWhy, for the log (
SIGTERM,admin stop).nowdoubleThe time on the caller's clock, for IsOverdue(double, double).