mirror of
https://github.com/unknownworlds/NS.git
synced 2024-11-27 06:42:56 +00:00
19b458f8bc
git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@141 67975925-1194-0748-b3d5-c16f83f1a3a1
57 lines
1.2 KiB
C++
57 lines
1.2 KiB
C++
//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//=============================================================================
|
|
|
|
#ifndef VOICE_BANMGR_H
|
|
#define VOICE_BANMGR_H
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
|
|
// This class manages the (persistent) list of squelched players.
|
|
class CVoiceBanMgr
|
|
{
|
|
public:
|
|
|
|
CVoiceBanMgr();
|
|
~CVoiceBanMgr();
|
|
|
|
// Init loads the list of squelched players from disk.
|
|
bool Init(char const *pGameDir);
|
|
void Term();
|
|
|
|
// Saves the state into voice_squelch.dt.
|
|
void SaveState(char const *pGameDir);
|
|
|
|
bool GetPlayerBan(char const playerID[16]);
|
|
void SetPlayerBan(char const playerID[16], bool bSquelch);
|
|
|
|
// Call your callback for each banned player.
|
|
void ForEachBannedPlayer(void (*callback)(char id[16]));
|
|
|
|
|
|
protected:
|
|
|
|
class BannedPlayer
|
|
{
|
|
public:
|
|
char m_PlayerID[16];
|
|
BannedPlayer *m_pPrev, *m_pNext;
|
|
};
|
|
|
|
void Clear();
|
|
BannedPlayer* InternalFindPlayerSquelch(char const playerID[16]);
|
|
BannedPlayer* AddBannedPlayer(char const playerID[16]);
|
|
|
|
|
|
protected:
|
|
|
|
BannedPlayer m_PlayerHash[256];
|
|
};
|
|
|
|
|
|
#endif // VOICE_BANMGR_H
|