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.

54 lines
1.7 KiB

  1. //====== Copyright (C), Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: Parties are a specific type of CPlayerGroup with a leader that can invite and kick members.
  4. //
  5. //=============================================================================
  6. #ifndef PARTY_H
  7. #define PARTY_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "playergroup.h"
  12. #include "base_gcmessages.pb.h"
  13. namespace GCSDK
  14. {
  15. class CSharedObject;
  16. class IParty : public IPlayerGroup
  17. {
  18. public:
  19. virtual ~IParty() { }
  20. };
  21. class CPartyInvite : public GCSDK::CProtoBufSharedObject<CSOPartyInvite, k_EProtoObjectPartyInvite>, public GCSDK::IPlayerGroupInvite
  22. {
  23. //This is disabled since people shouldn't create these objects directly and should instead instantiate game specific versions of them
  24. //DECLARE_CLASS_MEMPOOL( CPartyInvite );
  25. public:
  26. const static int k_nTypeID = k_EProtoObjectPartyInvite;
  27. virtual const CSteamID GetSenderID() const { return Obj().sender_id(); }
  28. virtual PlayerGroupID_t GetGroupID() const { return Obj().group_id(); }
  29. virtual const char* GetSenderName() const { return Obj().sender_name().c_str(); }
  30. virtual GCSDK::CSharedObject* GetSharedObject() { return this; }
  31. virtual const GCSDK::CSharedObject* GetSharedObject() const { return this; }
  32. #ifdef GC
  33. virtual void YldInitFromPlayerGroup( const GCSDK::IPlayerGroup *pPlayerGroup );
  34. // NOTE: These do not dirty fields
  35. virtual void SetSenderID( const CSteamID &steamID ) { Obj().set_sender_id( steamID.ConvertToUint64() ); }
  36. virtual void SetGroupID( PlayerGroupID_t nGroupID ) { Obj().set_group_id( nGroupID ); }
  37. virtual void SetSenderName( const char *szName ) { Obj().set_sender_name( szName ); }
  38. virtual void SetTeamInvite( uint32 unTeamID ) {}
  39. #endif
  40. };
  41. }
  42. #endif