public void InitLauncher() { linkLabel1.Visible = false; this.TopMost = true; bool connection = classNetworking.checkConnection(); try { LoadSettings(); } catch { } this.Text += " " + classVars.appversion; if (classVars.b_debug == true) { dEBUGToolStripMenuItem.Visible = true; } if (connection) { try { updateServerStatus(); lblVersion.Text = classVars.appversion; bool b = classNetworking.updateAvailable(); if (b && classVars.s_update_checks == "true") { MessageBox.Show("we have a new update !"); linkLabel1.Visible = true; } WebClient newsstream = new WebClient(); txtNews.Text = newsstream.DownloadString(classVars.url_news); updatePlayersOnline(); if (!File.Exists(classVars.s_settingspath)) { var myFile = File.Create(classVars.s_settingspath); myFile.Close(); } } catch { MessageBox.Show("No connection to our server!"); Application.Exit(); } if (!File.Exists(classVars.s_settingspath)) { frmSettings set = new frmSettings(); set.Show(); set.BringToFront(); } } }
public void LoadSettings() { if (!File.Exists(classVars.s_settingspath)) { var myFile = File.Create(classVars.s_settingspath); myFile.Close(); MessageBox.Show("Please setup your launcher now!"); frmSettings sf = new frmSettings(); sf.Show(); } else if (File.Exists(classVars.s_settingspath)) { string read; read = File.ReadAllText(classVars.s_settingspath); if (read == null) { MessageBox.Show("Settings not ready yet"); } } var ini = new ini(classVars.s_settingspath); string path = ini.Read("path"); string user = ini.Read("user"); string pass = ini.Read("pass"); string show_pw = ini.Read("show_pw"); string update_checks = ini.Read("update_checks"); string playandclose = ini.Read("playandclose"); string autologin = ini.Read("autologin"); string decoded = Crypto.Atom128.Decode(pass); pass = decoded; string clientversion = ini.Read("clVersion"); string lanmode = ini.Read("lanmode"); string rl = ini.Read("fullrealmlist"); classVars.s_realmlistFullContent = rl; classVars.s_lanmode = lanmode; classVars.cl_version = clientversion; classVars.s_autologin = autologin; classVars.s_path = path; classVars.s_user = user; classVars.s_update_checks = update_checks; classVars.s_show_pw = show_pw; classVars.s_pass = pass; classVars.s_playandclose = playandclose; }
private void settingsToolStripMenuItem_Click(object sender, EventArgs e) { frmSettings set = new frmSettings(); set.Show(); }