From 59e595c81263d714419ae073547c8c7e1405cfbc Mon Sep 17 00:00:00 2001 From: Zidonuke Date: Thu, 29 Dec 2011 15:05:49 -0500 Subject: [PATCH] Hotfix console command handling. --- TShockAPI/TShock.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 0edbc025..307c084d 100644 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -699,11 +699,7 @@ namespace TShockAPI WorldGen.genRand = new Random(); } - if (text.StartsWith("exit")) - { - TShock.Utils.ForceKickAll("Server shutting down!"); - } - else if (text.StartsWith("playing") || text.StartsWith("/playing")) + if (text.StartsWith("playing") || text.StartsWith("/playing")) { int count = 0; foreach (TSPlayer player in Players) @@ -717,19 +713,19 @@ namespace TShockAPI } TSPlayer.Server.SendMessage(string.Format("{0} players connected.", count)); } - else if (text.StartsWith("say ")) - { - Log.Info(string.Format("Server said: {0}", text.Remove(0, 4))); - } else if (text == "autosave") { Main.autoSave = Config.AutoSave = !Config.AutoSave; Log.ConsoleInfo("AutoSave " + (Config.AutoSave ? "Enabled" : "Disabled")); } - else + else if (text.StartsWith("/")) { Commands.HandleCommand(TSPlayer.Server, text); } + else + { + Commands.HandleCommand(TSPlayer.Server, "/" + text); + } e.Handled = true; }