public Form1() { InitializeComponent(); StarterFunctions.InitDefaultFolders(); co = StarterFunctions.getClientOptions(); fo = StarterFunctions.getFavoritesOptions(); foreach (FavoritesOptions.cFavorite fav in fo.Favorites) { addFavoriteToFavList(fav); StatusMessage sm = new StatusMessage(fav.ip, (ushort)fav.port); sm.start(); statusMessageList.Add(sm); } tB_Nickname.Text = co.name; tB_IP.Text = co.ip; tB_Port.Text = co.port + ""; tB_Password.Text = co.password; textBox5.Text = co.fps + ""; checkBox2.Checked = co.startWindowed; if (co.loglevel >= 0) { zLogLevel.Value = co.loglevel; } this.timer1.Start(); }
public void start() { timer1.Stop(); try { StarterFunctions.StartGothic(co, nickname, ip, port, serverpassword, logLevel, maxFPS, startWindowed); } catch (Exception ex) { MessageBox.Show("An Error occurred while starting GUC: " + ex.ToString()); } this.Close(); }
private void bFavAdd_Click(object sender, EventArgs e) { String ip = tB_IP.Text.Trim(); ushort port = getPort(); if (StarterFunctions.ContainsFavorite(fo, ip, port)) { return; } FavoritesOptions.cFavorite fav = StarterFunctions.addFavorite(fo, ip, port); addFavoriteToFavList(fav); StatusMessage sm = new StatusMessage(fav.ip, (ushort)fav.port); sm.start(); statusMessageList.Add(sm); }
private void bFavRemove_Click(object sender, EventArgs e) { String ip = tB_IP.Text.Trim(); ushort port = getPort(); if (!StarterFunctions.ContainsFavorite(fo, ip, port)) { return; } StarterFunctions.removeFavorite(fo, ip, port); foreach (DataGridViewRow row in DGV_Fav.Rows) { bool t1 = ip.Equals(row.Cells["fav_serverip"].Value); bool t2 = port == Convert.ToUInt16(row.Cells["fav_serverport"].Value); if (ip.Equals(row.Cells["fav_serverip"].Value) && port == (ushort)Convert.ToUInt16(row.Cells["fav_serverport"].Value)) { DGV_Fav.Rows.Remove(row); break; } } }