mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add 'exit on failure' setting
- Automatically close on connection lost or other failure - Feature suggested by TorchRJ_ - Also, forgot to mention in 'App refactoring almost done' : - Issue depending on username and/or server should be fixed
This commit is contained in:
parent
a2ce7ab2c4
commit
c8332eb845
3 changed files with 12 additions and 6 deletions
|
|
@ -113,8 +113,7 @@ namespace MinecraftClient
|
|||
client = ProxyHandler.newTcpClient(host, port);
|
||||
client.ReceiveBufferSize = 1024 * 1024;
|
||||
handler = Protocol.ProtocolHandler.getProtocolHandler(client, protocolversion, this);
|
||||
Console.WriteLine("Version is supported.");
|
||||
Console.WriteLine("Logging in...");
|
||||
Console.WriteLine("Version is supported.\nLogging in...");
|
||||
|
||||
if (handler.Login())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -218,11 +218,15 @@ namespace MinecraftClient
|
|||
|
||||
public static bool ReadLineReconnect()
|
||||
{
|
||||
string text = Console.ReadLine();
|
||||
if (text == "reco" || text == "reconnect" || text == "/reco" || text == "/reconnect")
|
||||
if (!Settings.exitOnFailure)
|
||||
{
|
||||
Program.Restart();
|
||||
return true;
|
||||
string text = Console.ReadLine();
|
||||
if (text == "reco" || text == "reconnect" || text == "/reco" || text == "/reconnect")
|
||||
{
|
||||
Program.Restart();
|
||||
return true;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
else return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ namespace MinecraftClient
|
|||
public static List<string> Bots_Owners = new List<string>();
|
||||
public static string Language = "en_GB";
|
||||
public static bool chatTimeStamps = false;
|
||||
public static bool exitOnFailure = false;
|
||||
|
||||
//AntiAFK Settings
|
||||
public static bool AntiAFK_Enabled = false;
|
||||
|
|
@ -134,6 +135,7 @@ namespace MinecraftClient
|
|||
case "language": Language = argValue; break;
|
||||
case "consoletitle": ConsoleTitle = argValue; break;
|
||||
case "timestamps": chatTimeStamps = str2bool(argValue); break;
|
||||
case "exitonfailure": exitOnFailure = str2bool(argValue); break;
|
||||
case "botowners":
|
||||
Bots_Owners.Clear();
|
||||
foreach (string name in argValue.ToLower().Replace(" ", "").Split(','))
|
||||
|
|
@ -258,6 +260,7 @@ namespace MinecraftClient
|
|||
+ "language=en_GB\r\n"
|
||||
+ "botowners=Player1,Player2,Player3\r\n"
|
||||
+ "consoletitle=%username% - Minecraft Console Client\r\n"
|
||||
+ "exitonfailure=false\r\n"
|
||||
+ "timestamps=false\r\n"
|
||||
+ "\r\n"
|
||||
+ "[Proxy]\r\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue