TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WardenCheckMgr.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2011 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef _WARDENCHECKMGR_H
20 #define _WARDENCHECKMGR_H
21 
22 #include <map>
23 #include <boost/thread/locks.hpp>
24 #include <boost/thread/shared_mutex.hpp>
25 #include "Cryptography/BigNumber.h"
26 
28 {
32 };
33 
35 {
38  uint32 Address; // PROC_CHECK, MEM_CHECK, PAGE_CHECK
39  uint8 Length; // PROC_CHECK, MEM_CHECK, PAGE_CHECK
40  std::string Str; // LUA, MPQ, DRIVER
41  std::string Comment;
44 };
45 
47 {
48  BigNumber Result; // MEM_CHECK
49 };
50 
52 {
53  private:
55  ~WardenCheckMgr();
56 
57  public:
58  static WardenCheckMgr* instance();
59 
60  // We have a linear key without any gaps, so we use vector for fast access
61  typedef std::vector<WardenCheck*> CheckContainer;
62  typedef std::map<uint32, WardenCheckResult*> CheckResultContainer;
63 
64  WardenCheck* GetWardenDataById(uint16 Id);
65  WardenCheckResult* GetWardenResultById(uint16 Id);
66 
67  std::vector<uint16> MemChecksIdPool;
68  std::vector<uint16> OtherChecksIdPool;
69 
70  void LoadWardenChecks();
71  void LoadWardenOverrides();
72 
73  boost::shared_mutex _checkStoreLock;
74 
75  private:
76  CheckContainer CheckStore;
77  CheckResultContainer CheckResultStore;
78 };
79 
80 #define sWardenCheckMgr WardenCheckMgr::instance()
81 
82 #endif
Definition: BigNumber.h:28
std::map< uint32, WardenCheckResult * > CheckResultContainer
Definition: WardenCheckMgr.h:62
Definition: WardenCheckMgr.h:29
uint8 Length
Definition: WardenCheckMgr.h:39
std::vector< uint16 > MemChecksIdPool
Definition: WardenCheckMgr.h:67
Definition: WardenCheckMgr.h:46
Definition: WardenCheckMgr.h:31
std::vector< WardenCheck * > CheckContainer
Definition: WardenCheckMgr.h:61
BigNumber Result
Definition: WardenCheckMgr.h:48
uint8 Type
Definition: WardenCheckMgr.h:36
CheckContainer CheckStore
Definition: WardenCheckMgr.h:76
enum WardenActions Action
Definition: WardenCheckMgr.h:43
boost::shared_mutex _checkStoreLock
Definition: WardenCheckMgr.h:73
std::vector< uint16 > OtherChecksIdPool
Definition: WardenCheckMgr.h:68
std::string Comment
Definition: WardenCheckMgr.h:41
BigNumber Data
Definition: WardenCheckMgr.h:37
uint16 CheckId
Definition: WardenCheckMgr.h:42
uint32_t uint32
Definition: Define.h:150
WardenActions
Definition: WardenCheckMgr.h:27
uint16_t uint16
Definition: Define.h:151
#define TC_GAME_API
Definition: Define.h:134
uint8_t uint8
Definition: Define.h:152
CheckResultContainer CheckResultStore
Definition: WardenCheckMgr.h:77
std::string Str
Definition: WardenCheckMgr.h:40
Definition: WardenCheckMgr.h:34
uint32 Address
Definition: WardenCheckMgr.h:38
Definition: WardenCheckMgr.h:30
Definition: WardenCheckMgr.h:51