EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
FleetObject.cpp
Go to the documentation of this file.
1 
12 #include "eve-server.h"
13 
14 #include "PyBoundObject.h"
15 #include "PyServiceCD.h"
16 #include "fleet/FleetObject.h"
17 #include "fleet/FleetBound.h"
18 
20 
22 : PyService(mgr, "fleetObjectHandler"),
23  m_dispatch(new Dispatcher(this))
24 {
25  _SetCallDispatcher(m_dispatch);
26 
27  PyCallable_REG_CALL(FleetObject, CreateFleet);
28 }
29 
31 {
32  delete m_dispatch;
33 }
34 
36 {
37  if (is_log_enabled(FLEET__BIND_DUMP)) {
38  _log( FLEET__BIND_DUMP, "FleetObject bind request for:" );
39  bind_args->Dump( FLEET__BIND_DUMP, " " );
40  }
41 
42  if (!bind_args->IsInt()) {
43  _log(FLEET__ERROR, "%s Service: invalid bind argument type %s", GetName(), bind_args->TypeString());
44  return nullptr;
45  }
46  /* do we need to bind object like this? probably not, cause it works as-is
47  //we just bind up a new inventory object for container requested and give it back to them.
48  InventoryBound *ib = new InventoryBound(m_manager, item, flag);
49  PyRep *result = m_manager->BindObject(call.client, ib);
50  */
51  return new FleetBound( m_manager, bind_args->AsInt()->value());
52 }
53 
54 // FOH::CreateFleet, FOH::
55 PyResult FleetObject::Handle_CreateFleet(PyCallArgs &call) {
56  //self.fleet = sm.RemoteSvc('fleetObjectHandler').CreateFleet()
57  FleetBindRSP fbr;
58  fbr.nodeID = 888444; // may have to update this later, or use dedicated fleet node
59  fbr.fleetID = sFltSvc.CreateFleet(call.client);
60  fbr.unknown = 0;
61  if (fbr.fleetID == 0)
62  return nullptr;
63  return fbr.Encode();
64 }
65 
66 /*{'FullPath': u'UI/Messages', 'messageID': 259608, 'label': u'FleetCandidateDodgy1Title'}(u'Fleet Candidate Dodgy', None, None)
67  * {'FullPath': u'UI/Messages', 'messageID': 259609, 'label': u'FleetCandidateDodgy1Body'}(u'The pilot that you wish to add to your fleet is at war with the corporation <b>{corpName}</b>. Confirming that you want him to join your fleet might make all your fleet members vulnerable to this corporation, however they will not be vulnerable to other members of your fleet that are not at war with this corporation unless they decide to attack you. Are you sure you want to add this pilot to your fleet?', None, {u'{corpName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'corpName'}})
68  * {'FullPath': u'UI/Messages', 'messageID': 259610, 'label': u'FleetCandidateDodgyNTitle'}(u'Fleet Candidate Dodgy', None, None)
69  * {'FullPath': u'UI/Messages', 'messageID': 259611, 'label': u'FleetCandidateDodgyNBody'}(u'The pilot that you wish to add to your fleet is at war with these corporations <b>{corpNames}</b>. Confirming that you want him to join your fleet might make all your fleet members vulnerable to these corporations, however they will not be vulnerable to other members of your fleet that are not associated with war with these corporations unless they decide to attack you. Are you sure you want to add this pilot to your fleet?', None, {u'{corpNames}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'corpNames'}})
70  * {'FullPath': u'UI/Messages', 'messageID': 259612, 'label': u'FleetMembersDodgy1Title'}(u'Join Warring Fleet?', None, None)
71  * {'FullPath': u'UI/Messages', 'messageID': 259613, 'label': u'FleetMembersDodgy1Body'}(u'{name} wants you to join their fleet, do you accept?<br><br>This fleet has members that are at war with the corporation {corpName}. Confirming that you will join this fleet will make you vulnerable to this corporation, however they will not be vulnerable to you unless they decide to attack you. Are you sure you want to join this fleet?<br><br>NOTE: Attacking members of your fleet is not a CONCORD sanctioned activity and may result in security status loss and a police response.', None, {u'{name}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'name'}, u'{corpName}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'corpName'}})
72  * {'FullPath': u'UI/Messages', 'messageID': 259614, 'label': u'FleetMembersDodgyNTitle'}(u'Join Warring Fleet?', None, None)
73  * {'FullPath': u'UI/Messages', 'messageID': 259615, 'label': u'FleetMembersDodgyNBody'}(u'{name} wants you to join their fleet, do you accept?<br><br>This fleet has members that are associated with war with these corporations {corpNames}. Confirming that you will join this fleet will make you vulnerable to these corporations, however they will not be vulnerable to you unless they decide to attack you. Are you sure you want to join this fleet?<br><br>NOTE: Attacking members of your gang is not a CONCORD sanctioned activity and may result in security status loss and a police response.', None, {u'{name}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'name'}, u'{corpNames}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'corpNames'}})
74  * {'FullPath': u'UI/Messages', 'messageID': 259616, 'label': u'FleetRegroupBody'}(u'Regrouping to {leader}', None, {u'{leader}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'leader'}})
75  * {'FullPath': u'UI/Messages', 'messageID': 259617, 'label': u'FleetWarpBody'}(u'Following {leader} in warp', None, {u'{leader}': {'conditionalValues': [], 'variableType': 10, 'propertyName': None, 'args': 0, 'kwargs': {}, 'variableName': 'leader'}})
76  */
Base Python wire object.
Definition: PyRep.h:66
Dispatcher *const m_dispatch
PyCallable_Make_InnerDispatcher(FleetObject) FleetObject
Definition: FleetObject.cpp:19
#define _log(type, fmt,...)
Definition: logsys.h:124
int32 value() const
Definition: PyRep.h:247
Dispatcher *const m_dispatch
Definition: FleetObject.h:27
const char * GetName() const
Definition: PyService.h:54
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
#define is_log_enabled(type)
Definition: logsys.h:78
#define sFltSvc
Definition: FleetService.h:147
PyServiceMgr *const m_manager
Definition: PyService.h:91
Client *const client
Definition: PyCallable.h:49
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
Definition: Client.h:66
virtual PyBoundObject * CreateBoundObject(Client *pClient, const PyRep *bind_args)
Definition: FleetObject.cpp:35
bool IsInt() const
Definition: PyRep.h:100
PyInt * AsInt()
Definition: PyRep.h:122
const char * TypeString() const
Definition: PyRep.cpp:76