Implement kick on restart

This commit is contained in:
Brant Martin
2019-08-16 12:48:16 -04:00
parent a42f5ab273
commit f1616f6532
8 changed files with 138 additions and 37 deletions

View File

@@ -19,6 +19,7 @@ using Torch.API.Managers;
using Torch.API.Session;
using Torch.Commands;
using Torch.Mod;
using Torch.Mod.Messages;
using Torch.Server.Commands;
using Torch.Server.Managers;
using Torch.Utils;
@@ -152,6 +153,11 @@ namespace Torch.Server
/// </summary>
public override void Restart()
{
if (Config.DisconnectOnRestart)
{
ModCommunication.SendMessageToClients(new JoinServerMessage("0.0.0.0:25555"));
}
if (IsRunning)
Save().ContinueWith(DoRestart, this, TaskContinuationOptions.RunContinuationsAsynchronously);
else