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.

48 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Generic in-game abuse reporting
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef TF_SHARED_CONTENT_MANAGER_H
  8. #define TF_SHARED_CONTENT_MANAGER_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. typedef struct
  13. {
  14. int iFlag;
  15. uint32 unAccountID;
  16. } shared_vision_entry_t;
  17. // Shared content manager
  18. class C_TFSharedContentManager : public CBaseGameSystemPerFrame
  19. {
  20. public:
  21. C_TFSharedContentManager(){}
  22. void OfferSharedVision( int iFlag, uint32 unAccountID );
  23. bool IsSharedVisionAvailable( int iFlag ){ return ( m_iSharedVisionFlags & iFlag ); }
  24. // Methods of IGameSystem
  25. virtual char const *Name() { return "C_TFSharedContentManager"; }
  26. virtual bool Init();
  27. virtual void Update( float frametime );
  28. private:
  29. bool CanOfferVision( int iFlag );
  30. void AddSharedVision( int iFlag ){ m_iSharedVisionFlags |= iFlag; }
  31. void OfferSharedVision_Internal( int iFlag, uint32 unAccountID );
  32. void PrintChatText( int iFlag, uint32 unAccountID );
  33. private:
  34. int m_iSharedVisionFlags;
  35. CUtlVector< uint32 > m_PlayersWhoHaveOfferedVision; // needs to be expanded when we offer more than Romevision...
  36. CUtlVector< shared_vision_entry_t > m_SharedVisionQueue;
  37. };
  38. extern C_TFSharedContentManager *TFSharedContentManager(); // get singleton
  39. #endif // TF_SHARED_CONTENT_MANAGER_H