Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
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.

47 lines
1.1 KiB

9 years ago
//========= Copyright <EFBFBD> 1996-2002, Valve LLC, All rights reserved. ============
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================
#pragma once
#ifndef VOICE_BANMGR_H
3 years ago
#define VOICE_BANMGR_H
9 years ago
// This class manages the (persistent) list of squelched players.
class CVoiceBanMgr
{
public:
CVoiceBanMgr();
~CVoiceBanMgr();
9 years ago
// Init loads the list of squelched players from disk.
bool Init( char const *pGameDir );
9 years ago
void Term();
// Saves the state into voice_squelch.dt.
void SaveState( char const *pGameDir );
9 years ago
bool GetPlayerBan( char const playerID[16] );
void SetPlayerBan( char const playerID[16], bool bSquelch );
9 years ago
// Call your callback for each banned player.
void ForEachBannedPlayer( void (*callback)( char id[16] ) );
9 years ago
protected:
class BannedPlayer
{
public:
char m_PlayerID[16];
9 years ago
BannedPlayer *m_pPrev, *m_pNext;
};
void Clear();
BannedPlayer *InternalFindPlayerSquelch( char const playerID[16] );
BannedPlayer *AddBannedPlayer( char const playerID[16] );
9 years ago
BannedPlayer m_PlayerHash[256];
};
#endif // VOICE_BANMGR_H