Hotfix console command handling.
This commit is contained in:
parent
1247b8760d
commit
59e595c812
1 changed files with 6 additions and 10 deletions
|
|
@ -699,11 +699,7 @@ namespace TShockAPI
|
||||||
WorldGen.genRand = new Random();
|
WorldGen.genRand = new Random();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text.StartsWith("exit"))
|
if (text.StartsWith("playing") || text.StartsWith("/playing"))
|
||||||
{
|
|
||||||
TShock.Utils.ForceKickAll("Server shutting down!");
|
|
||||||
}
|
|
||||||
else if (text.StartsWith("playing") || text.StartsWith("/playing"))
|
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
foreach (TSPlayer player in Players)
|
foreach (TSPlayer player in Players)
|
||||||
|
|
@ -717,19 +713,19 @@ namespace TShockAPI
|
||||||
}
|
}
|
||||||
TSPlayer.Server.SendMessage(string.Format("{0} players connected.", count));
|
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")
|
else if (text == "autosave")
|
||||||
{
|
{
|
||||||
Main.autoSave = Config.AutoSave = !Config.AutoSave;
|
Main.autoSave = Config.AutoSave = !Config.AutoSave;
|
||||||
Log.ConsoleInfo("AutoSave " + (Config.AutoSave ? "Enabled" : "Disabled"));
|
Log.ConsoleInfo("AutoSave " + (Config.AutoSave ? "Enabled" : "Disabled"));
|
||||||
}
|
}
|
||||||
else
|
else if (text.StartsWith("/"))
|
||||||
{
|
{
|
||||||
Commands.HandleCommand(TSPlayer.Server, text);
|
Commands.HandleCommand(TSPlayer.Server, text);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Commands.HandleCommand(TSPlayer.Server, "/" + text);
|
||||||
|
}
|
||||||
e.Handled = true;
|
e.Handled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue