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/>.
22 #include "nel/misc/types_nl.h"
30 #include "nel/misc/common.h"
31 #include "nel/misc/time_nl.h"
32 #include "nel/net/service.h"
34 #include "game_share/ryzom_entity_id.h"
35 #include "game_share/entity_types.h"
36 #include "game_share/tick_event_handler.h"
37 #include "game_share/mirror.h"
39 #include "server_share/r2_vision.h"
41 #include "move_checker.h"
42 #include "world_position_manager.h"
43 #include "vision_delta_manager.h"
45 #include "variables.h"
48 #define MAX_MSG_ELT 400
50 class CGlobalPositionManagerService
;
51 extern CGlobalPositionManagerService
*pCGPMS
;
56 * CGlobalPositionManagerService
58 * \author Stephane Coutelas
59 * \author Nevrax France
62 class CGlobalPositionManagerService
: public NLNET::IService
71 /// Init after the mirror init
80 * update, called at each tick
82 static void gpmsUpdate();
85 * method called to treat mirror updates on non-ring shards
87 static void processMirrorUpdates();
90 * method called to treat mirror updates on ring shards
92 static void ringShardProcessMirrorUpdates();
100 * private method used to manage creation of instances in the ring vision universe
102 void _checkAddCharacterToRingAIInstance(sint32 aiInstance
);
105 * private method used to manage deletion of instances from the ring vision universe
107 void _checkRemoveCharacterFromRingAIInstance(sint32 aiInstance
);
110 //std::set< NLMISC::CEntityId > EntityIAUpdated;
112 std::vector
<NLMISC::CEntityId
> Tracked
;
114 NLMISC::CEntityId EntityTrack0
;
115 NLMISC::CEntityId EntityTrack1
;
118 CMirroredDataSet
*DataSet
;
120 NLMISC::CSmartPtr
<R2_VISION::CUniverse
> RingVisionUniverse
;
121 NLMISC::CSmartPtr
<CVisionDeltaManager
> RingVisionDeltaManager
;
122 NLMISC::CSmartPtr
<CMoveChecker
> MoveChecker
;
124 typedef std::map
<uint32
,uint32
> TCharactersPerAIInstance
;
125 TCharactersPerAIInstance _CharactersPerAIInstance
;
129 #define TheMirror (pCGPMS->Mirror)
130 #define TheDataset (*(pCGPMS->DataSet))