private void LoadMUD(Mud m) { txtHost.Text = m.Host; txtPort.Text = m.Port.ToString(CultureInfo.InvariantCulture); txtDescription.Text = m.Description; txtLoginScript.Text = m.LoginScript; }
private void lstMudNames_SelectedIndexChanged(object sender, EventArgs e) { Mud m = mudList.FindMud(lstMudNames.SelectedItem.ToString()); if (m != null) { LoadMUD(m); } }
/// <summary> /// Connects the specified m. /// </summary> /// <param name="m">M.</param> public void Connect(Mud m) { mud = m; this.Connect(m.Host, m.Port); if (m.LoginScript.Length != 0) { this.SendCommand(m.LoginScript); } }
private void btnRename_Click(object sender, EventArgs e) { if (lstMudNames.SelectedItem != null) { Mud m = mudList.FindMud(lstMudNames.SelectedItem.ToString()); if (m != null) { string name = FrmMudName.ShowForm(); m.Name = name; mudList.Save(); RefreshList(); } } }
private void btnConnect_Click(object sender, EventArgs e) { btnSave_Click(null, null); if (lstMudNames.SelectedItem != null) { Mud m = mudList.FindMud(lstMudNames.SelectedItem.ToString()); if (m != null) { ((FrmMain)this.Owner).Connect(m); } this.Close(); } }
private void btnSave_Click(object sender, EventArgs e) { if (lstMudNames.SelectedItem != null) { Mud m = mudList.FindMud(lstMudNames.SelectedItem.ToString()); if (m != null && txtPort.Text.Length != 0) { m.Host = txtHost.Text; m.Port = int.Parse(txtPort.Text, CultureInfo.InvariantCulture); m.Description = txtDescription.Text; m.LoginScript = txtLoginScript.Text; mudList.Save(); } } }
private void btnDelete_Click(object sender, EventArgs e) { if (lstMudNames.SelectedItem != null) { Mud m = mudList.FindMud(lstMudNames.SelectedItem.ToString()); if (m != null) { mudList.List.Remove(m); mudList.Save(); RefreshList(); LoadMUD(new Mud("")); } } CheckEnabled(); }
/// <summary> /// Connects using the Muds data /// </summary> /// <param name="m">M.</param> public void Connect(Mud m) { TabPage t = new TabPage(m.Name); t.StartFocus = cmbInput; t.ImageIndex = 0; tcMUD.SelectedTab = tcMUD.TabPages.Add(t); Connection c = new Connection(t); c.NewData += new NewDataEventHandler(c_NewData); c.Disconnected += new EventHandler(c_Disconnected); c.Ansi.LinkClicked += new LinkClickedEventHandler(rchANSI_LinkClicked); c.Ansi.ReadOnly = true; conns.Add(t, c); try { c.Connect(m); } catch (SocketException se) { c.Ansi.AppendText("Connection Error: " + se.Message, AnsiEdit.MessageType.Error); } }
/// <summary> /// Loads this instance. /// </summary> public void Load() { XmlTextReader r = null; try { r = new XmlTextReader(File.OpenRead(fileName)); Mud m = null; while (r.Read()) { r.MoveToContent(); if (r.NodeType == XmlNodeType.Element) { if (r.Name == "Name") { r.MoveToContent(); m = new Mud(r.ReadString()); } else if (r.Name == "Host") { r.MoveToContent(); m.Host = r.ReadString(); } else if (r.Name == "Port") { r.MoveToContent(); m.Port = int.Parse(r.ReadString()); } else if (r.Name == "Description") { r.MoveToContent(); m.Description = r.ReadString(); } else if (r.Name == "LoginScript") { r.MoveToContent(); m.LoginScript = r.ReadString(); mudList.Add(m); m = null; } } } } catch (XmlException) { } catch (FileNotFoundException) { //this just means this is the first time //the list has ever been loaded } finally { if(r != null) r.Close(); } //if it's a new file give it //a default entry if(mudList.Count == 0) { Mud m = new Mud("Realms of Exploration"); m.Host = "planetmud.net"; m.Port = 5005; m.Description = @" Realms of Exploration is set in the Forgotten Realms world just after the book trilogy - Return of the Archwizards. We are in the Beta pahse of the MUD. Fine tuning everything as well as adding in more zones. Though we are primarily a RolePlay MUD we offer zones to level in as well. Bsically we hope that if you come for the levels you stay for the RolePlay. The race and class selection is based on AD&D basics with some very minor variations. Drow and Minotaur are allowed races while the core Classes are completely available. I am always open to suggestions. I am also working on a useable/workable 'Prestige Class' system. The webpage is updated as often as I can. The world of Realms of Exploration starts in Shadowdale. The world is open for Exploration. With just over 1000 rooms we are still small but at the same time we have a small but dedicated group of builders expanding it daily. There have been many pieces of code added to the MUD and continue to be added and tweaked. One of the current projects is a Hometown Starting point. Though we have to add new towns to add hometowns. Stop in enjoy the mud talk with the Imms who are on and other players who show up at different times. Keep your eyes open for people and places that might be part of the roleplay."; mudList.Add(m); } }
/// <summary> /// Loads this instance. /// </summary> public void Load() { XmlTextReader r = null; try { r = new XmlTextReader(File.OpenRead(fileName)); Mud m = null; while (r.Read()) { r.MoveToContent(); if (r.NodeType == XmlNodeType.Element) { if (r.Name == "Name") { r.MoveToContent(); m = new Mud(r.ReadString()); } else if (r.Name == "Host") { r.MoveToContent(); m.Host = r.ReadString(); } else if (r.Name == "Port") { r.MoveToContent(); m.Port = int.Parse(r.ReadString()); } else if (r.Name == "Description") { r.MoveToContent(); m.Description = r.ReadString(); } else if (r.Name == "LoginScript") { r.MoveToContent(); m.LoginScript = r.ReadString(); mudList.Add(m); m = null; } } } } catch (XmlException) { } catch (FileNotFoundException) { //this just means this is the first time //the list has ever been loaded } finally { if (r != null) { r.Close(); } } //if it's a new file give it //a default entry if (mudList.Count == 0) { Mud m = new Mud("Realms of Exploration"); m.Host = "planetmud.net"; m.Port = 5005; m.Description = @" Realms of Exploration is set in the Forgotten Realms world just after the book trilogy - Return of the Archwizards. We are in the Beta pahse of the MUD. Fine tuning everything as well as adding in more zones. Though we are primarily a RolePlay MUD we offer zones to level in as well. Bsically we hope that if you come for the levels you stay for the RolePlay. The race and class selection is based on AD&D basics with some very minor variations. Drow and Minotaur are allowed races while the core Classes are completely available. I am always open to suggestions. I am also working on a useable/workable 'Prestige Class' system. The webpage is updated as often as I can. The world of Realms of Exploration starts in Shadowdale. The world is open for Exploration. With just over 1000 rooms we are still small but at the same time we have a small but dedicated group of builders expanding it daily. There have been many pieces of code added to the MUD and continue to be added and tweaked. One of the current projects is a Hometown Starting point. Though we have to add new towns to add hometowns. Stop in enjoy the mud talk with the Imms who are on and other players who show up at different times. Keep your eyes open for people and places that might be part of the roleplay."; mudList.Add(m); } }