Add setting for manually choosing MC version

- User can manually provide server version in config file
- Server is not pinged if a minecraft version was manually provided
- If the provided version isn't recognized, ping is re-enabled
This commit is contained in:
ORelio 2014-06-14 16:01:19 +02:00
parent f0b071ddea
commit 8b5ce567a6
5 changed files with 97 additions and 35 deletions

View file

@ -647,10 +647,11 @@ namespace MinecraftClient.Protocol.Handlers
return packet_data;
}
public static bool doPing(string host, int port, ref int protocolversion, ref string version)
public static bool doPing(string host, int port, ref int protocolversion)
{
try
{
string version = "";
TcpClient tcp = ProxyHandler.newTcpClient(host, port);
tcp.ReceiveTimeout = 5000; //MC 1.7.2+ SpigotMC servers won't answer, so we need a reasonable timeout.
byte[] ping = new byte[2] { 0xfe, 0x01 };