private void changeHostAndStartApp(LaServer srv) { List <HostChanger.hostEntry> entries = new List <HostChanger.hostEntry>(); if (srv.L2auth) { entries.Add(new HostChanger.hostEntry { ip = srv.ServerIp, hostname = "l2authd.lineage2.com", comment = srv.ServerName }); } if (srv.L2testauth) { entries.Add(new HostChanger.hostEntry { ip = srv.ServerIp, hostname = "l2testauthd.lineage2.com", comment = srv.ServerName }); } if (srv.GgServer) { // 216.107.250.194 nprotect.lineage2.com entries.Add(new HostChanger.hostEntry { ip = this.serverList.GgServer, hostname = "nprotect.lineage2.com", comment = "Gameguard Server" }); } HostChanger.GetInstance().AddEntries(entries.ToArray()); this.checkHostEntry(entries[0]); }
private void buttonDeleteSrv_Click(object sender, EventArgs e) { LaServer srv = (LaServer)this.comboBoxServerlist.SelectedItem; if (srv != null) { this.serverList.DelServer(srv); this.selectedIndex = 0; } updateListBox(); updateUi(); }
private void buttonAddSrv_Click(object sender, EventArgs e) { LaServer srv = new LaServer(); srv.ServerName = "ServerName"; srv.ServerIp = "127.0.0.1"; srv.AppToStart = @"C:\Lineage2\system\L2.exe"; srv.L2auth = true; srv.L2testauth = true; srv.GgServer = false; this.serverList.AddServer(srv); this.updateListBox(); this.comboBoxServerlist.SelectedItem = srv; }
private void updateUi() { LaServer srv = (LaServer)this.comboBoxServerlist.SelectedItem; if (srv != null) { this.textBoxServerIp.Text = srv.ServerIp; this.textBoxLaPath.Text = srv.AppToStart; this.checkBoxAuth.Checked = srv.L2auth; this.checkBoxTestAuth.Checked = srv.L2testauth; this.checkBoxGG.Checked = srv.GgServer; if (this.serverList[this.serverList.DefaultServer] != null && this.serverList[this.serverList.DefaultServer].Equals(srv)) { this.checkBoxDefault.Checked = true; } else { this.checkBoxDefault.Checked = false; } } }
private void buttonSet_Click(object sender, EventArgs e) { string temp = this.comboBoxServerlist.Text; if (this.comboBoxServerlist.Items.Count > 0) { this.comboBoxServerlist.SelectedIndex = this.selectedIndex; } LaServer srv = (LaServer)this.comboBoxServerlist.SelectedItem; if (srv != null) { srv.ServerName = temp; srv.ServerIp = this.textBoxServerIp.Text; srv.AppToStart = this.textBoxLaPath.Text; srv.L2auth = this.checkBoxAuth.Checked; srv.L2testauth = this.checkBoxTestAuth.Checked; srv.GgServer = this.checkBoxGG.Checked; this.serverList.DefaultServer = this.serverList.ServerList.IndexOf(srv); } updateListBox(); updateUi(); }
public void DelServer(LaServer server) { this.serverList.Remove(server); }
public void AddServer(LaServer server) { this.serverList.Add(server); }
private void changeHostAndStartApp(LaServer srv) { List<HostChanger.hostEntry> entries = new List<HostChanger.hostEntry>(); if(srv.L2auth) { entries.Add(new HostChanger.hostEntry { ip = srv.ServerIp, hostname = "l2authd.lineage2.com", comment = srv.ServerName }); } if (srv.L2testauth) { entries.Add(new HostChanger.hostEntry { ip = srv.ServerIp, hostname = "l2testauthd.lineage2.com", comment = srv.ServerName }); } if (srv.GgServer) { // 216.107.250.194 nprotect.lineage2.com entries.Add(new HostChanger.hostEntry { ip = this.serverList.GgServer, hostname = "nprotect.lineage2.com", comment = "Gameguard Server" }); } HostChanger.GetInstance().AddEntries(entries.ToArray()); this.checkHostEntry(entries[0]); }
private void serverSubmenu_Click(object sender, EventArgs e) { LaServer srv = (LaServer)((ToolStripDropDownItem)sender).Tag; this.changeHostAndStartApp(srv); }