private void ViewGame(DataGridViewRow row) { if (row.Cells[9].Value.ToString() == "In progress") { if (Convert.ToInt32(row.Cells[3].Value) == Ap.CurrentUserID || Convert.ToInt32(row.Cells[6].Value) == Ap.CurrentUserID) { return; } } if (row.Cells[0].Value != null && !String.IsNullOrEmpty(row.Cells[0].Value.ToString()) && (Ap.CurrentUser.UserStatusIDE == UserStatusE.Blank || Ap.CurrentUser.UserStatusIDE == UserStatusE.Engine || Ap.CurrentUser.UserStatusIDE == UserStatusE.Centaur)) { int GameID = UData.ToInt32(row.Cells[0].Value); SocketClient.AddAudience(GameID); InfinityChess.WinForms.MainOnline.ShowMainOnline(GameID); } }
bool OpenBestBiltzGame() { bool isGameRunning = false; DataSet dsPlayer = SocketClient.HighestRankingPlayerGame(); if (dsPlayer.Tables.Count > 0) { if (dsPlayer.Tables[0].Rows[0]["GameID"] != System.DBNull.Value) { int GameID = UData.ToInt32(dsPlayer.Tables[0].Rows[0]["GameID"]); SocketClient.AddAudience(GameID); MainOnline.ShowMainOnline(GameID); isGameRunning = true; } } return(isGameRunning); }
private void ViewGame(DataGridViewRow row) { //if (Ap.IsGameInProgress) //{ // return; //} if (filterTable.Rows.Count == 0) { return; } TournamentMatch tm = null; DataRow dr = filterTable.Rows[row.Index]; tm = new TournamentMatch(Ap.Cxt, dr); if (tm.WhiteUserID == Ap.CurrentUserID || tm.BlackUserID == Ap.CurrentUserID) { if (tm.TournamentMatchStatusE == TournamentMatchStatusE.InProgress) { return; } } int gameID = SocketClient.GetGameIDByTournamentMatchID(this.SelectedID); if (gameID <= 0) { MessageForm.Show(this.ParentForm, MsgE.InfoGameNotFoundForTournamentMatch); } else { if (Ap.CurrentUser.UserStatusIDE == UserStatusE.Blank || Ap.CurrentUser.UserStatusIDE == UserStatusE.Engine || Ap.CurrentUser.UserStatusIDE == UserStatusE.Centaur) { SocketClient.AddAudience(gameID); InfinityChess.WinForms.MainOnline.ShowMainOnline(gameID); } } }