diff --git a/MatchStats/MatchStats.cpp b/MatchStats/MatchStats.cpp index 33e8fac..6f14c92 100644 --- a/MatchStats/MatchStats.cpp +++ b/MatchStats/MatchStats.cpp @@ -22,6 +22,18 @@ void CMatchStats::ServerActivate() // Round Win Share: Extra amount added to player from winner team that defused the bomb this->m_rws_c4_defused = gMatchUtil.CvarRegister("ms_rws_c4_defused", "30.0"); + // Number of rounds in match + this->m_max_rounds = gMatchUtil.CvarRegister("ms_max_rounds", "30"); + + // Number of overtime rounds + this->m_max_rounds_ot = gMatchUtil.CvarRegister("ms_max_rounds_ot", "6"); + + // Game Mode: 0 Leaders Sorted, 1 Random Teams, 2 Not Sorted, 3 Skill Sorted, 4 Swap Teams, 5 Knife Round + this->m_game_mode = gMatchUtil.CvarRegister("ms_game_mode", "0"); + + // Match will have Knife Round + this->m_knife_round = gMatchUtil.CvarRegister("ms_knife_round", "0"); + // Enable Stats Remote API (0 Disable, 1 Enable) this->m_api_enable = gMatchUtil.CvarRegister("ms_api_enable", "0"); @@ -116,6 +128,18 @@ void CMatchStats::Cvar_DirectSet(struct cvar_s* var, const char* value) // Set rounds played this->m_Match.Rounds = 0; + + // Number of rounds in match + this->m_Match.MaxRounds = (int)this->m_max_rounds->value; + + // Number of overtime rounds + this->m_Match.MaxRoundsOT = (int)this->m_max_rounds_ot->value; + + // Game Mode: 0 Leaders Sorted, 1 Random Teams, 2 Not Sorted, 3 Skill Sorted, 4 Swap Teams, 5 Knife Round + this->m_Match.GameMode = (int)this->m_game_mode->value; + + // Match will have Knife Round + this->m_Match.KnifeRound = (int)this->m_knife_round->value; // Loop each player for (auto& Player : this->m_Player) @@ -1115,10 +1139,10 @@ void CMatchStats::ExportData() {"ScoreCTs", this->m_Match.Score[CT]}, {"Winner", this->m_Match.Winner}, {"Rounds", this->m_Match.Rounds}, - {"MaxRounds", 0}, - {"MaxRoundsOT", 0}, - {"GameMode", 0}, - {"KnifeRound", 0}, + {"MaxRounds", this->m_Match.MaxRounds}, + {"MaxRoundsOT", this->m_Match.MaxRoundsOT}, + {"GameMode", this->m_Match.GameMode}, + {"KnifeRound", this->m_Match.KnifeRound}, }; // Player diff --git a/MatchStats/MatchStats.h b/MatchStats/MatchStats.h index 2b909f5..94f6a8f 100644 --- a/MatchStats/MatchStats.h +++ b/MatchStats/MatchStats.h @@ -43,6 +43,18 @@ typedef struct S_MATCH_STATS // BETA: Rounds Played int Rounds; + // Number of rounds in match + int MaxRounds; + + // Number of overtime rounds + int MaxRoundsOT; + + // Game Mode: 0 Leaders Sorted, 1 Random Teams, 2 Not Sorted, 3 Skill Sorted, 4 Swap Teams, 5 Knife Round + int GameMode; + + // Match will have Knife Round + int KnifeRound; + // Reset void Reset() { @@ -54,6 +66,10 @@ typedef struct S_MATCH_STATS this->Score.fill(0); this->Winner = 0; this->Rounds = 0; + this->MaxRounds = 0; + this->MaxRoundsOT = 0; + this->GameMode = 0; + this->KnifeRound = 0; } // Swap Scores @@ -144,7 +160,7 @@ typedef struct S_PLAYER_STATS int OneShot; // BETA: One Shot Frags (Except for AWP) int NoScope; // BETA: No Scope Frags int FlyFrags; // BETA: Flying Frags - int WallFrags; // BETA: Wallbgang Frags + int WallFrags; // BETA: Wallbang Frags int GodLikes; // TODO: Count of times when a player killed the other accompanied by the wall int DoubleKill; // BETA: Double Kill @@ -350,6 +366,18 @@ class CMatchStats // Stats Remote API Bearer Token (Authentication Token or leave empty to disable) cvar_t* m_api_bearer = nullptr; + // Number of rounds in match + cvar_t* m_max_rounds = nullptr; + + // Number of overtime rounds + cvar_t* m_max_rounds_ot = nullptr; + + // Game Mode: 0 Leaders Sorted, 1 Random Teams, 2 Not Sorted, 3 Skill Sorted, 4 Swap Teams, 5 Knife Round + cvar_t* m_game_mode = nullptr; + + // Match will have Knife Round + cvar_t* m_knife_round = nullptr; + // Match State int m_State = STATE_DEAD; diff --git a/cstrike/addons/matchstats.cfg b/cstrike/addons/matchstats.cfg index c04ecc0..8479e49 100644 --- a/cstrike/addons/matchstats.cfg +++ b/cstrike/addons/matchstats.cfg @@ -37,6 +37,26 @@ ms_rws_c4_explode "30.0" // Default "30.0" ms_rws_c4_defused "30.0" +// Number of rounds in match +// +// Default "30" +ms_max_rounds "30" + +// Number of overtime rounds +// +// Default "6" +ms_max_rounds_ot "6" + +// Game Mode: 0 Leaders Sorted, 1 Random Teams, 2 Not Sorted, 3 Skill Sorted, 4 Swap Teams, 5 Knife Round +// +// Default "0" +ms_game_mode "0" + +// Match will have Knife Round +// +// Default "0" +ms_knife_round "0" + // Enable Stats Remote API // // 0 Disable