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.

101 lines
2.5 KiB

  1. //========= Copyright � 1996-2009, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=====================================================================================//
  6. #ifndef _IPLAYER_H_
  7. #define _IPLAYER_H_
  8. #include "tier1/keyvalues.h"
  9. struct UserProfileData
  10. {
  11. float reputation;
  12. int32 difficulty;
  13. int32 sensitivity;
  14. int32 yaxis;
  15. int32 vibration;
  16. int32 color1, color2;
  17. int32 action_autoaim;
  18. int32 action_autocenter;
  19. int32 action_movementcontrol;
  20. int32 region;
  21. int32 achearned;
  22. int32 cred;
  23. int32 zone;
  24. int32 titlesplayed;
  25. int32 titleachearned;
  26. int32 titlecred;
  27. };
  28. //Players are a wrapper or a networked player, as such they may not have all the information current, particularly when first created.
  29. abstract_class IPlayer
  30. {
  31. public:
  32. enum OnlineState_t
  33. {
  34. STATE_OFFLINE,
  35. STATE_NO_MULTIPLAYER,
  36. STATE_ONLINE,
  37. };
  38. public:
  39. //Info
  40. virtual XUID GetXUID() = 0;
  41. virtual int GetPlayerIndex() = 0;
  42. virtual char const * GetName() = 0;
  43. virtual OnlineState_t GetOnlineState() = 0;
  44. };
  45. abstract_class IPlayerFriend : public IPlayer
  46. {
  47. public:
  48. virtual wchar_t const * GetRichPresence() = 0;
  49. virtual KeyValues *GetGameDetails() = 0;
  50. virtual KeyValues *GetPublishedPresence() = 0;
  51. virtual bool IsJoinable() = 0;
  52. virtual void Join() = 0;
  53. virtual uint64 GetTitleID() = 0;
  54. virtual uint32 GetGameServerIP() = 0;
  55. };
  56. struct MatchmakingData;
  57. class IPlayerRankingDataStore;
  58. abstract_class IPlayerLocal : public IPlayer
  59. {
  60. public:
  61. virtual const UserProfileData& GetPlayerProfileData() = 0;
  62. virtual MatchmakingData * GetPlayerMatchmakingData( void ) = 0;
  63. virtual void UpdatePlayerMatchmakingData( int mmDataType ) = 0;
  64. virtual void ResetPlayerMatchmakingData( int mmDataScope ) = 0;
  65. virtual const void * GetPlayerTitleData( int iTitleDataIndex ) = 0;
  66. virtual void UpdatePlayerTitleData( TitleDataFieldsDescription_t const *fdKey, const void *pvNewTitleData, int numNewBytes ) = 0;
  67. virtual void GetLeaderboardData( KeyValues *pLeaderboardInfo ) = 0;
  68. virtual void UpdateLeaderboardData( KeyValues *pLeaderboardInfo ) = 0;
  69. virtual void GetAwardsData( KeyValues *pAwardsData ) = 0;
  70. virtual void UpdateAwardsData( KeyValues *pAwardsData ) = 0;
  71. virtual void SetNeedsSave( void ) = 0;
  72. #if defined ( _X360 )
  73. virtual bool IsTitleDataValid( void ) = 0;
  74. virtual bool IsTitleDataBlockValid( int blockId ) = 0;
  75. virtual void SetIsTitleDataValid( bool isValid ) = 0;
  76. virtual bool IsFreshPlayerProfile( void ) = 0;
  77. virtual void ClearBufTitleData( void ) = 0;
  78. #endif
  79. virtual bool IsTitleDataStorageConnected( void ) = 0;
  80. };
  81. #endif