Counter Strike : Global Offensive Source Code
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.

75 lines
3.2 KiB

  1. //====== Copyright � 1996-2008, Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: interface to steam for game play statistics
  4. //
  5. //=============================================================================
  6. #ifndef ISTEAMGAMESTATS_H
  7. #define ISTEAMGAMESTATS_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Purpose: Functions for recording game play sessions and details thereof
  13. //-----------------------------------------------------------------------------
  14. class ISteamGameStats
  15. {
  16. public:
  17. virtual SteamAPICall_t GetNewSession( int8 nAccountType, uint64 ulAccountID, int32 nAppID, RTime32 rtTimeStarted ) = 0;
  18. virtual SteamAPICall_t EndSession( uint64 ulSessionID, RTime32 rtTimeEnded, int nReasonCode ) = 0;
  19. virtual EResult AddSessionAttributeInt( uint64 ulSessionID, const char* pstrName, int32 nData ) = 0;
  20. virtual EResult AddSessionAttributeString( uint64 ulSessionID, const char* pstrName, const char *pstrData ) = 0;
  21. virtual EResult AddSessionAttributeFloat( uint64 ulSessionID, const char* pstrName, float fData ) = 0;
  22. virtual EResult AddNewRow( uint64 *pulRowID, uint64 ulSessionID, const char *pstrTableName ) = 0;
  23. virtual EResult CommitRow( uint64 ulRowID ) = 0;
  24. virtual EResult CommitOutstandingRows( uint64 ulSessionID ) = 0;
  25. virtual EResult AddRowAttributeInt( uint64 ulRowID, const char *pstrName, int32 nData ) = 0;
  26. virtual EResult AddRowAtributeString( uint64 ulRowID, const char *pstrName, const char *pstrData ) = 0;
  27. virtual EResult AddRowAttributeFloat( uint64 ulRowID, const char *pstrName, float fData ) = 0;
  28. virtual EResult AddSessionAttributeInt64( uint64 ulSessionID, const char *pstrName, int64 llData ) = 0;
  29. virtual EResult AddRowAttributeInt64( uint64 ulRowID, const char *pstrName, int64 llData ) = 0;
  30. };
  31. #define STEAMGAMESTATS_INTERFACE_VERSION "SteamGameStats001"
  32. //-----------------------------------------------------------------------------
  33. // Purpose: nAccountType for GetNewSession
  34. //-----------------------------------------------------------------------------
  35. enum EGameStatsAccountType
  36. {
  37. k_EGameStatsAccountType_Steam = 1, // ullAccountID is a 64-bit SteamID for a player
  38. k_EGameStatsAccountType_Xbox = 2, // ullAccountID is a 64-bit XUID
  39. k_EGameStatsAccountType_SteamGameServer = 3, // ullAccountID is a 64-bit SteamID for a game server
  40. };
  41. //-----------------------------------------------------------------------------
  42. // Purpose: callback for GetNewSession() method
  43. //-----------------------------------------------------------------------------
  44. struct GameStatsSessionIssued_t
  45. {
  46. enum { k_iCallback = k_iSteamGameStatsCallbacks + 1 };
  47. uint64 m_ulSessionID;
  48. EResult m_eResult;
  49. bool m_bCollectingAny;
  50. bool m_bCollectingDetails;
  51. };
  52. //-----------------------------------------------------------------------------
  53. // Purpose: callback for EndSession() method
  54. //-----------------------------------------------------------------------------
  55. struct GameStatsSessionClosed_t
  56. {
  57. enum { k_iCallback = k_iSteamGameStatsCallbacks + 2 };
  58. uint64 m_ulSessionID;
  59. EResult m_eResult;
  60. };
  61. #endif // ISTEAMGAMESTATS_H