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.

82 lines
2.3 KiB

  1. //====== Copyright (C), Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: A group of players stored on the GC.
  4. // Implementation and networking via shared objects is done in game specific derived classes.
  5. //
  6. //=============================================================================
  7. #ifndef PLAYERGROUP_H
  8. #define PLAYERGROUP_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "gcsdk/protobufsharedobject.h"
  13. namespace GCSDK
  14. {
  15. typedef uint64 PlayerGroupID_t;
  16. class CSharedObject;
  17. class IPlayerGroup;
  18. class IPlayerGroupInvite
  19. {
  20. public:
  21. virtual ~IPlayerGroupInvite() { }
  22. virtual const CSteamID GetSenderID() const = 0;
  23. virtual PlayerGroupID_t GetGroupID() const = 0;
  24. virtual const char* GetSenderName() const = 0;
  25. virtual CSharedObject* GetSharedObject() = 0;
  26. virtual const CSharedObject* GetSharedObject() const = 0;
  27. #ifdef GC
  28. virtual void SetSenderID( const CSteamID &steamID ) = 0;
  29. virtual void SetGroupID( PlayerGroupID_t nGroupID ) = 0;
  30. virtual void SetSenderName( const char *szName ) = 0;
  31. virtual void SetTeamInvite( uint32 unTeamID ) = 0;
  32. virtual void YldInitFromPlayerGroup( const IPlayerGroup *pPlayerGroup ) = 0;
  33. #endif
  34. };
  35. class IPlayerGroup
  36. {
  37. public:
  38. virtual ~IPlayerGroup() { }
  39. virtual PlayerGroupID_t GetGroupID() const = 0;
  40. virtual int GetNumMembers() const = 0;
  41. virtual const CSteamID GetMember( int i ) const = 0;
  42. virtual int GetMemberIndexBySteamID( const CSteamID &steamID ) const = 0;
  43. virtual CSharedObject* GetSharedObject() = 0;
  44. virtual const CSharedObject* GetSharedObject() const = 0;
  45. virtual const CSteamID GetLeader() const = 0;
  46. virtual int GetNumPendingInvites() const = 0;
  47. virtual const CSteamID GetPendingInvite( int i ) const = 0;
  48. virtual int GetPendingInviteIndexBySteamID( const CSteamID &steamID ) const = 0;
  49. virtual bool AllowInvites() const = 0;
  50. #ifdef GC
  51. virtual void SetGroupID( PlayerGroupID_t nPartyID ) = 0;
  52. virtual void AddMember( const CSteamID &steamID ) = 0;
  53. virtual void RemoveMember( const CSteamID &steamID, bool bLoading = false ) = 0;
  54. virtual void SetLeader( const CSteamID &steamID ) = 0;
  55. virtual void AddPendingInvite( const CSteamID &steamID ) = 0;
  56. virtual void RemovePendingInvite( const CSteamID &steamID ) = 0;
  57. virtual bool ShouldDeleteFromMemcache() const = 0;
  58. virtual bool BAttemptUpdate( bool bUpdateMemcached ) = 0;
  59. #endif
  60. };
  61. }
  62. #endif