EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PlanetMgrService Class Reference

#include "PlanetMgrBound.h"

Inheritance diagram for PlanetMgrService:
Collaboration diagram for PlanetMgrService:

Public Member Functions

 PlanetMgrService (PyServiceMgr *mgr)
 
virtual ~PlanetMgrService ()
 
- Public Member Functions inherited from PyService
 PyService (PyServiceMgr *mgr, const char *serviceName)
 
virtual ~PyService ()
 
virtual PyResult Call (const std::string &method, PyCallArgs &args)
 
const char * GetName () const
 
- Public Member Functions inherited from PyCallable
 PyCallable ()
 
virtual ~PyCallable ()
 

Protected Member Functions

virtual PyBoundObjectCreateBoundObject (Client *pClient, const PyRep *bind_args)
 
 PyCallable_DECL_CALL (GetPlanet)
 
 PyCallable_DECL_CALL (DeleteLaunch)
 
 PyCallable_DECL_CALL (GetPlanetsForChar)
 
 PyCallable_DECL_CALL (GetMyLaunchesDetails)
 
- Protected Member Functions inherited from PyService
PyObject_BuildCachedReturn (PySubStream **result, const char *sessionInfo, CacheCheckTime check)
 
virtual PyResult Handle_MachoResolveObject (PyCallArgs &call)
 
virtual PyResult Handle_MachoBindObject (PyCallArgs &call)
 
- Protected Member Functions inherited from PyCallable
void _SetCallDispatcher (CallDispatcher *d)
 

Protected Attributes

Dispatcher *const m_dispatch
 
PlanetDBm_db
 
- Protected Attributes inherited from PyService
PyServiceMgr *const m_manager
 

Additional Inherited Members

- Protected Types inherited from PyService
enum  CacheCheckTime {
  check_Always = 0, check_Never, check_in_year, check_in_6_months,
  check_in_3_months, check_in_1_month, check_in_1_week, check_in_1_day,
  check_in_12_hours, check_in_6_hours, check_in_3_hours, check_in_2_hours,
  check_in_1_hour, check_in_30_minutes, check_in_15_minutes, check_in_5_minutes,
  check_in_1_minute, check_in_30_seconds, check_in_15_seconds, check_in_5_seconds,
  check_in_1_second, _checkCount
}
 
- Static Protected Attributes inherited from PyService
static const char *const s_checkTimeStrings [_checkCount]
 

Detailed Description

Definition at line 35 of file PlanetMgrBound.h.

Constructor & Destructor Documentation

PlanetMgrService::PlanetMgrService ( PyServiceMgr mgr)
PlanetMgrService::~PlanetMgrService ( )
virtual

Definition at line 155 of file PlanetMgrBound.cpp.

References m_dispatch.

155  {
156  delete m_dispatch;
157 }
Dispatcher *const m_dispatch

Member Function Documentation

PyBoundObject * PlanetMgrService::CreateBoundObject ( Client pClient,
const PyRep bind_args 
)
protectedvirtual

Reimplemented from PyService.

Definition at line 159 of file PlanetMgrBound.cpp.

References _log, PyRep::AsInt(), PyRep::Dump(), PyService::GetName(), SystemEntity::GetPlanetSE(), SystemManager::GetSE(), PyRep::IsInt(), SystemEntity::IsPlanetSE(), StaticData::itemID, PyService::m_manager, sDataMgr, Client::SendErrorMsg(), sEntityList, StaticData::systemID, PyRep::TypeString(), and PyInt::value().

159  {
160  /* sends planetID */
161  _log(PLANET__INFO, "PlanetMgrService bind request for:");
162  bind_args->Dump(PLANET__INFO, " ");
163  if (!bind_args->IsInt()) {
164  _log(SERVICE__ERROR, "%s Service: invalid bind argument type %s", GetName(), bind_args->TypeString());
165  return nullptr;
166  }
167 
168  StaticData sData = StaticData();
169  sDataMgr.GetStaticInfo(bind_args->AsInt()->value(), sData);
170  SystemManager* pSysMgr = sEntityList.FindOrBootSystem(sData.systemID);
171  if (pSysMgr == nullptr) {
172  pClient->SendErrorMsg("system boot failure");
173  return nullptr;
174  }
175  SystemEntity* pSE = pSysMgr->GetSE(sData.itemID);
176  if (!pSE->IsPlanetSE()) {
177  _log(SERVICE__ERROR, "%s Service: itemID is not planetID or planet not found", GetName());
178  return nullptr;
179  }
180  return new PlanetMgrBound(m_manager, pClient, pSE->GetPlanetSE());
181 }
SystemEntity * GetSE(uint32 entityID) const
void SendErrorMsg(const char *fmt,...)
Definition: Client.cpp:2719
#define _log(type, fmt,...)
Definition: logsys.h:124
int32 value() const
Definition: PyRep.h:247
virtual PlanetSE * GetPlanetSE()
Definition: SystemEntity.h:101
#define sEntityList
Definition: EntityList.h:208
const char * GetName() const
Definition: PyService.h:54
virtual bool IsPlanetSE()
Definition: SystemEntity.h:149
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
PyServiceMgr *const m_manager
Definition: PyService.h:91
uint32 systemID
bool IsInt() const
Definition: PyRep.h:100
PyInt * AsInt()
Definition: PyRep.h:122
const char * TypeString() const
Definition: PyRep.cpp:76
#define sDataMgr

Here is the call graph for this function:

PlanetMgrService::PyCallable_DECL_CALL ( GetPlanet  )
protected
PlanetMgrService::PyCallable_DECL_CALL ( DeleteLaunch  )
protected
PlanetMgrService::PyCallable_DECL_CALL ( GetPlanetsForChar  )
protected
PlanetMgrService::PyCallable_DECL_CALL ( GetMyLaunchesDetails  )
protected

Member Data Documentation

PlanetDB* PlanetMgrService::m_db
protected

Definition at line 52 of file PlanetMgrBound.h.

Dispatcher* const PlanetMgrService::m_dispatch
protected

Definition at line 42 of file PlanetMgrBound.h.

Referenced by ~PlanetMgrService().


The documentation for this class was generated from the following files: