DDraceNetwork Docs
name_ban.h
Go to the documentation of this file.
1#ifndef ENGINE_SERVER_NAME_BAN_H
2#define ENGINE_SERVER_NAME_BAN_H
3
4#include <engine/console.h>
6
7#include <vector>
8
9enum
10{
13};
14
16{
17public:
18 CNameBan(const char *pName, const char *pReason, int Distance, bool IsSubstring);
19
26};
27
29{
30 IConsole *m_pConsole = nullptr;
31 std::vector<CNameBan> m_vNameBans;
32
33 static void ConNameBan(IConsole::IResult *pResult, void *pUser);
34 static void ConNameUnban(IConsole::IResult *pResult, void *pUser);
35 static void ConNameBans(IConsole::IResult *pResult, void *pUser);
36
37public:
38 void InitConsole(IConsole *pConsole);
39 void Ban(const char *pName, const char *pReason, const int Distance, const bool IsSubstring);
40 void Unban(const char *pName);
41 void Dump() const;
42 const CNameBan *IsBanned(const char *pName) const;
43};
44
45#endif // ENGINE_SERVER_NAME_BAN_H
Definition: name_ban.h:16
int m_aSkeleton[MAX_NAME_SKELETON_LENGTH]
Definition: name_ban.h:22
CNameBan(const char *pName, const char *pReason, int Distance, bool IsSubstring)
Definition: name_ban.cpp:7
char m_aName[MAX_NAME_LENGTH]
Definition: name_ban.h:20
bool m_IsSubstring
Definition: name_ban.h:25
int m_Distance
Definition: name_ban.h:24
int m_SkeletonLength
Definition: name_ban.h:23
char m_aReason[MAX_NAMEBAN_REASON_LENGTH]
Definition: name_ban.h:21
Definition: name_ban.h:29
void InitConsole(IConsole *pConsole)
Definition: name_ban.cpp:15
const CNameBan * IsBanned(const char *pName) const
Definition: name_ban.cpp:89
void Dump() const
Definition: name_ban.cpp:76
static void ConNameBan(IConsole::IResult *pResult, void *pUser)
Definition: name_ban.cpp:109
static void ConNameUnban(IConsole::IResult *pResult, void *pUser)
Definition: name_ban.cpp:118
std::vector< CNameBan > m_vNameBans
Definition: name_ban.h:31
void Unban(const char *pName)
Definition: name_ban.cpp:52
static void ConNameBans(IConsole::IResult *pResult, void *pUser)
Definition: name_ban.cpp:124
void Ban(const char *pName, const char *pReason, const int Distance, const bool IsSubstring)
Definition: name_ban.cpp:24
IConsole * m_pConsole
Definition: name_ban.h:30
Definition: console.h:45
Definition: console.h:18
@ MAX_NAME_LENGTH
Definition: protocol.h:97
@ MAX_NAME_SKELETON_LENGTH
Definition: name_ban.h:11
@ MAX_NAMEBAN_REASON_LENGTH
Definition: name_ban.h:12