public bool CheckLogin(string email, string pass) { string res = Util.generateSession(email, pass,13); if (res == "Bad login") { ErrorWindow error = new ErrorWindow(); error.Error.Content = "Bad Login"; error.Show(); return false; } else if (res == "Servers Down" || res == "" || res == null) { ErrorWindow error = new ErrorWindow(); error.Error.Content = "Minecraft login servers are down"; error.Show(); return false; } else if (res.Split(':').Length != 5) { ErrorWindow error = new ErrorWindow(); error.Error.Content = "A unkown error has occured. It may be that the login servers are down"; error.Show(); return false; } else { return true; } }
public void LaunchMinecraft(string email, string pass, string dir) { string appData = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\"; string res = Util.generateSession(email, pass, 13); ErrorWindow error = new ErrorWindow(); string sesID = res.Split(':')[3]; string user = res.Split(':')[2]; //Login.startMinecraft(true,256,1024,user,sesID,true); //Debug.Write("java -Xincgc -Xmx1024m -cp \"%APPDATA%/.xylotech/.minecraft/bin/minecraft.jar;%APPDATA%/.xylotech/.minecraft/bin/lwjgl.jar;%APPDATA%/.xylotech/.minecraft/bin/lwjgl_util.jar;%APPDATA%/.xylotech/.minecraft/bin/jinput.jar\" -Djava.library.path=\"%APPDATA%/.xylotech/.minecraft/bin/natives\" net.minecraft.client.Minecraft " + user + " " + sesID); Debug.Write(appData + ".xylotech/" + "launch.bat"); Process proc = new Process(); proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; proc.StartInfo.FileName = appData + dir + '/' + "launch.bat"; proc.StartInfo.Arguments = user + " " + sesID + " " + dir; //System.Diagnostics.Process.Start(appData + ".xylotech/" + "launch.bat", user + " " + sesID); proc.Start(); }
public FileStream CreateConfigs(string dir) { using (FileStream config = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" + dir + "/config", FileMode.OpenOrCreate)) { } try { FileStream logindata = new FileStream(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "/" + dir + "/logindata", FileMode.OpenOrCreate); return logindata; } catch { ErrorWindow error = new ErrorWindow(); error.Error.Content = "You Clicked so fast the app crashed, or someone set the logindata file to read only"; error.Error.Width = 480; error.Width = 480; error.Show(); return null; } }
private void Apply_Click(object sender, RoutedEventArgs e) { Uri siteUri = new Uri(ModPack.Text); WebRequest wr = WebRequest.Create(siteUri); try { using (HttpWebResponse response = (HttpWebResponse)wr.GetResponse()) { if (response.StatusCode == HttpStatusCode.OK) { s.ModPack = ModPack.Text; } response.Close(); } } catch { ErrorWindow error = new ErrorWindow(); error.Title = "Error"; error.Error.Content = "The URL could not be found."; error.Show(); } s.LaunchUpdate = Update.IsChecked.Value; s.Password = Password.IsChecked.Value; s.CloseLaunch = CloseLaunch.IsChecked.Value; s.Save(); }