public bool ConnectToMainWoW(string windowTitle) { GameEnabled = false; radarctrl = new RadarControl(); mainwow = new WoWConnection(windowTitle); if (!mainwow.TryToConnect()) { throw new Exception(); } mainPlayer = new WoWPlayer(mainwow.Connection.ReadUInt64((uint)mainwow.Connection.MainModule.BaseAddress + MemoryOffsets.GlobalInfoPlayerGUID)); GameEnabled = true; return true; }
private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { var senderGrid = (DataGridView)sender; if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0) { try { WoWConnection tempWoW = new WoWConnection(senderGrid["col_WinTitle", e.RowIndex].Value.ToString()); tempWoW.TryToConnect(); WoWPlayer.SetWindowTitleForPlayer(ref Game1.allPlayers, tempWoW.GetPlayerGUID(), (senderGrid["col_WinTitle", e.RowIndex].Value.ToString())); } catch (NullReferenceException) { } } }