diff options
| author | Teetime <anton.tsoulos@yahoo.de> | 2011-10-22 16:13:17 +0200 |
|---|---|---|
| committer | Teetime <anton.tsoulos@yahoo.de> | 2011-10-22 16:13:17 +0200 |
| commit | 505c0606ea7c93f0440394131722a31e6c1bcfe9 (patch) | |
| tree | 72492349f651c8d247cfb3d90528256528636700 /src/game/server/gamecontext.h | |
| parent | 54b88b383e0521084d14431dee94c1ac0b422d7c (diff) | |
| download | zcatch-505c0606ea7c93f0440394131722a31e6c1bcfe9.tar.gz zcatch-505c0606ea7c93f0440394131722a31e6c1bcfe9.zip | |
added possibility to mute players
Diffstat (limited to 'src/game/server/gamecontext.h')
| -rw-r--r-- | src/game/server/gamecontext.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/game/server/gamecontext.h b/src/game/server/gamecontext.h index f53c3e5a..54e3f905 100644 --- a/src/game/server/gamecontext.h +++ b/src/game/server/gamecontext.h @@ -15,6 +15,8 @@ #include "gameworld.h" #include "player.h" +#define MAX_MUTES 25 + /* Tick Game Context (CGameContext::tick) @@ -60,6 +62,10 @@ class CGameContext : public IGameServer static void ConClearVotes(IConsole::IResult *pResult, void *pUserData); static void ConVote(IConsole::IResult *pResult, void *pUserData); static void ConchainSpecialMotdupdate(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData); + + static void ConMute(IConsole::IResult *pResult, void *pUserData); + static void ConUnmute(IConsole::IResult *pResult, void *pUserData); + static void ConMutes(IConsole::IResult *pResult, void *pUserData); CGameContext(int Resetting); void Construct(int Resetting); @@ -133,6 +139,18 @@ public: { ZCATCH_NOT_CATCHED = -1, }; + + struct CMutes + { + char m_IP[NETADDR_MAXSTRSIZE]; + int m_Expires; + }; + CMutes m_aMutes[MAX_MUTES]; + // helper functions + void AddMute(const char* IP, int Secs); + void AddMute(int ClientID, int Secs); + int Muted(const char* IP); + void CleanMutes(); // network void SendChatTarget(int To, const char *pText); |