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)))
|
||||
|
|
|
|||
|
|
@ -41,6 +41,7 @@ namespace MinecraftClient
|
|||
public static string Language = "en_GB";
|
||||
public static bool chatTimeStamps = false;
|
||||
public static bool exitOnFailure = false;
|
||||
public static char internalCmdChar = '/';
|
||||
|
||||
//AntiAFK Settings
|
||||
public static bool AntiAFK_Enabled = false;
|
||||
|
|
@ -119,6 +120,7 @@ namespace MinecraftClient
|
|||
case "scriptscheduler": pMode = ParseMode.ScriptScheduler; break;
|
||||
case "remotecontrol": pMode = ParseMode.RemoteControl; break;
|
||||
case "proxy": pMode = ParseMode.Proxy; break;
|
||||
case "appvars": pMode = ParseMode.AppVars; break;
|
||||
default: pMode = ParseMode.Default; break;
|
||||
}
|
||||
}
|
||||
|
|
@ -147,6 +149,15 @@ namespace MinecraftClient
|
|||
foreach (string name in argValue.ToLower().Replace(" ", "").Split(','))
|
||||
Bots_Owners.Add(name);
|
||||
break;
|
||||
case "internalcmdchar":
|
||||
switch (argValue.ToLower())
|
||||
{
|
||||
case "none": internalCmdChar = ' '; break;
|
||||
case "slash": internalCmdChar = '/'; break;
|
||||
case "backslash": internalCmdChar = '\\'; break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
@ -270,6 +281,7 @@ namespace MinecraftClient
|
|||
+ "language=en_GB\r\n"
|
||||
+ "botowners=Player1,Player2,Player3\r\n"
|
||||
+ "consoletitle=%username% - Minecraft Console Client\r\n"
|
||||
+ "internalcmdchar=slash #use 'none', 'slash' or 'backslash'\r\n"
|
||||
+ "mcversion=auto #use 'auto' or '1.X.X' values\r\n"
|
||||
+ "exitonfailure=false\r\n"
|
||||
+ "timestamps=false\r\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue