1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef RY_CMS_CLIENT_H
20 #define RY_CMS_CLIENT_H
22 #include "game_share/ryzom_mirror_properties.h"
23 #include "nel/misc/smart_ptr.h"
25 // A monitor service client
26 class CMonitorClient
: public NLMISC::CRefCount
33 // The listening bounding box
34 NLMISC::CVector _WindowTopLeft
, _WindowBottomRight
;
51 DirtyAll
= PosDirty
| MiscPropDirty
57 CMonitorClient(NLNET::TSockId sock
);
67 void add(const TDataSetRow
&entity
);
70 void remove(const TDataSetRow
&entity
);
76 void setWindow(float xmin
, float ymin
, float xmax
, float ymax
);
78 const NLMISC::CVector
&getTopLeft() const
80 return _WindowTopLeft
;
83 const NLMISC::CVector
&getBottomRight() const
85 return _WindowBottomRight
;
88 // returns the TSockID
89 NLNET::TSockId
getSock() const {return _Sock
;}
92 std::vector
<CEntityEntry
> Entites
;
95 std::vector
<uint32
> InVision
;
97 // Start point for entity update
100 // Pending entities to be added
101 std::vector
<uint32
> PendingAdd
;
103 // Pending entities to be removed
104 std::vector
<uint32
> PendingRemove
;
106 // The data for the ADD message
111 TYPE_NAME_STRING_ID StringId
;
112 NLMISC::CEntityId EntityId
;
113 NLMISC::CSheetId SheetId
;
117 std::vector
<CAddData
> Add
;
120 std::vector
<uint32
> Rmv
;
122 // The data for the POS message
130 std::vector
<CPosData
> Pos
;
132 // The data for the MISC_PROP message
143 // MISC_PROP message queue
144 std::vector
<CMiscPropData
> MiscProp
;
148 std::vector
<TYPE_NAME_STRING_ID
> Str
;
150 // Allowed Upload for this client (in bytes per second)
151 uint32 AllowedUploadBandwidth
;
157 float MiscPropWeight
;
159 bool Authentificated
;
160 bool BadLogin
; // The client has given a bad login
161 // As long as this flag is set, no login should be accepted
162 // for that client. The flag will be cleared in the main loop
163 // when enough time has ellapsed
167 extern std::vector
<NLMISC::CSmartPtr
<CMonitorClient
> > Clients
;
171 #endif // RY_CMS_CLIENT_H