EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
WarRegistryService.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 */
25 
26 #include "eve-server.h"
27 
28 #include "PyBoundObject.h"
29 #include "PyServiceCD.h"
31 
32 /*
33  * FACWAR__ERROR
34  * FACWAR__WARNING
35  * FACWAR__INFO
36  * FACWAR__MESSAGE
37  * FACWAR__TRACE
38  * FACWAR__CALL
39  * FACWAR__CALL_DUMP
40  * FACWAR__RSP_DUMP
41  */
42 
44 : public PyBoundObject
45 {
46 public:
48 
50  : PyBoundObject(mgr),
51  m_dispatch(new Dispatcher(this)),
52  m_corporationID(corporationID)
53  {
55 
56  m_strBoundObjectName = "WarRegistryBound";
57 
59  /*
60  return self.GetMoniker().RetractWar(againstID)
61  return self.GetMoniker().DeclareWarAgainst(againstID)
62  return self.GetMoniker().ChangeMutualWarFlag(warID, mutual)
63  return self.GetMoniker().GetCostOfWarAgainst(ownerID)
64  */
65  }
67  {
68  delete m_dispatch;
69  }
70 
71  void Release() {
72  //I hate this statement
73  delete this;
74  }
75 
76  PyCallable_DECL_CALL(GetWars);
77 
78 private:
79  Dispatcher *const m_dispatch;
80 
82 };
83 
85 
87 : PyService(mgr, "warRegistry"),
88  m_dispatch(new Dispatcher(this))
89 {
90  _SetCallDispatcher(m_dispatch);
91 }
92 
94 {
95  delete m_dispatch;
96 }
97 
99  Call_TwoIntegerArgs args;
100  //crap
101  PyRep* tmp(bind_args->Clone());
102  if (!args.Decode(&tmp)) {
103  codelog(SERVICE__ERROR, "%s: Failed to decode bind args.", GetName());
104  return nullptr;
105  }
106  //arg1 = corporationID
107  //arg2 = ???
108  return new WarRegistryBound(m_manager, args.arg1);
109 }
110 
111 PyResult WarRegistryBound::Handle_GetWars( PyCallArgs& call )
112 {
113  sLog.Debug( "WarRegistryBound", "Called GetWars stub." );
114 
115  util_IndexRowset irowset;
116 
117  irowset.header.push_back( "warID" );
118  irowset.header.push_back( "declaredByID" );
119  irowset.header.push_back( "againstID" );
120  irowset.header.push_back( "timeDeclared" );
121  irowset.header.push_back( "timeFinished" );
122  irowset.header.push_back( "retracted" );
123  irowset.header.push_back( "retractedBy" );
124  irowset.header.push_back( "billID" );
125  irowset.header.push_back( "mutual" );
126 
127  irowset.idName = "warID";
128 
129  return irowset.Encode();
130 }
131 
132 /*
133  [PyTuple 2 items]
134  [PyTuple 1 items]
135  [PyToken dbutil.CIndexedRowset]
136  [PyDict 2 kvp]
137  [PyString "header"]
138  [PyObjectEx Normal]
139  [PyTuple 2 items]
140  [PyToken blue.DBRowDescriptor]
141  [PyTuple 1 items]
142  [PyTuple 9 items]
143  [PyTuple 2 items]
144  [PyString "warID"]
145  [PyInt 3]
146  [PyTuple 2 items]
147  [PyString "declaredByID"]
148  [PyInt 3]
149  [PyTuple 2 items]
150  [PyString "againstID"]
151  [PyInt 3]
152  [PyTuple 2 items]
153  [PyString "timeDeclared"]
154  [PyInt 64]
155  [PyTuple 2 items]
156  [PyString "timeFinished"]
157  [PyInt 64]
158  [PyTuple 2 items]
159  [PyString "retracted"]
160  [PyInt 64]
161  [PyTuple 2 items]
162  [PyString "retractedBy"]
163  [PyInt 3]
164  [PyTuple 2 items]
165  [PyString "billID"]
166  [PyInt 3]
167  [PyTuple 2 items]
168  [PyString "mutual"]
169  [PyInt 11]
170  [PyString "columnName"]
171  [PyString "warID"]
172  */
Base Python wire object.
Definition: PyRep.h:66
Dispatcher *const m_dispatch
virtual PyRep * Clone() const =0
Clones object.
PyBoundObject * CreateBoundObject(Client *pClient, const PyRep *bind_args)
Dispatcher *const m_dispatch
PyCallable_DECL_CALL(GetWars)
std::string m_strBoundObjectName
Definition: PyBoundObject.h:54
PyCallable_Make_Dispatcher(WarRegistryBound) WarRegistryBound(PyServiceMgr *mgr
const char * GetName() const
Definition: PyService.h:54
void _SetCallDispatcher(CallDispatcher *d)
Definition: PyCallable.h:87
* args
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
#define codelog(type, fmt,...)
Definition: logsys.h:128
PyServiceMgr *const m_manager
Definition: PyService.h:91
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
Definition: Client.h:66
unsigned __int32 uint32
Definition: eve-compat.h:50
PyCallable_Make_InnerDispatcher(WarRegistryService) WarRegistryService
Dispatcher *const m_dispatch