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); }
|
foreach (ChatBot bot in scripts_on_hold) { bots.Add(bot); }
|
||||||
scripts_on_hold.Clear();
|
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();
|
StartTalk();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -173,17 +175,17 @@ namespace MinecraftClient
|
||||||
text = text.Trim();
|
text = text.Trim();
|
||||||
if (text.Length > 0)
|
if (text.Length > 0)
|
||||||
{
|
{
|
||||||
if (text[0] == '/')
|
if (Settings.internalCmdChar == ' ' || text[0] == Settings.internalCmdChar)
|
||||||
{
|
{
|
||||||
string response_msg = "";
|
string response_msg = "";
|
||||||
string command = text.Substring(1);
|
string command = Settings.internalCmdChar == ' ' ? text : text.Substring(1);
|
||||||
if (!performInternalCommand(Settings.expandVars(command), ref response_msg))
|
if (!performInternalCommand(Settings.expandVars(command), ref response_msg) && Settings.internalCmdChar == '/')
|
||||||
{
|
{
|
||||||
SendChatMessage(text);
|
SendChatMessage(text);
|
||||||
}
|
}
|
||||||
else if (response_msg.Length > 0)
|
else if (response_msg.Length > 0)
|
||||||
{
|
{
|
||||||
ConsoleIO.WriteLineFormatted("§8" + response_msg);
|
ConsoleIO.WriteLineFormatted("§8MCC: " + response_msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else SendChatMessage(text);
|
else SendChatMessage(text);
|
||||||
|
|
@ -235,7 +237,7 @@ namespace MinecraftClient
|
||||||
case "set":
|
case "set":
|
||||||
if (command.Length > 3)
|
if (command.Length > 3)
|
||||||
{
|
{
|
||||||
string[] temp = command.Substring(3).Split('=');
|
string[] temp = command.Substring(4).Split('=');
|
||||||
if (temp.Length > 1)
|
if (temp.Length > 1)
|
||||||
{
|
{
|
||||||
if (!Settings.setVar(temp[0], command.Substring(temp[0].Length + 5)))
|
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 string Language = "en_GB";
|
||||||
public static bool chatTimeStamps = false;
|
public static bool chatTimeStamps = false;
|
||||||
public static bool exitOnFailure = false;
|
public static bool exitOnFailure = false;
|
||||||
|
public static char internalCmdChar = '/';
|
||||||
|
|
||||||
//AntiAFK Settings
|
//AntiAFK Settings
|
||||||
public static bool AntiAFK_Enabled = false;
|
public static bool AntiAFK_Enabled = false;
|
||||||
|
|
@ -119,6 +120,7 @@ namespace MinecraftClient
|
||||||
case "scriptscheduler": pMode = ParseMode.ScriptScheduler; break;
|
case "scriptscheduler": pMode = ParseMode.ScriptScheduler; break;
|
||||||
case "remotecontrol": pMode = ParseMode.RemoteControl; break;
|
case "remotecontrol": pMode = ParseMode.RemoteControl; break;
|
||||||
case "proxy": pMode = ParseMode.Proxy; break;
|
case "proxy": pMode = ParseMode.Proxy; break;
|
||||||
|
case "appvars": pMode = ParseMode.AppVars; break;
|
||||||
default: pMode = ParseMode.Default; break;
|
default: pMode = ParseMode.Default; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -147,6 +149,15 @@ namespace MinecraftClient
|
||||||
foreach (string name in argValue.ToLower().Replace(" ", "").Split(','))
|
foreach (string name in argValue.ToLower().Replace(" ", "").Split(','))
|
||||||
Bots_Owners.Add(name);
|
Bots_Owners.Add(name);
|
||||||
break;
|
break;
|
||||||
|
case "internalcmdchar":
|
||||||
|
switch (argValue.ToLower())
|
||||||
|
{
|
||||||
|
case "none": internalCmdChar = ' '; break;
|
||||||
|
case "slash": internalCmdChar = '/'; break;
|
||||||
|
case "backslash": internalCmdChar = '\\'; break;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
@ -270,6 +281,7 @@ namespace MinecraftClient
|
||||||
+ "language=en_GB\r\n"
|
+ "language=en_GB\r\n"
|
||||||
+ "botowners=Player1,Player2,Player3\r\n"
|
+ "botowners=Player1,Player2,Player3\r\n"
|
||||||
+ "consoletitle=%username% - Minecraft Console Client\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"
|
+ "mcversion=auto #use 'auto' or '1.X.X' values\r\n"
|
||||||
+ "exitonfailure=false\r\n"
|
+ "exitonfailure=false\r\n"
|
||||||
+ "timestamps=false\r\n"
|
+ "timestamps=false\r\n"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue