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.

55 lines
1.7 KiB

  1. //====== Copyright (C), Valve Corporation, All rights reserved. =======
  2. //
  3. // Purpose: GC based lobby. Matchmaking assigns players to a lobby
  4. //
  5. //=============================================================================
  6. #ifndef LOBBY_H
  7. #define LOBBY_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 ILobby : public IPlayerGroup
  17. {
  18. public:
  19. virtual ~ILobby() { }
  20. };
  21. class CLobbyInvite : public GCSDK::CProtoBufSharedObject<CSOLobbyInvite, k_EProtoObjectLobbyInvite>, 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( CLobbyInvite );
  25. public:
  26. const static int k_nTypeID = k_EProtoObjectLobbyInvite;
  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. // NOTE: These do not dirty fields
  34. virtual void SetSenderID( const CSteamID &steamID ) { Obj().set_sender_id( steamID.ConvertToUint64() ); }
  35. virtual void SetGroupID( PlayerGroupID_t nGroupID ) { Obj().set_group_id( nGroupID ); }
  36. virtual void SetSenderName( const char *szName ) { Obj().set_sender_name( szName ); }
  37. virtual void SetTeamInvite( uint32 unTeamID ) {}
  38. virtual void YldInitFromPlayerGroup( const IPlayerGroup *pPlayerGroup );
  39. #endif
  40. };
  41. }
  42. #endif