private void server_SelectedIndexChanged(object sender, EventArgs e) { worlds.Items.Clear(); string countryCode = server.Text.Split('-')[1].Replace(" ", ""); try { string[] serversHTML = client.DownloadString("https://" + countryCode + ".ikariam.gameforge.com/").Replace(" ", "").Replace("\n", "").Replace("\r", "").Split(new string[] { "><" }, StringSplitOptions.None); for (int i = 0; i < serversHTML.Length; i++) { MatchCollection servers = Regex.Matches(serversHTML[i], "value=\"(.*?)-" + countryCode + "\\.ikariam\\.gameforge\\.com\".*>(.*?)</option"); string build = string.Empty; foreach (Match match in servers) { GroupCollection groups = match.Groups; if (groups.Count >= 2) { if (!worlds.Items.Contains(string.Format("{1} - {0}", groups[1].Value, groups[2].Value))) { worlds.Items.Add(string.Format("{1} - {0}", groups[1].Value, groups[2].Value)); if (groups[1].Value.Equals(world)) { worlds.SelectedIndex = worlds.Items.Count - 1; } } } } } if (worlds.Items.Count == 0) { MessageBox.Show(lang.Get("Misc", "InvalidServerCode"), lang.Get("Misc", "Error")); } } catch (WebException ee) { MessageBox.Show(ee.ToString()); } }
private string uniqueAddress = string.Format("{0}|{1}|{2}|{3}", GetCPUInfo(), GetVolumeSerial(), GetMotherBoardSerial(), IsOnVirtualMachine().ToString()); // Computer unique ID public Form1() { InitializeComponent(); lang = Languages.Instance; settings = Settings.Instance; #region Translate login.Text = lang.Get("Launcher", "Login"); button2.Text = lang.Get("Launcher", "Login"); register.Text = lang.Get("Launcher", "Register"); label5.Text = lang.Get("Misc", "UA"); label12.Text = lang.Get("Misc", "UA"); label13.Text = lang.Get("Launcher", "Invite") + " ?"; label7.Text = lang.Get("Misc", "Proxy"); label11.Text = lang.Get("Misc", "Proxy"); label3.Text = lang.Get("Misc", "Server"); label4.Text = lang.Get("Misc", "Country"); label2.Text = lang.Get("Misc", "Password"); label9.Text = lang.Get("Misc", "Password"); label10.Text = lang.Get("Misc", "EMail"); label1.Text = lang.Get("Misc", "Username"); label8.Text = lang.Get("Misc", "Username"); label14.Text = lang.Get("Launcher", "HowManyUsers"); tabPage1.Text = lang.Get("Launcher", "Login"); tabPage2.Text = lang.Get("Launcher", "Register"); tabPage3.Text = lang.Get("Launcher", "MassivePiracy"); tabPage4.Text = lang.Get("Launcher", "News"); autoActive.Text = lang.Get("Launcher", "ActiveMail"); button1.Text = lang.Get("Misc", "Add"); SelectFile.Text = lang.Get("Launcher", "Import"); ExportUsers.Text = lang.Get("Launcher", "Export"); fileToolStripMenuItem.Text = lang.Get("Misc", "File"); languageToolStripMenuItem.Text = lang.Get("Misc", "Language"); Text = "Ikariam+ - " + lang.Get("Launcher", "Name"); licenseToolStripMenuItem.Text = lang.Get("Misc", "License"); sendLogToolStripMenuItem.Text = lang.Get("Launcher", "SendLog"); accessTokenToolStripMenuItem.Text = lang.Get("Launcher", "SetAccessToken"); getAccessTokenToolStripMenuItem.Text = lang.Get("Launcher", "GetAccessToken"); helpToolStripMenuItem.Text = lang.Get("WebView", "Help"); eMailToolStripMenuItem.Text = lang.Get("Misc", "EMail"); #endregion finishedUI = false; countryCode = ""; serverCode = ""; passwords = new List <string>(); client = new WebClient(); client.Encoding = Encoding.UTF8; client.Headers.Add("user-agent", "Mozilla/5.0 (Windows NT 10.0; WOW64; rv:49.0) Gecko/20100101 Firefox/49.0"); userName.Text = Settings.Instance.Get("UserName", ""); password.Text = Settings.Instance.Get("Password", ""); apiKey.Text = Settings.Instance.Get("CaptchaUsername", ""); apiSource.Text = Settings.Instance.Get("CaptchaPassword", ""); news.Url = new Uri(SERVER2 + "news.php"); ToolTip infoToolTip = new ToolTip(); infoToolTip.ToolTipIcon = ToolTipIcon.Info; infoToolTip.IsBalloon = true; infoToolTip.ShowAlways = true; infoToolTip.UseAnimation = true; infoToolTip.ToolTipTitle = lang.Get("Misc", "Info"); infoToolTip.SetToolTip(label13, lang.Get("Launcher", "RegisterInvite")); string[] fileEntries = Directory.GetFiles(Languages.LANGUAGES_LOCATION); foreach (string fileName in fileEntries) { ToolStripMenuItem langauge = new ToolStripMenuItem(fileName.Replace(".ini", "").Replace(Languages.LANGUAGES_LOCATION, "")); langauge.Click += ChangeLanguage; languageToolStripMenuItem.DropDownItems.Add(langauge); } ToolStripMenuItem addLangauge = new ToolStripMenuItem(lang.Get("Misc", "Add")); addLangauge.Click += AddLanguage; languageToolStripMenuItem.DropDownItems.Add(addLangauge); try { string countriesHTML = client.DownloadString("https://us.ikariam.gameforge.com/"); MatchCollection countries = Regex.Matches(countriesHTML, "<li.*><a href=\"//(.+?)\\.ikariam\\.gameforge\\.com/\\?kid=.*\" target=\"_top\" rel=\"nofollow\" class=\".*\">(.+?)</a></li>"); string build = string.Empty; foreach (Match match in countries) { GroupCollection groups = match.Groups; if (groups.Count >= 2) { country.Items.Add(string.Format("{1} - {0}", groups[1].Value, groups[2].Value)); } } } catch (WebException e) { try { string countriesHTML = client.DownloadString("https://en.ikariam.gameforge.com/"); MatchCollection countries = Regex.Matches(countriesHTML, "<li.*><a href=\"//(.+?)\\.ikariam\\.gameforge\\.com/\\?kid=.*\" target=\"_top\" rel=\"nofollow\" class=\".*\">(.+?)</a></li>"); string build = string.Empty; foreach (Match match in countries) { GroupCollection groups = match.Groups; if (groups.Count >= 2) { country.Items.Add(string.Format("{1} - {0}", groups[1].Value, groups[2].Value)); } } } catch (WebException ex) { MessageBox.Show(ex.ToString()); } } int index = 0; index = (Settings.Instance.Get("CaptchaProvider", "Manual").Equals("DeCaptcher") ? 1 : index); index = (Settings.Instance.Get("CaptchaProvider", "Manual").Equals("DeathByCaptcha") ? 2 : index); index = (Settings.Instance.Get("CaptchaProvider", "Manual").Equals("Manual") ? 3 : index); captcha.SelectedIndex = index; SetText(); if (Settings.Instance.Get("UserAgent", "").Trim('\r', '\n', ' ').Equals("")) { ua.Text = "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0"; newUA.Text = ua.Text = "Mozilla/5.0 (X11; Linux x86_64; rv:10.0) Gecko/20100101 Firefox/10.0"; } else { ua.Text = Settings.Instance.Get("UserAgent", "").Trim('\r', '\n', ' '); newUA.Text = Settings.Instance.Get("UserAgent", "").Trim('\r', '\n', ' '); } if (Settings.Instance.Get("EnableProxy", "false").Equals("true")) { proxy.Text = Settings.Instance.Get("ProxyAddress", ""); newProxy.Text = Settings.Instance.Get("ProxyAddress", ""); if (proxy.Text.Equals(TOR)) { torr.Checked = true; newTor.Checked = true; proxy.Enabled = !torr.Checked; newProxy.Enabled = !newTor.Checked; } } else { proxy.Text = ""; newProxy.Text = ""; } for (int i = 0; i < country.Items.Count; i++) { if (country.Items[i].ToString() != "< Custom Country >") { if (country.Items[i].ToString().Split('-')[1].Replace(" ", "").Equals(Settings.Instance.Get("Server", "us"))) { countryCode = country.Items[i].ToString().Split('-')[1].Replace(" ", ""); country.SelectedIndex = i; break; } } else { countryCode = Settings.Instance.Get("ServerGame", "us"); country.SelectedIndex = country.Items.Count - 1; } } for (int i = 0; i < server.Items.Count; i++) { if (server.Items[i].ToString() != "< Custom Server >") { if (server.Items[i].ToString().Split('-')[1].Replace(" ", "").Equals(Settings.Instance.Get("ServerGame", "s1-us").Split('-')[0])) { serverCode = server.Items[i].ToString().Split('-')[1].Replace(" ", ""); server.SelectedIndex = i; break; } } else { //serverCode = config.DocumentElement.SelectSingleNode("/Bot/Server").InnerText.Split('-')[0]; server.SelectedIndex = country.Items.Count - 1; } } users.Scrollable = true; users.View = View.Details; users.Columns.Add(lang.Get("Misc", "Username"), 100); users.Columns.Add(lang.Get("Misc", "Password"), 100); users.Columns.Add(lang.Get("Misc", "Server"), 100); users.Columns.Add(lang.Get("Piracy", "Mission"), 100); users.Columns.Add(lang.Get("Misc", "UA"), 100); users.Columns.Add(lang.Get("Misc", "Proxy"), 100); users.Columns.Add(lang.Get("Piracy", "AutoConvertToCrew"), 100); users.Columns.Add(lang.Get("Piracy", "StartManufactur"), 100); users.Columns.Add(lang.Get("Piracy", "EndManufactur"), 100); users.Columns.Add(lang.Get("Misc", "Type"), 100); if (!File.Exists("massiveUsers.users")) { File.WriteAllText("massiveUsers.users", "", Encoding.UTF8); } RereadUsers(); finishedUI = true; }
private void SetText() { bool temp = true; if (captcha.SelectedIndex == 1) { //De-Captcher label6.Text = lang.Get("Piracy", "DecaptcherUserName"); captchaPwd.Text = lang.Get("Piracy", "DecaptcherPassword"); } else if (captcha.SelectedIndex == 0) { //KW label6.Text = lang.Get("Piracy", "KWAPIKey"); captchaPwd.Text = lang.Get("Piracy", "KWAPISource"); } else if (captcha.SelectedIndex == 2) { //Death By Captcha label6.Text = lang.Get("Piracy", "DeathByCaptchaUserName"); captchaPwd.Text = lang.Get("Piracy", "DeathByCaptchaPassword"); } else { //Manual label6.Text = lang.Get("Piracy", "ManualSolve"); captchaPwd.Text = lang.Get("Piracy", "ManualSolve"); temp = false; } apiKey.Enabled = temp; apiSource.Enabled = temp; }
public User(bool showAll, int idUser, string userName, string password, string server, int missionSelect, string UA, string proxy, bool autoConvert, string startDateManufacture, string endDateManufacture, bool isManufacture) { InitializeComponent(); lang = Languages.Instance; #region Translate label5.Text = lang.Get("Misc", "UA"); label7.Text = lang.Get("Piracy", "AutoConvertToCrew"); this.autoConvert.Text = lang.Get("Piracy", "AutoConvertToCrew"); label3.Text = lang.Get("Misc", "Server"); label4.Text = lang.Get("Piracy", "Mission"); label2.Text = lang.Get("Misc", "Password"); label9.Text = lang.Get("Piracy", "EndManufactur"); label1.Text = lang.Get("Misc", "Username"); label8.Text = lang.Get("Piracy", "StartManufactur"); label6.Text = lang.Get("Misc", "Proxy"); Text = lang.Get("Piracy", "EditUser"); cancel.Text = lang.Get("Misc", "Cancel"); save.Text = lang.Get("Misc", "Save"); duplicate.Text = lang.Get("Misc", "Duplicate"); delete.Text = lang.Get("Misc", "DeleteUser"); manufactureOption.Text = lang.Get("Piracy", "Manufacture"); raiderOption.Text = lang.Get("Piracy", "Raider"); #endregion this.idUser = idUser; this.userName.Text = userName; this.password.Text = password; this.missionSelect.SelectedIndex = missionSelect; this.UA.Text = UA; this.proxy.Text = proxy; this.autoConvert.Checked = autoConvert; this.startDateManufacture.Value = DateTime.Parse(startDateManufacture); this.startDateManufacture.Format = DateTimePickerFormat.Time; this.startDateManufacture.ShowUpDown = true; this.startDateManufacture.CustomFormat = Form1.DATE_TIME_FORMAT; this.endDateManufacture.Value = DateTime.Parse(endDateManufacture); this.endDateManufacture.Format = DateTimePickerFormat.Time; this.endDateManufacture.CustomFormat = Form1.DATE_TIME_FORMAT; this.endDateManufacture.ShowUpDown = true; manufactureOption.Checked = isManufacture; raiderOption.Checked = !isManufacture; client = new WebClient(); if (!showAll) { duplicate.Enabled = false; delete.Enabled = false; } tor.Checked = proxy.Equals(Form1.TOR); world = ""; if (server.Split('-').Length > 0) { world = server.Split('-')[0]; } client.Encoding = Encoding.UTF8; try { string countriesHTML = client.DownloadString("https://us.ikariam.gameforge.com/"); MatchCollection countries = Regex.Matches(countriesHTML, "<li.*><a href=\"//(.+?)\\.ikariam\\.gameforge\\.com/\\?kid=.*\" target=\"_top\" rel=\"nofollow\" class=\".*\">(.+?)</a></li>"); string build = string.Empty; foreach (Match match in countries) { GroupCollection groups = match.Groups; if (groups.Count >= 2) { this.server.Items.Add(string.Format("{1} - {0}", groups[1].Value, groups[2].Value)); if (server.Split('-').Length > 0 && !server.Equals(string.Empty) && groups[1].Value.Equals(server.Split('-')[1])) { this.server.SelectedIndex = this.server.Items.Count - 1; } } } } catch (WebException e) { MessageBox.Show(e.ToString()); } }