protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); _isRoundOffiallyEndedOccured = true; // count rounds played in case of overtime to detect overtime end if (IsOvertime) { ++RoundCountOvertime; // if the number of rounds played is equals to the double of MR, the OT is over if (MrOvertime * 2 == RoundCountOvertime) { Application.Current.Dispatcher.Invoke(() => Demo.Overtimes.Add(CurrentOvertime)); CreateNewOvertime(); RoundCountOvertime = 0; } } // First OT detection if (Parser.CTScore == 15 && Parser.TScore == 15) { IsOvertime = true; CreateNewOvertime(); } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { // Prevent adding rounds that are between half side during overtime if (IsOvertime && Parser.TScore == _previousScoreT && Parser.CTScore == _previousScoreCT && !IsHalfMatch) { IsMatchStarted = false; return; } // Keep track of the score to avoid "warmup" round that are between half side if (IsOvertime) { _previousScoreCT = Parser.CTScore; _previousScoreT = Parser.TScore; } base.HandleRoundOfficiallyEnd(sender, e); if (!IsMatchStarted) { return; } int score = Demo.ScoreTeam1 + Demo.ScoreTeam2; if (score < 15) { return; } if (score == 15) { IsMatchStarted = false; IsHalfMatch = true; } if (score < 30) { return; } if (score == 30) { IsMatchStarted = false; IsOvertime = true; // Create a new round when the score is 15-15 because round_start isn't raised if (Parser.TScore == 15 && Parser.CTScore == 15) { CreateNewRound(); } // Init the first OT CurrentOvertime = new Overtime() { Number = ++OvertimeCount }; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { if (!IsMatchStarted || IsFreezetime) { return; } CheckForSpecialClutchEnd(); UpdateKillsCount(); UpdatePlayerScore(); Application.Current.Dispatcher.Invoke(delegate { Demo.Rounds.Add(CurrentRound); }); // End of a half if (IsLastRoundHalf) { IsHalfMatch = !IsHalfMatch; IsMatchStarted = false; } // Last round of the match ended, may have OT if (_isLastRoundFinal) { IsMatchStarted = false; IsOvertime = true; // Add the current overtime only if it's not the first if (CurrentOvertime.Number != 0) { Application.Current.Dispatcher.Invoke(delegate { Demo.Overtimes.Add(CurrentOvertime); }); IsHalfMatch = true; } else { // If it's the first OT, teams haven't been swapped IsHalfMatch = false; } // Create new OT CurrentOvertime = new Overtime { Number = ++OvertimeCount }; } if (IsLastRoundHalf) { CheckForSpecialClutchEnd(); IsSwapTeamRequired = true; IsLastRoundHalf = false; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); _isRoundOffiallyEndedOccured = true; if (IsOvertime && IsLastRoundHalf) { IsHalfMatch = true; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); _isRoundOffiallyEndedOccured = true; // Don't stop the match for Faceit demos because there isn't warmup between end of the match and OT if (!_isFaceit && CurrentRound.Number == 30) { IsMatchStarted = false; } }
private void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { if (!myHasMatchStarted) { return; } ProcessNewPlayers(); UpdateKillCounts(); UpdateRounds(); }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); if (!IsMatchStarted || IsFreezetime) { return; } int score = Parser.CTScore + Parser.TScore; if (score < 15) { return; } // Detect half match if (score == 15) { IsMatchStarted = false; IsHalfMatch = true; } // count rounds played in case of overtime to detect overtime end if (IsOvertime) { ++RoundCountOvertime; // if the number of rounds played during OT == 2x MR OT detected, the OT is over if (MrOvertime * 2 == RoundCountOvertime) { Application.Current.Dispatcher.Invoke(() => Demo.Overtimes.Add(CurrentOvertime)); CreateNewOvertime(); RoundCountOvertime = 0; } } // detect first overtime, the next overtimes are detected // by counting rounds and compare the value to MrOvertime if (score == 30) { IsMatchStarted = false; IsOvertime = true; // Create a new round when the score is 15-15 because round_start isn't raised CreateNewRound(); // Init the first OT CreateNewOvertime(); } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); if (!IsMatchStarted) { return; } if (Parser.CTScore == 15 && Parser.TScore == 15) { IsOvertime = true; CurrentOvertime = new Overtime() { Number = ++OvertimeCount }; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); if (!IsMatchStarted || IsFreezetime) { return; } if (_isRoundFinal) { _isRoundFinal = false; if (IsOvertime) { Application.Current.Dispatcher.Invoke(() => Demo.Overtimes.Add(CurrentOvertime)); IsHalfMatch = !IsHalfMatch; } else { IsOvertime = true; } CreateNewOvertime(); } }
/// <summary> /// Between round_end and round_officialy_ended events may happened so we update data at round_officialy_end /// However at the last round of a match, round officially end isn't raised (on Valve demos) /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { if (!IsMatchStarted) return; CheckForSpecialClutchEnd(); UpdateKillsCount(); UpdatePlayerScore(); if (!IsLastRoundHalf) { Application.Current.Dispatcher.Invoke(delegate { Demo.Rounds.Add(CurrentRound); }); } if (!IsOvertime) { if (IsLastRoundHalf) { IsLastRoundHalf = false; IsHalfMatch = !IsHalfMatch; } } if (IsSwapTeamRequired) { SwapTeams(); IsSwapTeamRequired = false; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { if (!IsMatchStarted) return; CheckForSpecialClutchEnd(); UpdateKillsCount(); UpdatePlayerScore(); Application.Current.Dispatcher.Invoke(delegate { Demo.Rounds.Add(CurrentRound); }); // End of a half if (IsLastRoundHalf) { IsHalfMatch = !IsHalfMatch; IsMatchStarted = false; } // Last round of the match ended, may have OT if (_isLastRoundFinal) { IsMatchStarted = false; IsOvertime = true; // Add the current overtime only if it's not the first if (CurrentOvertime.Number != 0) { Application.Current.Dispatcher.Invoke(delegate { Demo.Overtimes.Add(CurrentOvertime); }); IsHalfMatch = true; } else { // If it's the first OT, teams haven't been swapped IsHalfMatch = false; } // Create new OT CurrentOvertime = new Overtime { Number = ++OvertimeCount }; } if (IsLastRoundHalf) { CheckForSpecialClutchEnd(); IsSwapTeamRequired = true; IsLastRoundHalf = false; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); _isRoundOffiallyEndedOccured = true; // Don't stop the match for Faceit demos because there isn't warmup between end of the match and OT if (!_isFaceit && CurrentRound.Number == 30) IsMatchStarted = false; }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); _isRoundOffiallyEndedOccured = true; if (IsOvertime && IsLastRoundHalf) IsHalfMatch = true; }
private void CurrentDemoParser_RoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { SteamController.LogToConsole("Official round end"); }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { // Prevent adding rounds that are between half side during overtime if (IsOvertime && Parser.TScore == _previousScoreT && Parser.CTScore == _previousScoreCT && !IsHalfMatch) { IsMatchStarted = false; return; } // Keep track of the score to avoid "warmup" round that are between half side if (IsOvertime) { _previousScoreCT = Parser.CTScore; _previousScoreT = Parser.TScore; } base.HandleRoundOfficiallyEnd(sender, e); if (!IsMatchStarted) return; int score = Demo.ScoreTeam1 + Demo.ScoreTeam2; if (score < 15) return; if (score == 15) { IsMatchStarted = false; IsHalfMatch = true; } if (score < 30) return; if (score == 30) { IsMatchStarted = false; IsOvertime = true; // Create a new round when the score is 15-15 because round_start isn't raised if (Parser.TScore == 15 && Parser.CTScore == 15) CreateNewRound(); // Init the first OT CurrentOvertime = new Overtime() { Number = ++OvertimeCount }; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); if (!IsMatchStarted) return; if (Parser.CTScore == 15 && Parser.TScore == 15) { IsOvertime = true; CurrentOvertime = new Overtime() { Number = ++OvertimeCount }; } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { if (!IsMatchStarted || IsFreezetime) { return; } CurrentRound.EndTickOfficially = Parser.IngameTick; CurrentRound.Duration = (float)Math.Round((CurrentRound.EndTickOfficially - CurrentRound.Tick) / Demo.ServerTickrate, 2); // sometimes round_end isn't triggered, I update scores here if (!IsRoundEndOccured) { Core.Models.Team teamCt = GetTeamBySide(Side.CounterTerrorist); if (teamCt.Score < Parser.CTScore) { UpdateTeamScore(new RoundEndedEventArgs { Winner = DemoInfo.Team.CounterTerrorist }); } else { UpdateTeamScore(new RoundEndedEventArgs { Winner = DemoInfo.Team.Terrorist }); } } CheckForSpecialClutchEnd(); UpdateKillsCount(); UpdatePlayerScore(); if (!IsLastRoundHalf || !IsRoundEndOccured) { Application.Current.Dispatcher.Invoke(() => { CurrentRound.Number = Demo.Rounds.Count + 1; Demo.Rounds.Add(CurrentRound); }); } if (!IsOvertime && IsLastRoundHalf) { IsLastRoundHalf = false; IsHalfMatch = true; } if (IsSwapTeamRequired) { SwapTeams(); IsSwapTeamRequired = false; if (IsOvertime) { IsHalfMatch = !IsHalfMatch; } } Demo.RaiseScoresChanged(); if (!IsMatchStarted || IsFreezetime) { return; } if (_isRoundFinal) { _isRoundFinal = false; if (IsOvertime) { Application.Current.Dispatcher.Invoke(() => Demo.Overtimes.Add(CurrentOvertime)); IsHalfMatch = !IsHalfMatch; } else { IsOvertime = true; } CreateNewOvertime(); } }
protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { base.HandleRoundOfficiallyEnd(sender, e); int score = Demo.ScoreTeam1 + Demo.ScoreTeam2; if (score < 30) return; if (score == 30) { IsHalfMatch = false; IsOvertime = true; CurrentOvertime = new Overtime { Number = ++OvertimeCount }; } }
private void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e) { BaseEvent newEvent = new BaseEvent(EventType.RoundOfficiallyEnd); CurrentTick.Events.Add(newEvent); }