Planeshift
paladinjr.h
Go to the documentation of this file.
1 /*
2  * paladinjr.h - Author: Andrew Dai
3  *
4  * Copyright (C) 2002 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 
20 #ifndef __PALADIN_H__
21 #define __PALADIN_H__
22 //#define PALADIN_DEBUG
23 
24 #include <iutil/cfgmgr.h>
25 
26 #ifdef PALADIN_DEBUG
27 #define PALADIN_MAX_SWITCH_TIME 0
28 #else
29 #define PALADIN_MAX_SWITCH_TIME 5000
30 #endif
31 
32 #define PALADIN_VERSION "0.13"
33 
34 class PaladinJr
35 {
36 public:
37 
39  bool ValidateMovement(Client* client, gemActor* actor, psDRMessage &drmsg);
40 
44  bool CheckCollDetection(Client* client, gemActor* actor);
45 
46  void Initialize(EntityManager* celbase, CacheManager* cachemanager);
47 
49  { }
50 
51  bool IsEnabled()
52  {
53  return enabled;
54  }
55 
56 private:
57 
58  enum // possible cheat checks as bitmask
59  {
60  NOVIOLATION = 0x0,
61  WARPVIOLATION = 0x1,
62  SPEEDVIOLATION = 0x2,
63  DISTVIOLATION = 0x4,
64  CDVIOLATION = 0x8
65  };
66 
67  bool enabled;
68  bool enforcing;
69  int checks;
70  unsigned int watchTime;
71  unsigned int warnCount;
72  unsigned int maxCount;
73 
74  bool SpeedCheck(Client* client, gemActor* actor, psDRMessage &currUpdate);
75 
76 
77  EntityManager* entitymanager;
78 
80  csSet<uint32_t> checked;
81 
83  Client* target;
84 
86  csTicks started;
87 
89  csVector3 predictedPos;
90 
92  csVector3 origPos;
93  csVector3 vel;
94  csVector3 angVel;
95 
97  csVector3 maxmove;
98 
100  bool checkClient;
101 
103  psDRMessage lastUpdate;
104 
106  csVector3 maxVelocity;
107 
109  float maxSpeed;
110 };
111 
112 
113 #endif
Manages CEL entities on the server.
Definition: entitymanager.h:77
Any semi-autonomous object, either a player or an NPC.
Definition: gem.h:1170
bool ValidateMovement(Client *client, gemActor *actor, psDRMessage &drmsg)
Extrapolate the current position from last DR packet.
This class collects data of a netclient.
Definition: client.h:95
bool CheckCollDetection(Client *client, gemActor *actor)
Compare extrapolated displacement with new displacement from new DR packet Should be called after act...
~PaladinJr()
Definition: paladinjr.h:48
bool IsEnabled()
Definition: paladinjr.h:51
This class manages the caching of data that is unchanging during server operation.
Definition: cachemanager.h:234
void Initialize(EntityManager *celbase, CacheManager *cachemanager)