/// <summary>
/// Authecate the user to join
/// </summary>
private static bool Auth(string _Username, string _Password)
{
WebClient Client = new WebClient();
string returns;
try
{
Debug("Connecting to minecraft.net...\n");
PostData post = new PostData("http://minecraft.net/game/getversion.jsp");
post.Add("user", _Username);
post.Add("password", _Password);
post.Add("version", "12");
returns = post.GetResult(true);
}
catch { SMPInterface.LastError = "Could not connect to minecraft.net"; return(false); }
SMPInterface.Debug("Authecation: " + returns + "\n");
if (returns != "Bad login" && returns != "Old version" && returns != "Error")
{
string[] Bits = returns.Split(":".ToCharArray());
SessionHash = Bits[1];
CaseUsername = Bits[2];
SessionID = Bits[3];
return(true);
}
else
{
SMPInterface.LastError = returns;
return(false);
}
}