public Directory(frmZoneList zonelist) { _frmZoneList = zonelist; _frmZoneList._zones.Add(new Zone("[I:League] USL Test Zone", "108.61.133.122", 8026)); _frmZoneList._zones.Add(new Zone("[I:League] USL KR", "108.61.133.122", 8024)); _frmZoneList._zones.Add(new Zone("[I:League] USL Isctos", "108.61.133.122", 7022)); _frmZoneList._zones.Add(new Zone("[I:League] USL EC Apollo", "108.61.133.122", 8124)); _frmZoneList._zones.Add(new Zone("[I: League] USL Apollo Map", "108.61.133.122", 7202)); _frmZoneList._zones.Add(new Zone("[I:Arcade] Zombie Zone", "108.61.133.122", 1012)); _frmZoneList._zones.Add(new Zone("Localhost [port=2626]", "127.0.0.1", 2626)); }
private void PlayButton_Click(object sender, EventArgs e) { //If the server is inactive, dont do anything if (ServerInactive || isDownloading) { return; } if (string.IsNullOrWhiteSpace(UsernameBox.Text)) { MessageBox.Show("Username cannot be blank.", "Infantry Online"); return; } if (string.IsNullOrWhiteSpace(PasswordBox.Text)) { MessageBox.Show("Password cannot be blank.", "Infantry Online"); return; } //Try loading first string pswd = GameSettings.Credentials._password; //Did the text change at all? if (pswdTextChanged == true) { //Since it did, use this instead pswd = Md5.Hash(PasswordBox.Text.Trim()); } switch (RememberPwd.CheckState) { case CheckState.Checked: //Was the text changed? We don't overwrite till neccessary if (pswdTextChanged == true) { GameSettings.Credentials._password = Md5.Hash(PasswordBox.Text.Trim()); } GameSettings.Credentials._passwordLength = PasswordBox.Text.Length.ToString(); GameSettings.Save(); break; case CheckState.Unchecked: GameSettings.Credentials._password = string.Empty; GameSettings.Credentials._passwordLength = string.Empty; GameSettings.Save(); break; } GameSettings.Credentials._username = UsernameBox.Text.Trim(); //Get our ticket id UpdateStatusMsg("Trying Credentials..."); Cursor.Current = Cursors.WaitCursor; pswdTextChanged = false; if (MissingFile("Newtonsoft.Json.dll")) { return; } string[] response = AccountController.LoginServer(UsernameBox.Text.Trim(), pswd); if (response != null) { //Load our zone list window this.Hide(); frmZoneList zonelist = new frmZoneList(response[0]); zonelist.ShowDialog(); this.Close(); } Cursor.Current = Cursors.Default; DisableStatusMsg(); }