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.

54 lines
1.1 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef VOICE_BANMGR_H
  8. #define VOICE_BANMGR_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. // This class manages the (persistent) list of squelched players.
  13. class CVoiceBanMgr
  14. {
  15. public:
  16. CVoiceBanMgr();
  17. ~CVoiceBanMgr();
  18. // Init loads the list of squelched players from disk.
  19. bool Init(const char *pGameDir);
  20. void Term();
  21. // Saves the state into voice_squelch.dt.
  22. void SaveState(const char *pGameDir);
  23. bool GetPlayerBan(char const playerID[SIGNED_GUID_LEN]);
  24. void SetPlayerBan(char const playerID[SIGNED_GUID_LEN], bool bSquelch);
  25. protected:
  26. class BannedPlayer
  27. {
  28. public:
  29. char m_PlayerID[SIGNED_GUID_LEN];
  30. BannedPlayer *m_pPrev, *m_pNext;
  31. };
  32. void Clear();
  33. BannedPlayer* InternalFindPlayerSquelch(char const playerID[SIGNED_GUID_LEN]);
  34. BannedPlayer* AddBannedPlayer(char const playerID[SIGNED_GUID_LEN]);
  35. protected:
  36. BannedPlayer m_PlayerHash[256];
  37. };
  38. #endif // VOICE_BANMGR_H