-
Notifications
You must be signed in to change notification settings - Fork 62
/
CBanList.h
79 lines (51 loc) · 1.37 KB
/
CBanList.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
/////////////////////////////////////////
//
// OpenLieroX
//
// code under LGPL, based on JasonBs work,
// enhanced by Dark Charlie and Albert Zeyer
//
//
/////////////////////////////////////////
// Ban List class
// Created 9/8/06
// Dark Charlie
#ifndef __CBANLIST_H__
#define __CBANLIST_H__
#include <string>
// Ban List structure
class banlist_t { public:
std::string szNick;
std::string szAddress;
banlist_t *psNext;
banlist_t *psLink; // For sorted array
};
// Ban List class
class CBanList {
private:
// Attributes
banlist_t *m_psBanList;
banlist_t *m_psSortedList;
int m_nCount;
std::string m_szPath;
bool m_bLoading;
public:
// Methods
// Constructor
CBanList();
void loadList(const std::string& szFilename);
void saveList(const std::string& szFilename);
void Shutdown();
bool isBanned(const std::string& szAddress);
void addBanned(const std::string& szAddress, const std::string& szNick);
void removeBanned(const std::string& stAddress);
banlist_t *findBanned(const std::string& szAddress);
void sortList();
void Clear();
banlist_t *getList();
int getNumItems();
std::string getPath();
banlist_t *getItemById(int ID);
int getIdByAddr(const std::string& szAddress);
};
#endif // __CBANLIST_H__