mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-11-07 17:36:07 +00:00
Fix ping failure causing double failure handling
"Failed to ping this IP" also caused "Failed to determine server version" error, calling HandleFailure() twice.
This commit is contained in:
parent
57c66c82d7
commit
72498a6756
1 changed files with 5 additions and 1 deletions
|
|
@ -167,7 +167,10 @@ namespace MinecraftClient
|
||||||
{
|
{
|
||||||
Console.WriteLine("Retrieving Server Info...");
|
Console.WriteLine("Retrieving Server Info...");
|
||||||
if (!ProtocolHandler.GetServerInfo(Settings.ServerIP, Settings.ServerPort, ref protocolversion))
|
if (!ProtocolHandler.GetServerInfo(Settings.ServerIP, Settings.ServerPort, ref protocolversion))
|
||||||
|
{
|
||||||
HandleFailure("Failed to ping this IP.", true, ChatBots.AutoRelog.DisconnectReason.ConnectionLost);
|
HandleFailure("Failed to ping this IP.", true, ChatBots.AutoRelog.DisconnectReason.ConnectionLost);
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (protocolversion != 0)
|
if (protocolversion != 0)
|
||||||
|
|
@ -210,7 +213,6 @@ namespace MinecraftClient
|
||||||
+ '\n' + "mozroots --import --ask-remove");
|
+ '\n' + "mozroots --import --ask-remove");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
while (Console.KeyAvailable) { Console.ReadKey(false); }
|
|
||||||
HandleFailure(failureMessage, false, ChatBot.DisconnectReason.LoginRejected);
|
HandleFailure(failureMessage, false, ChatBot.DisconnectReason.LoginRejected);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -258,6 +260,8 @@ namespace MinecraftClient
|
||||||
if (!String.IsNullOrEmpty(errorMessage))
|
if (!String.IsNullOrEmpty(errorMessage))
|
||||||
{
|
{
|
||||||
ConsoleIO.Reset();
|
ConsoleIO.Reset();
|
||||||
|
while (Console.KeyAvailable)
|
||||||
|
Console.ReadKey(true);
|
||||||
Console.WriteLine(errorMessage);
|
Console.WriteLine(errorMessage);
|
||||||
|
|
||||||
if (disconnectReason.HasValue)
|
if (disconnectReason.HasValue)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue