Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

706 lines
18 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================
  6. #ifndef TF_GAMESTATS_SHARED_H
  7. #define TF_GAMESTATS_SHARED_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "cbase.h"
  12. #include "tier1/utlvector.h"
  13. #include "tier1/utldict.h"
  14. #include "shareddefs.h"
  15. #include "tf_shareddefs.h"
  16. //=============================================================================
  17. //
  18. // TF Game Stats Enums
  19. //
  20. // NOTE: You may add to the end, but do not insert to this list!
  21. //
  22. enum TFStatType_t
  23. {
  24. TFSTAT_UNDEFINED = 0,
  25. TFSTAT_SHOTS_HIT,
  26. TFSTAT_SHOTS_FIRED,
  27. TFSTAT_KILLS,
  28. TFSTAT_DEATHS,
  29. TFSTAT_DAMAGE,
  30. TFSTAT_CAPTURES,
  31. TFSTAT_DEFENSES,
  32. TFSTAT_DOMINATIONS,
  33. TFSTAT_REVENGE,
  34. TFSTAT_POINTSSCORED,
  35. TFSTAT_BUILDINGSDESTROYED,
  36. TFSTAT_HEADSHOTS,
  37. TFSTAT_PLAYTIME,
  38. TFSTAT_HEALING,
  39. TFSTAT_INVULNS,
  40. TFSTAT_KILLASSISTS,
  41. TFSTAT_BACKSTABS,
  42. TFSTAT_HEALTHLEACHED,
  43. TFSTAT_BUILDINGSBUILT,
  44. TFSTAT_MAXSENTRYKILLS,
  45. TFSTAT_TELEPORTS,
  46. TFSTAT_FIREDAMAGE,
  47. TFSTAT_BONUS_POINTS,
  48. TFSTAT_BLASTDAMAGE,
  49. TFSTAT_DAMAGETAKEN,
  50. TFSTAT_HEALTHKITS,
  51. TFSTAT_AMMOKITS,
  52. TFSTAT_CLASSCHANGES,
  53. TFSTAT_CRITS,
  54. TFSTAT_SUICIDES,
  55. TFSTAT_CURRENCY_COLLECTED,
  56. TFSTAT_DAMAGE_ASSIST,
  57. TFSTAT_HEALING_ASSIST,
  58. TFSTAT_DAMAGE_BOSS,
  59. TFSTAT_DAMAGE_BLOCKED,
  60. TFSTAT_DAMAGE_RANGED,
  61. TFSTAT_DAMAGE_RANGED_CRIT_RANDOM,
  62. TFSTAT_DAMAGE_RANGED_CRIT_BOOSTED,
  63. TFSTAT_REVIVED,
  64. TFSTAT_THROWABLEHIT,
  65. TFSTAT_THROWABLEKILL,
  66. TFSTAT_KILLSTREAK_MAX,
  67. TFSTAT_KILLS_RUNECARRIER,
  68. TFSTAT_FLAGRETURNS,
  69. TFSTAT_TOTAL
  70. };
  71. #define TFSTAT_FIRST (TFSTAT_UNDEFINED+1)
  72. #define TFSTAT_LAST (TFSTAT_TOTAL-1)
  73. extern const char *s_pStatStrings[ TFSTAT_TOTAL ];
  74. enum TFMapStatType_t
  75. {
  76. TFMAPSTAT_UNDEFINED = 0,
  77. TFMAPSTAT_PLAYTIME,
  78. TFMAPSTAT_TOTAL
  79. };
  80. #define TFMAPSTAT_FIRST (TFMAPSTAT_UNDEFINED+1)
  81. #define TFMAPSTAT_LAST (TFMAPSTAT_TOTAL-1)
  82. extern const char *s_pMapStatStrings[ TFMAPSTAT_TOTAL ];
  83. enum TFRoundEndReason_t
  84. {
  85. RE_ROUND_END,
  86. RE_CLIENT_DISCONNECT,
  87. RE_CLIENT_QUIT,
  88. RE_SERVER_MAP_CHANGE,
  89. RE_SERVER_SHUTDOWN,
  90. RE_TIME_LIMIT,
  91. RE_WIN_LIMIT,
  92. RE_WIN_DIFF_LIMIT,
  93. RE_ROUND_LIMIT,
  94. RE_NEXT_LEVEL_CVAR,
  95. MAX_ROUND_END_REASON
  96. };
  97. extern const char *g_aRoundEndReasons[MAX_ROUND_END_REASON];
  98. //=============================================================================
  99. //
  100. // TF Player Round Stats
  101. //
  102. struct RoundStats_t
  103. {
  104. int m_iStat[TFSTAT_TOTAL];
  105. RoundStats_t() { Reset(); };
  106. inline int Get( int i ) const
  107. {
  108. AssertMsg( i >= TFSTAT_UNDEFINED && i < TFSTAT_TOTAL, "Stat index out of range!" );
  109. return m_iStat[ i ];
  110. }
  111. inline void Set( int i, int nValue )
  112. {
  113. AssertMsg( i >= TFSTAT_UNDEFINED && i < TFSTAT_TOTAL, "Stat index out of range!" );
  114. m_iStat[ i ] = nValue;
  115. }
  116. void Reset()
  117. {
  118. for ( int i = 0; i < ARRAYSIZE( m_iStat ); i++ )
  119. {
  120. m_iStat[i] = 0;
  121. }
  122. };
  123. void AccumulateRound( const RoundStats_t &other )
  124. {
  125. for ( int i = 0; i < ARRAYSIZE( m_iStat ); i++ )
  126. {
  127. m_iStat[i] += other.m_iStat[i];
  128. }
  129. };
  130. };
  131. struct RoundMapStats_t
  132. {
  133. int m_iStat[ TFMAPSTAT_TOTAL ];
  134. RoundMapStats_t() { Reset(); };
  135. inline int Get( int i ) const
  136. {
  137. AssertMsg( i >= TFMAPSTAT_UNDEFINED && i < TFMAPSTAT_TOTAL, "Map stat index out of range!" );
  138. return m_iStat[ i ];
  139. }
  140. inline void Set( int i, int nValue )
  141. {
  142. AssertMsg( i >= TFMAPSTAT_UNDEFINED && i < TFMAPSTAT_TOTAL, "Map stat index out of range!" );
  143. m_iStat[ i ] = nValue;
  144. }
  145. void Reset()
  146. {
  147. for ( int i = 0; i < ARRAYSIZE( m_iStat ); i++ )
  148. {
  149. m_iStat[i] = 0;
  150. }
  151. };
  152. void AccumulateRound( const RoundMapStats_t &other )
  153. {
  154. for ( int i = 0; i < ARRAYSIZE( m_iStat ); i++ )
  155. {
  156. m_iStat[i] += other.m_iStat[i];
  157. }
  158. };
  159. };
  160. enum TFGameStatsVersions_t
  161. {
  162. TF_GAMESTATS_FILE_VERSION = 006,
  163. TF_GAMESTATS_MAGIC = 0xDEADBEEF
  164. };
  165. enum TFGameStatsLumpIds_t
  166. {
  167. TFSTATS_LUMP_VERSION = 1,
  168. TFSTATS_LUMP_MAPHEADER,
  169. TFSTATS_LUMP_MAPDEATH,
  170. TFSTATS_LUMP_MAPDAMAGE,
  171. TFSTATS_LUMP_CLASS,
  172. TFSTATS_LUMP_WEAPON,
  173. TFSTATS_LUMP_ENDTAG,
  174. MAX_LUMP_COUNT
  175. };
  176. struct TF_Gamestats_Version_t
  177. {
  178. int m_iMagic; // always TF_GAMESTATS_MAGIC
  179. int m_iVersion;
  180. };
  181. struct TF_Gamestats_ClassStats_t
  182. {
  183. static const unsigned short LumpId = TFSTATS_LUMP_CLASS; // Lump ids.
  184. int iSpawns; // total # of spawns of this class
  185. int iTotalTime; // aggregate player time in seconds in this class
  186. int iScore; // total # of points scored by this class
  187. int iKills; // total # of kills by this class
  188. int iDeaths; // total # of deaths by this class
  189. int iAssists; // total # of assists by this class
  190. int iCaptures; // total # of captures by this class
  191. int iClassChanges; // total # of times someone changed to this class
  192. void Accumulate( TF_Gamestats_ClassStats_t &other )
  193. {
  194. iSpawns += other.iSpawns;
  195. iTotalTime += other.iTotalTime;
  196. iScore += other.iScore;
  197. iKills += other.iKills;
  198. iDeaths += other.iDeaths;
  199. iAssists += other.iAssists;
  200. iCaptures += other.iCaptures;
  201. iClassChanges += other.iClassChanges;
  202. }
  203. };
  204. struct TF_Gamestats_WeaponStats_t
  205. {
  206. static const unsigned short LumpId = TFSTATS_LUMP_WEAPON; // Lump ids.
  207. int iShotsFired;
  208. int iCritShotsFired;
  209. int iHits;
  210. int iTotalDamage;
  211. int iHitsWithKnownDistance;
  212. int64 iTotalDistance;
  213. void Accumulate( TF_Gamestats_WeaponStats_t &other )
  214. {
  215. iShotsFired += other.iShotsFired;
  216. iCritShotsFired += other.iCritShotsFired;
  217. iHits += other.iHits;
  218. iTotalDamage += other.iTotalDamage;
  219. iHitsWithKnownDistance += other.iHitsWithKnownDistance;
  220. iTotalDistance += other.iTotalDistance;
  221. }
  222. };
  223. //=============================================================================
  224. //
  225. // TF Game Level Stats Data
  226. //
  227. struct TF_Gamestats_LevelStats_t
  228. {
  229. public:
  230. TF_Gamestats_LevelStats_t();
  231. ~TF_Gamestats_LevelStats_t();
  232. TF_Gamestats_LevelStats_t( const TF_Gamestats_LevelStats_t &stats );
  233. // Level start and end
  234. void Init( const char *pszMapName, int nMapVersion, int nIPAddr, short nPort, float flStartTime );
  235. void Shutdown( float flEndTime );
  236. void Accumulate( TF_Gamestats_LevelStats_t *pOther )
  237. {
  238. m_Header.Accumulate( pOther->m_Header );
  239. //m_aPlayerDeaths.AddVectorToTail( pOther->m_aPlayerDeaths );
  240. //m_aPlayerDamage.AddVectorToTail( pOther->m_aPlayerDamage );
  241. int i;
  242. for ( i = 0; i < ARRAYSIZE( m_aClassStats ); i++ )
  243. {
  244. m_aClassStats[i].Accumulate( pOther->m_aClassStats[i] );
  245. }
  246. for ( i = 0; i < ARRAYSIZE( m_aWeaponStats ); i++ )
  247. {
  248. m_aWeaponStats[i].Accumulate( pOther->m_aWeaponStats[i] );
  249. }
  250. }
  251. public:
  252. // Level header data.
  253. struct LevelHeader_t
  254. {
  255. static const unsigned short LumpId = TFSTATS_LUMP_MAPHEADER; // Lump ids.
  256. char m_szMapName[64]; // Name of the map.
  257. int m_nMapRevision; // Version number for the map.
  258. unsigned int m_nIPAddr; // IP Address of the server - 4 bytes stored as an int.
  259. unsigned short m_nPort; // Port the server is using.
  260. int m_iRoundsPlayed; // # of rounds played
  261. int m_iTotalTime; // total # of seconds of all rounds
  262. int m_iBlueWins; // # of blue team wins
  263. int m_iRedWins; // # of red team wins
  264. int m_iStalemates; // # of stalemates
  265. int m_iBlueSuddenDeathWins; // # of blue team wins during sudden death
  266. int m_iRedSuddenDeathWins; // # of red team wins during sudden death
  267. int m_iLastCapChangedInRound[MAX_CONTROL_POINTS+1]; // # of times a round ended on each control point
  268. void Accumulate( LevelHeader_t &other )
  269. {
  270. m_iRoundsPlayed += other.m_iRoundsPlayed;
  271. m_iTotalTime += other.m_iTotalTime;
  272. m_iBlueWins += other.m_iBlueWins;
  273. m_iRedWins += other.m_iRedWins;
  274. m_iStalemates += other.m_iStalemates;
  275. m_iBlueSuddenDeathWins += other.m_iBlueSuddenDeathWins;
  276. m_iRedSuddenDeathWins += other.m_iRedSuddenDeathWins;
  277. for ( int i = 0; i <= MAX_CONTROL_POINTS; i++ )
  278. {
  279. m_iLastCapChangedInRound[i] += other.m_iLastCapChangedInRound[i];
  280. }
  281. }
  282. };
  283. // Player deaths.
  284. struct PlayerDeathsLump_t
  285. {
  286. static const unsigned short LumpId = TFSTATS_LUMP_MAPDEATH; // Lump ids.
  287. short nPosition[3]; // Position of death.
  288. short iWeapon; // Weapon that killed the player.
  289. unsigned short iDistance; // Distance the attacker was from the player.
  290. byte iAttackClass; // Class that killed the player.
  291. byte iTargetClass; // Class of the player killed.
  292. };
  293. // Player damage.
  294. struct PlayerDamageLump_t
  295. {
  296. static const unsigned short LumpId = TFSTATS_LUMP_MAPDAMAGE; // Lump ids.
  297. float fTime; // Time of the damage event
  298. short nTargetPosition[3]; // Position of target.
  299. short nAttackerPosition[3]; // Position of attacker.
  300. short iDamage; // Total damage.
  301. short iWeapon; // Weapon used.
  302. byte iAttackClass; // Class of the attacker
  303. byte iTargetClass; // Class of the target
  304. byte iCrit; // was the shot a crit?
  305. byte iKill; // did the shot kill the target?
  306. };
  307. // Data.
  308. LevelHeader_t m_Header; // Level header.
  309. // Disabling These Fields
  310. //CUtlVector<PlayerDeathsLump_t> m_aPlayerDeaths; // Vector of player deaths.
  311. //CUtlVector<PlayerDamageLump_t> m_aPlayerDamage; // Vector of player damage.
  312. bool m_bIsRealServer;
  313. TF_Gamestats_ClassStats_t m_aClassStats[TF_CLASS_COUNT_ALL]; // Vector of class data
  314. TF_Gamestats_WeaponStats_t m_aWeaponStats[TF_WEAPON_COUNT]; // Vector of weapon data
  315. // Temporary data.
  316. bool m_bInitialized; // Has the map Map Stat Data been initialized.
  317. time_t m_iMapStartTime;
  318. time_t m_iRoundStartTime; // time_t version for steamworks stats
  319. float m_flRoundStartTime;
  320. int m_iPeakPlayerCount[TF_TEAM_COUNT];
  321. };
  322. struct TF_Gamestats_RoundStats_t
  323. {
  324. public:
  325. TF_Gamestats_RoundStats_t();
  326. ~TF_Gamestats_RoundStats_t();
  327. private:
  328. TF_Gamestats_RoundStats_t( const TF_Gamestats_RoundStats_t &stats ) {}
  329. public:
  330. void Reset();
  331. void ResetSummary();
  332. struct RoundSummary_t
  333. {
  334. int iTeamQuit;
  335. int iPoints;
  336. int iBonusPoints;
  337. int iKills;
  338. int iDeaths;
  339. int iSuicides;
  340. int iAssists;
  341. int iBuildingsBuilt;
  342. int iBuildingsDestroyed;
  343. int iHeadshots;
  344. int iDominations;
  345. int iRevenges;
  346. int iInvulns;
  347. int iTeleports;
  348. int iDamageDone;
  349. int iHealingDone;
  350. int iCrits;
  351. int iBackstabs;
  352. int iThrowableHits;
  353. int iThrowableKills;
  354. };
  355. RoundSummary_t m_Summary;
  356. static time_t m_iRoundStartTime;
  357. static int m_iNumRounds;
  358. };
  359. struct TF_Gamestats_KillStats_t
  360. {
  361. public:
  362. TF_Gamestats_KillStats_t();
  363. ~TF_Gamestats_KillStats_t();
  364. private:
  365. TF_Gamestats_KillStats_t( const TF_Gamestats_KillStats_t &stats ) {}
  366. public:
  367. void Reset();
  368. };
  369. // Old style killstats matrix.
  370. struct KillStats_t
  371. {
  372. KillStats_t() { Reset(); }
  373. void Reset()
  374. {
  375. Q_memset( iNumKilled, 0, sizeof( iNumKilled ) );
  376. Q_memset( iNumKilledBy, 0, sizeof( iNumKilledBy ) );
  377. Q_memset( iNumKilledByUnanswered, 0, sizeof( iNumKilledByUnanswered ) );
  378. }
  379. int iNumKilled[MAX_PLAYERS+1]; // how many times this player has killed every other player
  380. int iNumKilledBy[MAX_PLAYERS+1]; // how many times this player has been killed by every other player
  381. int iNumKilledByUnanswered[MAX_PLAYERS+1]; // how many unanswered kills this player has been dealt by every other player
  382. };
  383. //=============================================================================
  384. // LoadoutStats
  385. struct LoadoutStats_t
  386. {
  387. LoadoutStats_t() { Reset(); }
  388. void Reset()
  389. {
  390. V_memset( iLoadoutItemDefIndices, INVALID_ITEM_DEF_INDEX, sizeof( iLoadoutItemDefIndices ) );
  391. V_memset( iLoadoutItemQualities, AE_UNDEFINED, sizeof( iLoadoutItemQualities ) );
  392. V_memset( iLoadoutItemStyles, 0, sizeof( iLoadoutItemStyles ) );
  393. flStartTime = 0;
  394. iClass = TF_CLASS_UNDEFINED;
  395. }
  396. void Set ( int iPlayerClass )
  397. {
  398. iClass = iPlayerClass;
  399. flStartTime = gpGlobals->curtime;
  400. }
  401. void SetItemDef ( int iSlot, itemid_t iItemDef, entityquality_t iItemQuality, style_index_t iStyle )
  402. {
  403. iLoadoutItemDefIndices[iSlot] = iItemDef;
  404. iLoadoutItemQualities[iSlot] = iItemQuality;
  405. iLoadoutItemStyles[iSlot] = iStyle;
  406. }
  407. item_definition_index_t iLoadoutItemDefIndices[CLASS_LOADOUT_POSITION_COUNT];
  408. entityquality_t iLoadoutItemQualities[CLASS_LOADOUT_POSITION_COUNT];
  409. style_index_t iLoadoutItemStyles[CLASS_LOADOUT_POSITION_COUNT];
  410. float flStartTime;
  411. int iClass;
  412. };
  413. //=============================================================================
  414. //
  415. // TF Player Stats
  416. //
  417. struct PlayerStats_t
  418. {
  419. PlayerStats_t()
  420. {
  421. Reset();
  422. };
  423. void Reset()
  424. {
  425. statsCurrentLife.Reset();
  426. statsCurrentRound.Reset();
  427. statsAccumulated.Reset();
  428. mapStatsCurrentLife.Reset();
  429. mapStatsCurrentRound.Reset();
  430. mapStatsAccumulated.Reset();
  431. statsKills.Reset();
  432. loadoutStats.Reset();
  433. iConnectTime = 0;
  434. iDisconnectTime = 0;
  435. }
  436. PlayerStats_t( const PlayerStats_t &other )
  437. {
  438. statsCurrentLife = other.statsCurrentLife;
  439. statsCurrentRound = other.statsCurrentRound;
  440. statsAccumulated = other.statsAccumulated;
  441. mapStatsCurrentLife = other.mapStatsCurrentLife;
  442. mapStatsCurrentRound = other.mapStatsCurrentRound;
  443. mapStatsAccumulated = other.mapStatsAccumulated;
  444. loadoutStats = other.loadoutStats;
  445. iConnectTime = other.iConnectTime;
  446. iDisconnectTime = other.iDisconnectTime;
  447. }
  448. RoundStats_t statsCurrentLife;
  449. RoundStats_t statsCurrentRound;
  450. RoundStats_t statsAccumulated;
  451. RoundMapStats_t mapStatsCurrentLife;
  452. RoundMapStats_t mapStatsCurrentRound;
  453. RoundMapStats_t mapStatsAccumulated;
  454. KillStats_t statsKills;
  455. LoadoutStats_t loadoutStats;
  456. int iConnectTime;
  457. int iDisconnectTime;
  458. };
  459. // reported stats structure that contains all stats data uploaded from TF server to Steam. Note that this
  460. // code is shared between TF server and processgamestats, which cracks the data file on the back end
  461. struct TFReportedStats_t
  462. {
  463. TFReportedStats_t();
  464. ~TFReportedStats_t();
  465. void Clear();
  466. TF_Gamestats_LevelStats_t *FindOrAddMapStats( const char *szMapName );
  467. #ifdef GAME_DLL
  468. void AppendCustomDataToSaveBuffer( CUtlBuffer &SaveBuffer );
  469. bool LoadCustomDataFromBuffer( CUtlBuffer &LoadBuffer );
  470. #endif
  471. bool m_bValidData;
  472. TF_Gamestats_LevelStats_t *m_pCurrentGame;
  473. CUtlDict<TF_Gamestats_LevelStats_t, unsigned short> m_dictMapStats;
  474. };
  475. struct ClassStats_t
  476. {
  477. int iPlayerClass; // which class these stats refer to
  478. int iNumberOfRounds; // how many times player has played this class
  479. RoundStats_t accumulated;
  480. RoundStats_t max;
  481. RoundStats_t currentRound;
  482. RoundStats_t accumulatedMVM;
  483. RoundStats_t maxMVM;
  484. ClassStats_t()
  485. {
  486. iPlayerClass = TF_CLASS_UNDEFINED;
  487. iNumberOfRounds = 0;
  488. }
  489. void AccumulateRound( const RoundStats_t &other )
  490. {
  491. iNumberOfRounds++;
  492. accumulated.AccumulateRound( other );
  493. currentRound = other;
  494. }
  495. void AccumulateMVMRound( const RoundStats_t &other )
  496. {
  497. iNumberOfRounds++;
  498. accumulatedMVM.AccumulateRound( other );
  499. currentRound = other;
  500. }
  501. };
  502. struct MapStats_t
  503. {
  504. map_identifier_t iMapID; // which map these stats refer to
  505. int iNumberOfRounds; // how many times player has played this map
  506. RoundMapStats_t accumulated;
  507. RoundMapStats_t currentRound;
  508. MapStats_t()
  509. {
  510. iMapID = 0xFFFFFFFF;
  511. iNumberOfRounds = 0;
  512. }
  513. void AccumulateRound( const RoundMapStats_t &other )
  514. {
  515. iNumberOfRounds++;
  516. accumulated.AccumulateRound( other );
  517. currentRound = other;
  518. }
  519. };
  520. //=============================================================================
  521. // Beta Map Stats
  522. //=============================================================================
  523. //=============================================================================
  524. // Robot Destruction
  525. struct RobotDestructionStats_t
  526. {
  527. RobotDestructionStats_t();
  528. void Clear();
  529. int GetRobotInteractionCount();
  530. int GetRobotCoreInteractionCount();
  531. int GetFlagInteractionCount();
  532. // Robot Cores Collected
  533. int iCoresCollectedByTeam[ TF_TEAM_COUNT ];
  534. // Collected By What Class
  535. int iCoreCollectedByClass[ TF_CLASS_COUNT ];
  536. // Robots Killed By Type
  537. // eRobotType::NUM_ROBOT_TYPES
  538. int iBlueRobotsKilledByType[ 3 ];
  539. int iRedRobotsKilledByType[ 3 ];
  540. int iRobotsDamageFromClass[ TF_CLASS_COUNT ];
  541. // Player Interaction
  542. int iRobotInteraction[MAX_PLAYERS];
  543. int iRobotCoreInteraction[MAX_PLAYERS];
  544. int iFlagInteraction[MAX_PLAYERS];
  545. };
  546. //=============================================================================
  547. // Cactus Canyon
  548. //=============================================================================
  549. // Passtime
  550. struct PasstimeStats_t
  551. {
  552. PasstimeStats_t() { Clear(); }
  553. void Clear();
  554. void AddBallFracSample( float f );
  555. void AddPassTravelDistSample( float f );
  556. // To get comprehensive class stats, we need an event log instead of a summary.
  557. // But for now this should cover what we need.
  558. // These class stats were specifically requested by Travis@br, in addition to
  559. // total kills by class. The total kills by class is tracked by TF already.
  560. struct Classes_t
  561. {
  562. int nTotalScores;
  563. int nTotalCarrySec;
  564. } classes[TF_CLASS_COUNT_ALL];
  565. struct RoundSummary_t
  566. {
  567. int nTotalPassesStarted;
  568. int nTotalPassesFailed;
  569. int nTotalPassesShotDown;
  570. int nTotalPassesCompleted;
  571. int nTotalPassesCompletedNearGoal;
  572. int nTotalPassesIntercepted;
  573. int nTotalPassesInterceptedNearGoal;
  574. int nTotalPassRequests;
  575. int nTotalTosses;
  576. int nTotalTossesCompleted;
  577. int nTotalTossesIntercepted;
  578. int nTotalTossesInterceptedNearGoal;
  579. int nTotalSteals;
  580. int nTotalStealsNearGoal;
  581. int nTotalBallSpawnShots;
  582. int nTotalScores;
  583. int nTotalRecoveries;
  584. int nTotalCarrySec;
  585. int nTotalWinningTeamBallCarrySec;
  586. int nTotalLosingTeamBallCarrySec;
  587. int nTotalThrowCancels;
  588. int nTotalSpeedBoosts;
  589. int nTotalJumpPads;
  590. int nTotalCarrierSpeedBoosts;
  591. int nTotalCarrierJumpPads;
  592. int nTotalBallDeflects;
  593. int nBallNeutralSec;
  594. int nGoalType;
  595. int nRoundEndReason;
  596. int nRoundRemainingSec;
  597. int nRoundMaxSec;
  598. int nPlayersRedMax;
  599. int nPlayersBlueMax;
  600. int nScoreBlue;
  601. int nScoreRed;
  602. bool bStalemate;
  603. bool bSuddenDeath;
  604. bool bMeleeOnlySuddenDeath;
  605. // histogram used to create min/max/mean/med/mode/stdev stats
  606. uint32 nBallFracSampleCount;
  607. uint32 arrBallFracHist[ 256 ];
  608. uint32 nBallFracHistSum;
  609. // sample set used to create min/max/mean/med/stdev stats
  610. static const uint32 k_nMaxPassTravelDistSamples = 1024;
  611. uint32 nPassTravelDistSampleCount;
  612. uint16 arrPassTravelDistSamples[ k_nMaxPassTravelDistSamples ];
  613. } summary;
  614. };
  615. const char* GetGameTypeID();
  616. #ifdef CLIENT_DLL
  617. MapStats_t &GetMapStats( map_identifier_t iMapID );
  618. #endif
  619. #endif // TF_GAMESTATS_SHARED_H