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

@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Sandbox.ModAPI;
using VRage.Game.Components;
namespace Torch.Mod
@@ -12,6 +13,7 @@ namespace Torch.Mod
{
public const ulong MOD_ID = 1406994352;
private static bool _init;
public static bool Debug;
public override void UpdateAfterSimulation()
{
@@ -20,6 +22,17 @@ namespace Torch.Mod
_init = true;
ModCommunication.Register();
MyAPIGateway.Utilities.MessageEntered += Utilities_MessageEntered;
}
private void Utilities_MessageEntered(string messageText, ref bool sendToOthers)
{
if (messageText == "@!debug")
{
Debug = !Debug;
MyAPIGateway.Utilities.ShowMessage("Torch", $"Debug: {Debug}");
sendToOthers = false;
}
}
protected override void UnloadData()