diff --git a/Torch.API/ITorchBase.cs b/Torch.API/ITorchBase.cs index b8b2e68..779d004 100644 --- a/Torch.API/ITorchBase.cs +++ b/Torch.API/ITorchBase.cs @@ -154,6 +154,8 @@ namespace Torch.API /// Raised when the server's Init() method has completed. /// event Action Initialized; + + TimeSpan ElapsedPlayTime { get; set; } } /// diff --git a/Torch/Commands/TorchCommands.cs b/Torch/Commands/TorchCommands.cs index 26d676e..30d1a6c 100644 --- a/Torch/Commands/TorchCommands.cs +++ b/Torch/Commands/TorchCommands.cs @@ -290,5 +290,11 @@ namespace Torch.Commands } }, this, TaskContinuationOptions.RunContinuationsAsynchronously); } + + [Command("uptime", "Check how long the server has been online.")] + public void Uptime() + { + Context.Respond(((ITorchServer)Context.Torch).ElapsedPlayTime.ToString()); + } } }