Пример #1
0
		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();
			}
		}
Пример #2
0
        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
                };
            }
        }
Пример #3
0
        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;
            }
        }
Пример #4
0
 protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e)
 {
     base.HandleRoundOfficiallyEnd(sender, e);
     _isRoundOffiallyEndedOccured = true;
     if (IsOvertime && IsLastRoundHalf)
     {
         IsHalfMatch = true;
     }
 }
Пример #5
0
 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;
     }
 }
Пример #6
0
        private void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e)
        {
            if (!myHasMatchStarted)
            {
                return;
            }

            ProcessNewPlayers();
            UpdateKillCounts();
            UpdateRounds();
        }
Пример #7
0
        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
                };
            }
        }
Пример #9
0
        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();
            }
        }
Пример #10
0
		/// <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;
			}
		}
Пример #11
0
		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;
			}
		}
Пример #12
0
		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;
		}
Пример #13
0
		protected new void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e)
		{
			base.HandleRoundOfficiallyEnd(sender, e);
			_isRoundOffiallyEndedOccured = true;
			if (IsOvertime && IsLastRoundHalf) IsHalfMatch = true;
		}
Пример #14
0
 private void CurrentDemoParser_RoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e)
 {
     SteamController.LogToConsole("Official round end");
 }
Пример #15
0
		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
				};
			}
		}
Пример #16
0
		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
				};
			}
		}
Пример #17
0
        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();
            }
        }
Пример #18
0
		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
				};
			}
		}
Пример #19
0
        private void HandleRoundOfficiallyEnd(object sender, RoundOfficiallyEndedEventArgs e)
        {
            BaseEvent newEvent = new BaseEvent(EventType.RoundOfficiallyEnd);

            CurrentTick.Events.Add(newEvent);
        }