EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DungeonService.cpp
Go to the documentation of this file.
1 /*
2  ------------------------------------------------------------------------------------
3  LICENSE:
4  ------------------------------------------------------------------------------------
5  This file is part of EVEmu: EVE Online Server Emulator
6  Copyright 2006 - 2021 The EVEmu Team
7  For the latest information visit https://evemu.dev
8  ------------------------------------------------------------------------------------
9  This program is free software; you can redistribute it and/or modify it under
10  the terms of the GNU Lesser General Public License as published by the Free Software
11  Foundation; either version 2 of the License, or (at your option) any later
12  version.
13 
14  This program is distributed in the hope that it will be useful, but WITHOUT
15  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16  FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public License along with
19  this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20  Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21  http://www.gnu.org/copyleft/lesser.txt.
22  ------------------------------------------------------------------------------------
23  Author: Zhur
24  Rewrite: Allan
25 */
26 
27 /* Dungeon Logging
28  * DUNG__ERROR
29  * DUNG__WARNING
30  * DUNG__INFO
31  * DUNG__MESSAGE
32  * DUNG__TRACE
33  * DUNG__CALL
34  * DUNG__CALL_DUMP
35  * DUNG__RSP_DUMP
36  * DUNG__DB_ERROR
37  * DUNG__DB_WARNING
38  * DUNG__DB_INFO
39  * DUNG__DB_MESSAGE
40  */
41 
42 #include "eve-server.h"
43 
44 #include "PyServiceCD.h"
45 #include "dungeon/DungeonService.h"
46 #include "dungeon/DungeonDB.h"
47 
48 
50 
52 : PyService(mgr, "dungeon"),
53  m_dispatch(new Dispatcher(this))
54 {
55  _SetCallDispatcher(m_dispatch);
56 
57  // objects
58  PyCallable_REG_CALL(DungeonService, IsObjectLocked);
60  PyCallable_REG_CALL(DungeonService, RemoveObject);
63  PyCallable_REG_CALL(DungeonService, EditObjectName);
64  PyCallable_REG_CALL(DungeonService, EditObjectRadius);
65  PyCallable_REG_CALL(DungeonService, EditObjectXYZ);
66  PyCallable_REG_CALL(DungeonService, EditObjectYawPitchRoll);
67  // templates
68  PyCallable_REG_CALL(DungeonService, TemplateAdd);
69  PyCallable_REG_CALL(DungeonService, TemplateRemove);
70  PyCallable_REG_CALL(DungeonService, TemplateEdit);
71  PyCallable_REG_CALL(DungeonService, AddTemplateObjects);
72  PyCallable_REG_CALL(DungeonService, TemplateObjectAddDungeonList);
73  // others
74  PyCallable_REG_CALL(DungeonService, GetArchetypes);
75  PyCallable_REG_CALL(DungeonService, DEGetFactions);
76  PyCallable_REG_CALL(DungeonService, DEGetDungeons);
77  PyCallable_REG_CALL(DungeonService, DEGetTemplates);
79  PyCallable_REG_CALL(DungeonService, DEGetRoomObjectPaletteData);
80 }
81 
82 
84  delete m_dispatch;
85 }
86 
87 
88 PyResult DungeonService::Handle_IsObjectLocked( PyCallArgs& call )
89 {
90  //return sm.RemoteSvc('dungeon').IsObjectLocked(objectID)
91  _log(DUNG__CALL, "DungeonService::Handle_IsObjectLocked size: %u", call.tuple->size());
92  call.Dump(DUNG__CALL_DUMP);
93 
94  return nullptr;
95 }
96 
97 PyResult DungeonService::Handle_AddObject( PyCallArgs& call )
98 {
99  // (newObjectID, revisionID,) = sm.RemoteSvc('dungeon').AddObject(roomID, typeID, x, y, z, yaw, pitch, roll, radius)
100 
101  _log(DUNG__CALL, "DungeonService::Handle_AddObject size: %u", call.tuple->size());
102  call.Dump(DUNG__CALL_DUMP);
103 
104  return nullptr;
105 }
106 
107 PyResult DungeonService::Handle_RemoveObject( PyCallArgs& call )
108 {
109  //sm.RemoteSvc('dungeon').RemoveObject(objectID)
110  _log(DUNG__CALL, "DungeonService::Handle_RemoveObject size: %u", call.tuple->size());
111  call.Dump(DUNG__CALL_DUMP);
112 
113  return nullptr;
114 }
115 
116 PyResult DungeonService::Handle_CopyObject( PyCallArgs& call )
117 {
118  //newObjectID = sm.RemoteSvc('dungeon').CopyObject(objectID, roomID, offsetX, offsetY, offsetZ)
119  _log(DUNG__CALL, "DungeonService::Handle_CopyObject size: %u", call.tuple->size());
120  call.Dump(DUNG__CALL_DUMP);
121 
122  return nullptr;
123 }
124 
125 PyResult DungeonService::Handle_EditObject( PyCallArgs& call )
126 {
127  _log(DUNG__CALL, "DungeonService::Handle_EditObject size: %u", call.tuple->size());
128  call.Dump(DUNG__CALL_DUMP);
129 
130  return nullptr;
131 }
132 
133 PyResult DungeonService::Handle_EditObjectName( PyCallArgs& call )
134 {
135  //sm.RemoteSvc('dungeon').EditObjectName(newObjectID, objectName)
136  _log(DUNG__CALL, "DungeonService::Handle_EditObjectName size: %u", call.tuple->size());
137  call.Dump(DUNG__CALL_DUMP);
138 
139  return nullptr;
140 }
141 
142 PyResult DungeonService::Handle_EditObjectRadius( PyCallArgs& call )
143 {
144  //sm.RemoteSvc('dungeon').EditObjectRadius(objectID=objectID, radius=radius)
145  _log(DUNG__CALL, "DungeonService::Handle_EditObjectRadius size: %u", call.tuple->size());
146  call.Dump(DUNG__CALL_DUMP);
147 
148  return nullptr;
149 }
150 
151 PyResult DungeonService::Handle_EditObjectXYZ( PyCallArgs& call )
152 {
153  //sm.RemoteSvc('dungeon').EditObjectXYZ(objectID=objectID, x=x, y=y, z=z)
154  _log(DUNG__CALL, "DungeonService::Handle_EditObjectXYZ size: %u", call.tuple->size());
155  call.Dump(DUNG__CALL_DUMP);
156 
157  return nullptr;
158 }
159 
160 PyResult DungeonService::Handle_EditObjectYawPitchRoll( PyCallArgs& call )
161 {
162  //sm.RemoteSvc('dungeon').EditObjectYawPitchRoll(objectID=objectID, yaw=yaw, pitch=pitch, roll=roll)
163  _log(DUNG__CALL, "DungeonService::Handle_EditObjectYawPitchRoll size: %u", call.tuple->size());
164  call.Dump(DUNG__CALL_DUMP);
165 
166  return nullptr;
167 }
168 
169 PyResult DungeonService::Handle_TemplateAdd( PyCallArgs& call )
170 {
171  //templateID = sm.RemoteSvc('dungeon').TemplateAdd(templateName, templateDescription)
172  _log(DUNG__CALL, "DungeonService::Handle_TemplateAdd size: %u", call.tuple->size());
173  call.Dump(DUNG__CALL_DUMP);
174 
175  return nullptr;
176 }
177 
178 PyResult DungeonService::Handle_TemplateRemove( PyCallArgs& call )
179 {
180  //sm.RemoteSvc('dungeon').TemplateRemove(self.sr.node.id)
181  _log(DUNG__CALL, "DungeonService::Handle_TemplateRemove size: %u", call.tuple->size());
182  call.Dump(DUNG__CALL_DUMP);
183 
184  return nullptr;
185 }
186 
187 PyResult DungeonService::Handle_TemplateEdit( PyCallArgs& call )
188 {
189  //dungeonSvc.TemplateEdit(self.templateRow.templateID, templateName, templateDescription)
190  _log(DUNG__CALL, "DungeonService::Handle_TemplateEdit size: %u", call.tuple->size());
191  call.Dump(DUNG__CALL_DUMP);
192 
193  return nullptr;
194 }
195 
196 PyResult DungeonService::Handle_AddTemplateObjects( PyCallArgs& call )
197 {
198  // objectIDs = sm.RemoteSvc('dungeon').AddTemplateObjects(roomID, self.sr.node.id, (posInRoom.x, posInRoom.y, posInRoom.z)
199 
200  _log(DUNG__CALL, "DungeonService::Handle_AddTemplateObjects size: %u", call.tuple->size());
201  call.Dump(DUNG__CALL_DUMP);
202 
203  return nullptr;
204 }
205 
206 PyResult DungeonService::Handle_TemplateObjectAddDungeonList( PyCallArgs& call )
207 {
208  //sm.RemoteSvc('dungeon').TemplateObjectAddDungeonList(templateID, objectIDList)
209  _log(DUNG__CALL, "DungeonService::Handle_TemplateObjectAddDungeonList size: %u", call.tuple->size());
210  call.Dump(DUNG__CALL_DUMP);
211 
212  return nullptr;
213 }
214 
215 
216 PyResult DungeonService::Handle_GetArchetypes( PyCallArgs& call )
217 {
221  _log(DUNG__CALL, "DungeonService::Handle_GetArchetypes size: %u", call.tuple->size());
222  call.Dump(DUNG__CALL_DUMP);
223 
224  return nullptr;
225 }
226 
227 PyResult DungeonService::Handle_DEGetDungeons( PyCallArgs& call )
228 {
229  /* dungeon = sm.RemoteSvc('dungeon').DEGetDungeons(archetypeID=archetypeID, factionID=factionID)
230  * dungeon = sm.RemoteSvc('dungeon').DEGetDungeons(dungeonID=dungeonID)[0]
231  * dungeon.dungeonNameID, dungeon.dungeonID, dungeon.factionID
232  */
233 
234  //PyRep *result = NULL;
235  //dict args:
236  // factionID
237  // or dungeonVID
238 
239  // rows: status (1=RELEASE,2=TESTING,else Working Copy),
240  // dungeonVName
241  // dungeonVID
242 
243  _log(DUNG__CALL, "DungeonService::Handle_DEGetDungeons size: %u", call.tuple->size());
244  call.Dump(DUNG__CALL_DUMP);
245 
246  return nullptr;
247 }
248 
249 PyResult DungeonService::Handle_DEGetTemplates( PyCallArgs& call )
250 {
251 /*
252  self.templateRows = sm.RemoteSvc('dungeon').DEGetTemplates()
253  for row in self.templateRows:
254  data = {'label': row.templateName,
255  'hint': row.description != row.templateName and row.description or '',
256  'id': row.templateID,
257  'form': self}
258  */
259 
260  _log(DUNG__CALL, "DungeonService::Handle_DEGetTemplates size: %u", call.tuple->size());
261  call.Dump(DUNG__CALL_DUMP);
262 
263  return nullptr;
264 }
265 
266 
267 PyResult DungeonService::Handle_DEGetRooms( PyCallArgs& call )
268 {
269  //rooms = sm.RemoteSvc('dungeon').DEGetRooms(dungeonID=seldungeon.dungeonID)
270  //dict arg: dungeonVID
271  //PyRep *result = NULL;
272 
273  //rows: roomName
274 
275  _log(DUNG__CALL, "DungeonService::Handle_DEGetRooms size: %u", call.tuple->size());
276  call.Dump(DUNG__CALL_DUMP);
277 
278  return nullptr;
279 }
280 
281 PyResult DungeonService::Handle_DEGetRoomObjectPaletteData( PyCallArgs& call )
282 {
283  /* roomObjectGroups = sm.RemoteSvc('dungeon').DEGetRoomObjectPaletteData()
284  * id, name in either dict or list (client can process both)
285  */
286  _log(DUNG__CALL, "DungeonService::Handle_DEGetRoomObjectPaletteData size: %u", call.tuple->size());
287  call.Dump(DUNG__CALL_DUMP);
288 
289  return nullptr;
290 }
291 
292 PyResult DungeonService::Handle_DEGetFactions( PyCallArgs& call )
293 {
294  /* factions = sm.RemoteSvc('dungeon').DEGetFactions()
295  factionOptions = [ (cfg.eveowners.Get(faction.factionID).name, faction.factionID) for faction in factions ]
296  */
297  _log(DUNG__CALL, "DungeonService::Handle_DEGetFactions size: %u", call.tuple->size());
298  call.Dump(DUNG__CALL_DUMP);
299 
300  return nullptr;
301 }
302 
303 
304 /*{'messageKey': 'DunAuthoringError', 'dataID': 17883918, 'suppressable': False, 'bodyID': 259674, 'messageType': 'warning', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 830}
305  * {'messageKey': 'DunBlacklistCannotWarp', 'dataID': 17880454, 'suppressable': False, 'bodyID': 258397, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 258396, 'messageID': 2100}
306  * {'messageKey': 'DunCantAnchor', 'dataID': 17883867, 'suppressable': False, 'bodyID': 259656, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 831}
307  * {'messageKey': 'DunCantUseMWD', 'dataID': 17883442, 'suppressable': False, 'bodyID': 259505, 'messageType': 'notify', 'urlAudio': '', 'urlIcon': '', 'titleID': None, 'messageID': 832}
308  * {'messageKey': 'DunGateLocked_ManyKeys', 'dataID': 17883928, 'suppressable': False, 'bodyID': 259678, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259677, 'messageID': 834}
309  * {'messageKey': 'DunGateLocked_OneKey', 'dataID': 17883923, 'suppressable': False, 'bodyID': 259676, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259675, 'messageID': 835}
310  * {'messageKey': 'DunGateLocked_ZeroKey', 'dataID': 17883939, 'suppressable': False, 'bodyID': 259682, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259681, 'messageID': 836}
311  * {'messageKey': 'DunGateNPCsAround', 'dataID': 17883447, 'suppressable': False, 'bodyID': 259507, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259506, 'messageID': 837}
312  * {'messageKey': 'DunGateNoSkill', 'dataID': 17883915, 'suppressable': False, 'bodyID': 259673, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259672, 'messageID': 838}
313  * {'messageKey': 'DunGateTooFarAway', 'dataID': 17883844, 'suppressable': False, 'bodyID': 259648, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259647, 'messageID': 839}
314  * {'messageKey': 'DunPodsCannotWarp', 'dataID': 17883452, 'suppressable': False, 'bodyID': 259509, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259508, 'messageID': 840}
315  * {'messageKey': 'DunShipCannotWarp', 'dataID': 17883907, 'suppressable': False, 'bodyID': 259670, 'messageType': 'info', 'urlAudio': '', 'urlIcon': '', 'titleID': 259669, 'messageID': 841}
316  */
Dispatcher *const m_dispatch
#define _log(type, fmt,...)
Definition: logsys.h:124
size_t size() const
Definition: PyRep.h:591
PyCallable_Make_InnerDispatcher(DungeonService) DungeonService
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
Dispatcher *const m_dispatch
void Dump(LogType type) const
Definition: PyCallable.cpp:81
PyTuple * tuple
Definition: PyCallable.h:50