Add infos into target window
[ryzomcore.git] / ryzom / server / src / gpm_service / gpm_service.h
blob4277ed8470a4d80faa3a195912b2c5877019c872
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
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.
8 //
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 GE_GPMS_H
20 #define GE_GPMS_H
22 #include "nel/misc/types_nl.h"
24 #include <string>
25 #include <map>
26 #include <set>
27 #include <list>
28 #include <vector>
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"
44 #include "messages.h"
45 #include "variables.h"
48 #define MAX_MSG_ELT 400
50 class CGlobalPositionManagerService;
51 extern CGlobalPositionManagerService *pCGPMS;
55 /**
56 * CGlobalPositionManagerService
58 * \author Stephane Coutelas
59 * \author Nevrax France
60 * \date 2001
62 class CGlobalPositionManagerService : public NLNET::IService
64 public:
66 /**
67 * init the service
69 void init(void);
71 /// Init after the mirror init
72 void initMirror();
74 /**
75 * main loop
77 bool update(void);
79 /**
80 * update, called at each tick
82 static void gpmsUpdate();
84 /**
85 * method called to treat mirror updates on non-ring shards
87 static void processMirrorUpdates();
89 /**
90 * method called to treat mirror updates on ring shards
92 static void ringShardProcessMirrorUpdates();
94 /**
95 * release
97 void release(void);
99 /**
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);
109 // Set of updated AI
110 //std::set< NLMISC::CEntityId > EntityIAUpdated;
112 std::vector<NLMISC::CEntityId> Tracked;
114 NLMISC::CEntityId EntityTrack0;
115 NLMISC::CEntityId EntityTrack1;
117 CMirror Mirror;
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))
133 #endif //GE_GPMS_H