2016-06-04 15:24:23 +02:00
|
|
|
|
//========= Copyright <20> 1996-2002, Valve LLC, All rights reserved. ============
|
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
// $NoKeywords: $
|
|
|
|
|
//=============================================================================
|
|
|
|
|
#pragma once
|
2021-10-27 03:35:11 +02:00
|
|
|
|
#ifndef VOICE_BANMGR_H
|
2021-06-20 00:53:07 +02:00
|
|
|
|
#define VOICE_BANMGR_H
|
2016-06-04 15:24:23 +02:00
|
|
|
|
|
|
|
|
|
// This class manages the (persistent) list of squelched players.
|
|
|
|
|
class CVoiceBanMgr
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-10-27 03:35:11 +02:00
|
|
|
|
CVoiceBanMgr();
|
|
|
|
|
~CVoiceBanMgr();
|
2016-06-04 15:24:23 +02:00
|
|
|
|
|
|
|
|
|
// Init loads the list of squelched players from disk.
|
2021-10-27 03:35:11 +02:00
|
|
|
|
bool Init( char const *pGameDir );
|
2016-06-04 15:24:23 +02:00
|
|
|
|
void Term();
|
|
|
|
|
|
|
|
|
|
// Saves the state into voice_squelch.dt.
|
2021-10-27 03:35:11 +02:00
|
|
|
|
void SaveState( char const *pGameDir );
|
2016-06-04 15:24:23 +02:00
|
|
|
|
|
2021-10-27 03:35:11 +02:00
|
|
|
|
bool GetPlayerBan( char const playerID[16] );
|
|
|
|
|
void SetPlayerBan( char const playerID[16], bool bSquelch );
|
2016-06-04 15:24:23 +02:00
|
|
|
|
|
|
|
|
|
// Call your callback for each banned player.
|
2021-10-27 03:35:11 +02:00
|
|
|
|
void ForEachBannedPlayer( void (*callback)( char id[16] ) );
|
2016-06-04 15:24:23 +02:00
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
class BannedPlayer
|
|
|
|
|
{
|
|
|
|
|
public:
|
2021-10-27 03:35:11 +02:00
|
|
|
|
char m_PlayerID[16];
|
2016-06-04 15:24:23 +02:00
|
|
|
|
BannedPlayer *m_pPrev, *m_pNext;
|
|
|
|
|
};
|
|
|
|
|
|
2021-10-27 03:35:11 +02:00
|
|
|
|
void Clear();
|
|
|
|
|
BannedPlayer *InternalFindPlayerSquelch( char const playerID[16] );
|
|
|
|
|
BannedPlayer *AddBannedPlayer( char const playerID[16] );
|
2016-06-04 15:24:23 +02:00
|
|
|
|
|
|
|
|
|
BannedPlayer m_PlayerHash[256];
|
|
|
|
|
};
|
|
|
|
|
#endif // VOICE_BANMGR_H
|
2021-10-27 03:35:11 +02:00
|
|
|
|
|