EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FactoryService.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 /*
28  * # Manufacturing Logging:
29  * MANUF__ERROR
30  * MANUF__WARNING
31  * MANUF__MESSAGE
32  * MANUF__INFO
33  * MANUF__DEBUG
34  * MANUF__TRACE
35  * MANUF__DUMP
36  */
37 
38 #include "eve-server.h"
39 
40 #include "PyServiceCD.h"
43 
45 
47 : PyService(mgr, "factory"),
48  m_dispatch(new Dispatcher(this))
49 {
50  _SetCallDispatcher(m_dispatch);
51 
52  PyCallable_REG_CALL(FactoryService, GetBlueprintAttributes);
53  PyCallable_REG_CALL(FactoryService, GetMaterialsForTypeWithActivity);
54  PyCallable_REG_CALL(FactoryService, GetMaterialCompositionOfItemType);
55  PyCallable_REG_CALL(FactoryService, GetBlueprintInformationAtLocation);
56  PyCallable_REG_CALL(FactoryService, GetBlueprintInformationAtLocationWithFlag);
57 }
58 
60  delete m_dispatch;
61 }
62 
63 PyResult FactoryService::Handle_GetMaterialCompositionOfItemType(PyCallArgs &call) {
64  Call_SingleIntegerArg arg;
65  if (!arg.Decode(&call.tuple)) {
66  _log(SERVICE__ERROR, "Failed to decode args.");
67  return nullptr;
68  }
69 
71 }
72 
73 PyResult FactoryService::Handle_GetBlueprintAttributes(PyCallArgs &call) {
74  Call_SingleIntegerArg arg;
75  if (!arg.Decode(&call.tuple)) {
76  _log(SERVICE__ERROR, "Failed to decode args.");
77  return nullptr;
78  }
79 
80  BlueprintRef bRef = sItemFactory.GetBlueprint( arg.arg );
81  if (bRef.get() == nullptr)
82  return nullptr;
83 
84  return bRef->GetBlueprintAttributes();
85 }
86 
87 PyResult FactoryService::Handle_GetMaterialsForTypeWithActivity(PyCallArgs &call) {
88  // this is the material and manuf tab of bp. -working allan 1Jan17
89  Call_SingleIntegerArg arg;
90  if (!arg.Decode(&call.tuple)) {
91  _log(SERVICE__ERROR, "Failed to decode args.");
92  return nullptr;
93  }
94 
95  return sDataMgr.GetBPMatlData(arg.arg);
96 }
97 
98 
99 // these next two are for corp locked items calls
100 PyResult FactoryService::Handle_GetBlueprintInformationAtLocation(PyCallArgs &call) {
101  // blueprints = sm.RemoteSvc('factory').GetBlueprintInformationAtLocation(hangarID, 1)
102  _log(MANUF__MESSAGE, "FactoryService::GetBlueprintInformationAtLocation() size= %u", call.tuple->size());
103  call.Dump(MANUF__DUMP);
104  return nullptr;
105 }
106 
107 PyResult FactoryService::Handle_GetBlueprintInformationAtLocationWithFlag(PyCallArgs &call) {
108  //blueprints = sm.RemoteSvc('factory').GetBlueprintInformationAtLocationWithFlag(locationID, self.flagInput, 1)
109  _log(MANUF__MESSAGE, "FactoryService::Handle_GetBlueprintInformationAtLocationWithFlag() size= %u", call.tuple->size());
110  call.Dump(MANUF__DUMP);
111  return nullptr;
112 }
static PyRep * GetMaterialCompositionOfItemType(const uint32 typeID)
Definition: FactoryDB.cpp:103
Dispatcher *const m_dispatch
#define _log(type, fmt,...)
Definition: logsys.h:124
size_t size() const
Definition: PyRep.h:591
virtual ~FactoryService()
Dispatcher *const m_dispatch
X * get() const
Definition: RefPtr.h:213
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
PyCallable_Make_InnerDispatcher(FactoryService) FactoryService
void Dump(LogType type) const
Definition: PyCallable.cpp:81
#define sItemFactory
Definition: ItemFactory.h:165
PyTuple * tuple
Definition: PyCallable.h:50
Reference-counting-based smart pointer.
Definition: RefPtr.h:133
#define sDataMgr