-
Notifications
You must be signed in to change notification settings - Fork 2
/
CODBanFile.cpp
73 lines (60 loc) · 1.16 KB
/
CODBanFile.cpp
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
// wxWindows includes
#include <wx/wx.h>
#include <wx/wfstream.h>
#include <wx/stream.h>
#include <wx/string.h>
#include <wx/arrstr.h>
#include <wx/dir.h>
#include <wx/filename.h>
// Statsgen includes
#include "GlobalStatistics.h"
#include "Progress.h"
#include "CODBanFile.h"
CODBanFile::CODBanFile(wxFileName &filenameIn)
{
filename=filenameIn;
LoadFile();
}
CODBanFile::~CODBanFile()
{
}
void CODBanFile::LoadFile()
{
int banCount;
int banIndex;
wxTextFile fp;
bool retVal;
wxString status;
wxString line;
wxString name;
wxString guid;
status="Reading Ban File"; progress->SetStatus(status);
retVal=fp.Open(filename.GetFullPath());
names.Clear();
if (retVal)
{
banCount=fp.GetLineCount();
for (banIndex=0;banIndex<banCount;banIndex++)
{
line=fp[banIndex];
if (line.Length()>0)
{
guid=line.BeforeFirst(' ');
name=line.AfterFirst(' ');
names.Add(name);
}
}
}
}
void CODBanFile::AddToDropList()
{
int banCount;
int banIndex;
wxString name;
banCount=names.GetCount();
for (banIndex=0;banIndex<banCount;banIndex++)
{
name=names.Item(banIndex);
globalStatistics.dropList.AddCheat(name);
}
}