Add !uptime command
This commit is contained in:
@@ -154,6 +154,8 @@ namespace Torch.API
|
|||||||
/// Raised when the server's Init() method has completed.
|
/// Raised when the server's Init() method has completed.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
event Action<ITorchServer> Initialized;
|
event Action<ITorchServer> Initialized;
|
||||||
|
|
||||||
|
TimeSpan ElapsedPlayTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@@ -290,5 +290,11 @@ namespace Torch.Commands
|
|||||||
}
|
}
|
||||||
}, this, TaskContinuationOptions.RunContinuationsAsynchronously);
|
}, this, TaskContinuationOptions.RunContinuationsAsynchronously);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Command("uptime", "Check how long the server has been online.")]
|
||||||
|
public void Uptime()
|
||||||
|
{
|
||||||
|
Context.Respond(((ITorchServer)Context.Torch).ElapsedPlayTime.ToString());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user