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

??? More...

#include "APIServerManager.h"

Inheritance diagram for APIServerManager:
Collaboration diagram for APIServerManager:

Public Member Functions

 APIServerManager (const PyServiceMgr &services)
 
std::tr1::shared_ptr< std::string > ProcessCall (const APICommandCall *pAPICommandCall)
 
- Public Member Functions inherited from APIServiceManager
 APIServiceManager (const PyServiceMgr &services)
 
PyServiceMgrservices ()
 
std::tr1::shared_ptr< std::string > BuildErrorXMLResponse (std::string errorCode, std::string errorMessage)
 

Protected Member Functions

std::tr1::shared_ptr< std::string > _ServerStatus (const APICommandCall *pAPICommandCall)
 
- Protected Member Functions inherited from APIServiceManager
bool _AuthenticateUserNamePassword (std::string userName, std::string password)
 
bool _AuthenticateFullAPIQuery (std::string userID, std::string apiKey)
 
bool _AuthenticateLimitedAPIQuery (std::string userID, std::string apiKey)
 
void _BuildXMLHeader ()
 
void _CloseXMLHeader (uint32 cacheStyle)
 
void _BuildXMLRowSet (std::string name, std::string key, const std::vector< std::string > *columns)
 
void _CloseXMLRowSet ()
 
void _BuildXMLRow (const std::vector< std::string > *columns)
 
void _BuildXMLTag (std::string name)
 
void _BuildXMLTag (std::string name, const std::vector< std::pair< std::string, std::string > > *params)
 
void _BuildXMLTag (std::string name, const std::vector< std::pair< std::string, std::string > > *params, std::string value)
 
void _CloseXMLTag ()
 
void _BuildSingleXMLTag (std::string name, std::string param)
 
void _BuildErrorXMLTag (std::string code, std::string param)
 
std::tr1::shared_ptr< std::string > _GetXMLDocumentString ()
 

Additional Inherited Members

- Protected Attributes inherited from APIServiceManager
APIServiceDB m_db
 
PyServiceMgr m_services
 
TiXmlDocument _XmlDoc
 
TiXmlElement * _pXmlDocOuterTag
 
std::string _CurrentRowSetColumnString
 
std::stack< TiXmlElement * > * _pXmlElementStack
 

Detailed Description

???

??? ??? ???

Author
Aknor Jaden
Date
July 2011

Definition at line 43 of file APIServerManager.h.

Constructor & Destructor Documentation

APIServerManager::APIServerManager ( const PyServiceMgr services)

Definition at line 31 of file APIServerManager.cpp.

32 : APIServiceManager(services)
33 {
34 }
APIServiceManager(const PyServiceMgr &services)

Member Function Documentation

std::tr1::shared_ptr< std::string > APIServerManager::_ServerStatus ( const APICommandCall pAPICommandCall)
protected

Definition at line 58 of file APIServerManager.cpp.

References APIServiceManager::_BuildSingleXMLTag(), APIServiceManager::_BuildXMLHeader(), APIServiceManager::_BuildXMLTag(), APIServiceManager::_CloseXMLHeader(), APIServiceManager::_CloseXMLTag(), APIServiceManager::_GetXMLDocumentString(), itoa(), EVEAPI::CacheStyles::Modified, and APIServiceManager::services().

Referenced by ProcessCall().

59 {
60  uint32 playersOnline = services().entity_list.GetClientCount();
61  std::string playersOnlineStr( itoa( playersOnline ) );
62 
64  {
65  _BuildXMLTag( "result" );
66  {
67  _BuildSingleXMLTag( "serverOpen", "True" );
68  _BuildSingleXMLTag( "onlinePlayers", playersOnlineStr );
69  }
70  _CloseXMLTag(); // close tag "result"
71  }
73 
74  return _GetXMLDocumentString();
75 }
std::tr1::shared_ptr< std::string > _GetXMLDocumentString()
void _BuildSingleXMLTag(std::string name, std::string param)
unsigned __int32 uint32
Definition: eve-compat.h:50
void _BuildXMLTag(std::string name)
PyServiceMgr & services()
void _CloseXMLHeader(uint32 cacheStyle)
const char * itoa(int64 num)
Convers num to string.

Here is the call graph for this function:

Here is the caller graph for this function:

std::tr1::shared_ptr< std::string > APIServerManager::ProcessCall ( const APICommandCall pAPICommandCall)
virtual

Reimplemented from APIServiceManager.

Definition at line 36 of file APIServerManager.cpp.

References _ServerStatus(), and sLog.

37 {
38  sLog.Debug("APIServerManager::ProcessCall()", "EVEmu API - Server Service Manager");
39 
40  if( pAPICommandCall->find( "servicehandler" ) == pAPICommandCall->end() )
41  {
42  sLog.Error( "APIServerManager::ProcessCall()", "Cannot find 'servicehandler' specifier in pAPICommandCall packet" );
43  return std::tr1::shared_ptr<std::string>(new std::string(""));
44  }
45 
46  if( pAPICommandCall->find( "servicehandler" )->second == "ServerStatus.xml.aspx" )
47  return _ServerStatus(pAPICommandCall);
48  //else if( pAPICommandCall->find( "servicehandler" )->second == "TODO.xml.aspx" )
49  // return _TODO(pAPICommandCall);
50  else
51  {
52  sLog.Error("APIServerManager::ProcessCall()", "EVEmu API - Server Service Manager - ERROR: Cannot resolve '%s' as a valid service query for Server Service Manager",
53  pAPICommandCall->find("servicehandler")->second.c_str() );
54  return std::tr1::shared_ptr<std::string>(new std::string(""));
55  }
56 }
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
std::tr1::shared_ptr< std::string > _ServerStatus(const APICommandCall *pAPICommandCall)

Here is the call graph for this function:


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