Team Fortress 2 Source Code as on 22/4/2020
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
2.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: The lobby shared object for gameservers, managed by CTFLobby
  4. //
  5. //=============================================================================
  6. #ifndef TF_LOBBY_SERVER_H
  7. #define TF_LOBBY_SERVER_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. #include "gcsdk/protobufsharedobject.h"
  12. #include "tf_gcmessages.h"
  13. #include "tf_matchmaking_shared.h"
  14. #include "playergroup.h"
  15. class CTFGSLobby : public GCSDK::CProtoBufSharedObject<CSOTFGameServerLobby, k_EProtoObjectTFGameServerLobby>
  16. {
  17. typedef GCSDK::CProtoBufSharedObject<CSOTFGameServerLobby, k_EProtoObjectTFGameServerLobby> BaseClass;
  18. public:
  19. virtual ~CTFGSLobby() {}
  20. // Debug
  21. void SpewDebug();
  22. // Member helpers
  23. const CTFLobbyMember* GetMemberDetails( CSteamID steamID ) const;
  24. const CTFLobbyMember* GetMemberDetails( int i ) const;
  25. const CSteamID GetMember( int i ) const;
  26. int GetNumMembers() const { return Obj().members_size(); }
  27. CTFLobbyMember_ConnectState GetMemberConnectState( int iMemberIndex ) const;
  28. bool BAssertValidMemberIndex( int iMemberIndex ) const;
  29. // Inline helpers
  30. CSOTFGameServerLobby::State GetState() const { return Obj().state(); }
  31. const char *GetMissionName() const { return Obj().mission_name().c_str(); }
  32. EMatchGroup GetMatchGroup() const { return Obj().has_match_group() ? (EMatchGroup)Obj().match_group() : k_nMatchGroup_Invalid; }
  33. uint64 GetMatchID( void ) const { return Obj().match_id(); }
  34. uint32 GetFlags( void ) const { return Obj().flags(); }
  35. const char *GetMapName() const { return Obj().map_name().c_str(); }
  36. GCSDK::PlayerGroupID_t GetGroupID() const { return Obj().lobby_id(); }
  37. bool GetLateJoinEligible() const { return Obj().late_join_eligible(); }
  38. CSteamID GetServerID() const { return Obj().server_id(); }
  39. const char *GetConnect() const { return Obj().connect().c_str(); }
  40. uint32_t GetLobbyMMVersion() const { return Obj().lobby_mm_version(); }
  41. #ifdef USE_MVM_TOUR
  42. // Returns name of tour that we are playing for. Returns NULL if we are not playing for bragging rights!
  43. const char *GetMannUpTourName() const;
  44. #endif // USE_MVM_TOUR
  45. };
  46. #endif // TF_LOBBY_SERVER_H