mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add different command handling modes
+ Fix [AppVars] INI section not being processed + Fix set var=value command not working properly See http://www.minecraftforum.net/topic/1314800-winmaclinux-minecraft-console-client-179/page__st__500#entry32178614 for details about command handling modes.
This commit is contained in:
parent
c4c5e2efd9
commit
715bc09872
2 changed files with 20 additions and 6 deletions
|
|
@ -124,7 +124,9 @@ namespace MinecraftClient
|
|||
{
|
||||
foreach (ChatBot bot in scripts_on_hold) { bots.Add(bot); }
|
||||
scripts_on_hold.Clear();
|
||||
Console.WriteLine("Server was successfully joined.\nType '/quit' to leave the server.");
|
||||
Console.WriteLine("Server was successfully joined.\nType '"
|
||||
+ (Settings.internalCmdChar == ' ' ? "" : "" + Settings.internalCmdChar)
|
||||
+ "quit' to leave the server.");
|
||||
StartTalk();
|
||||
}
|
||||
}
|
||||
|
|
@ -173,17 +175,17 @@ namespace MinecraftClient
|
|||
text = text.Trim();
|
||||
if (text.Length > 0)
|
||||
{
|
||||
if (text[0] == '/')
|
||||
if (Settings.internalCmdChar == ' ' || text[0] == Settings.internalCmdChar)
|
||||
{
|
||||
string response_msg = "";
|
||||
string command = text.Substring(1);
|
||||
if (!performInternalCommand(Settings.expandVars(command), ref response_msg))
|
||||
string command = Settings.internalCmdChar == ' ' ? text : text.Substring(1);
|
||||
if (!performInternalCommand(Settings.expandVars(command), ref response_msg) && Settings.internalCmdChar == '/')
|
||||
{
|
||||
SendChatMessage(text);
|
||||
}
|
||||
else if (response_msg.Length > 0)
|
||||
{
|
||||
ConsoleIO.WriteLineFormatted("§8" + response_msg);
|
||||
ConsoleIO.WriteLineFormatted("§8MCC: " + response_msg);
|
||||
}
|
||||
}
|
||||
else SendChatMessage(text);
|
||||
|
|
@ -235,7 +237,7 @@ namespace MinecraftClient
|
|||
case "set":
|
||||
if (command.Length > 3)
|
||||
{
|
||||
string[] temp = command.Substring(3).Split('=');
|
||||
string[] temp = command.Substring(4).Split('=');
|
||||
if (temp.Length > 1)
|
||||
{
|
||||
if (!Settings.setVar(temp[0], command.Substring(temp[0].Length + 5)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue