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:
ORelio 2015-04-22 18:56:43 +02:00
parent 57c66c82d7
commit 72498a6756

View file

@ -167,7 +167,10 @@ namespace MinecraftClient
{
Console.WriteLine("Retrieving Server Info...");
if (!ProtocolHandler.GetServerInfo(Settings.ServerIP, Settings.ServerPort, ref protocolversion))
{
HandleFailure("Failed to ping this IP.", true, ChatBots.AutoRelog.DisconnectReason.ConnectionLost);
return;
}
}
if (protocolversion != 0)
@ -210,7 +213,6 @@ namespace MinecraftClient
+ '\n' + "mozroots --import --ask-remove");
return;
}
while (Console.KeyAvailable) { Console.ReadKey(false); }
HandleFailure(failureMessage, false, ChatBot.DisconnectReason.LoginRejected);
}
}
@ -258,6 +260,8 @@ namespace MinecraftClient
if (!String.IsNullOrEmpty(errorMessage))
{
ConsoleIO.Reset();
while (Console.KeyAvailable)
Console.ReadKey(true);
Console.WriteLine(errorMessage);
if (disconnectReason.HasValue)