29 #include "../../eve-common/EVE_Character.h"
36 #include "packets/CorporationPkts.h"
95 call.
Dump(CHARACTER__DEBUG);
96 std::ostringstream flagIDs;
106 if (pClient ==
nullptr)
120 call.
Dump(CHARACTER__DEBUG);
134 if (pClient ==
nullptr)
188 _log(CHARACTER__BIND,
"CharMgrService bind request:");
189 bind_args->
Dump(CHARACTER__BIND,
" ");
190 Call_TwoIntegerArgs
args;
193 if (!args.Decode(&tmp)) {
194 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
205 std::stringstream urlBuilder;
206 urlBuilder <<
"http://" <<
sConfig.net.imageServer <<
":" <<
sConfig.net.imageServerPort <<
"/";
208 return new PyString(urlBuilder.str());
233 Call_SingleIntegerArg arg;
234 if(!arg.Decode(&call.
tuple)) {
235 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
249 args->
Dump(CLIENT__RSP_DUMP,
"");
259 Call_SingleIntegerArg arg;
260 if(!arg.Decode(&call.
tuple)) {
261 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
267 args->
Dump(CLIENT__RSP_DUMP,
"");
273 Call_SingleIntegerArg arg;
274 if(!arg.Decode(&call.
tuple)) {
275 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
290 if (result ==
nullptr)
298 Call_TwoIntegerArgs
args;
299 if (!args.Decode(&call.
tuple)) {
300 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
310 std::string reason =
"Placing Bounty on ";
316 std::map<std::string, PyRep *> res;
317 res[
"amount"] =
new PyFloat(args.arg2);
320 .
AddISK (
"amount", args.arg2)
335 sLog.Debug(
"CharMgrService",
"Returning a basic clone for Char %u of type %u", call.
client->
GetCharacterID(), typeID );
337 return new PyInt(typeID);
347 return new PyInt(stationID);
351 Call_TwoIntegerArgs
args;
352 if(!args.Decode(&call.
tuple)) {
353 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
357 sLog.Cyan(
"CharMgrService::SetActivityStatus()",
"Player %s(%u) AFK:%s, time:%i.", \
374 Call_SingleIntegerArg
args;
375 if(!args.Decode(&call.
tuple)) {
376 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
383 _log(CHARACTER__ERROR,
"GetCharacterDescription failed to load character %u.", args.arg);
393 Call_SingleStringArg
args;
394 if(!args.Decode(&call.
tuple)) {
395 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
401 _log(CHARACTER__ERROR,
"SetCharacterDescription called with no char!");
431 unsigned char code[] = {
432 0x63,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x43,0x00,0x00,
433 0x00,0x73,0x0a,0x00,0x00,0x00,0x64,0x01,0x00,0x7d,0x00,0x00,0x7c,0x00,0x00,0x53,
434 0x28,0x02,0x00,0x00,0x00,0x4e,0x28,0x00,0x00,0x00,0x00,0x28,0x00,0x00,0x00,0x00,
435 0x28,0x01,0x00,0x00,0x00,0x74,0x03,0x00,0x00,0x00,0x74,0x75,0x70,0x28,0x00,0x00,
436 0x00,0x00,0x28,0x00,0x00,0x00,0x00,0x73,0x10,0x00,0x00,0x00,0x2e,0x2f,0x6d,0x61,
437 0x6b,0x65,0x5a,0x65,0x72,0x6f,0x52,0x65,0x74,0x2e,0x70,0x79,0x74,0x08,0x00,0x00,
438 0x00,0x72,0x65,0x74,0x54,0x75,0x70,0x6c,0x65,0x0c,0x00,0x00,0x00,0x73,0x04,0x00,
439 0x00,0x00,0x00,0x01,0x06,0x02
441 int codeLen =
sizeof(code) /
sizeof(*code);
442 std::string codeString(code, code + codeLen);
545 sLog.Warning(
"CharMgrService::Handle_LogSettings()",
"size= %u", call.
tuple->
size() );
546 call.
Dump(CHARACTER__TRACE);
566 if(!args.Decode(&call.
tuple)) {
567 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
667 sLog.Warning(
"CharMgrService::Handle_AddOwnerNote()",
"size=%u ", call.
tuple->
size());
668 call.
Dump(CHARACTER__DEBUG);
714 sLog.Warning(
"CharMgrService::Handle_GetOwnerNote()",
"size= %u", call.
tuple->
size() );
715 call.
Dump(CHARACTER__DEBUG);
759 sLog.Warning(
"CharMgrService::Handle_GetOwnerNoteLabels()",
"size= %u", call.
tuple->
size() );
760 call.
Dump(CHARACTER__DEBUG);
773 sLog.Warning(
"CharMgrService::Handle_AddContact()",
"size=%u ", call.
tuple->
size());
774 call.
Dump(CHARACTER__DEBUG);
776 Call_AddContact
args;
777 if (!args.Decode(&call.
tuple)) {
778 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
790 sLog.Warning(
"CharMgrService::Handle_EditContact()",
"size=%u ", call.
tuple->
size());
791 call.
Dump(CHARACTER__DEBUG);
793 Call_AddContact
args;
794 if (!args.Decode(&call.
tuple)) {
795 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
805 sLog.Warning(
"CharMgrService::Handle_CreateLabel()",
"size=%u ", call.
tuple->
size());
806 call.
Dump(CHARACTER__DEBUG);
815 sLog.Warning(
"CharMgrService::Handle_DeleteContacts()",
"size=%u ", call.
tuple->
size());
816 call.
Dump(CHARACTER__DEBUG);
818 Call_RemoveCorporateContacts
args;
819 if (!args.Decode(&call.
tuple)) {
820 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
834 sLog.Warning(
"CharMgrService::Handle_BlockOwners()",
"size=%u ", call.
tuple->
size());
835 call.
Dump(CHARACTER__DEBUG);
837 Call_RemoveCorporateContacts
args;
838 if (!args.Decode(&call.
tuple)) {
839 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
853 sLog.Warning(
"CharMgrService::Handle_UnblockOwners()",
"size=%u ", call.
tuple->
size());
854 call.
Dump(CHARACTER__DEBUG);
856 Call_RemoveCorporateContacts
args;
857 if (!args.Decode(&call.
tuple)) {
858 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
874 sLog.Warning(
"CharMgrService::Handle_EditContactsRelationshipID()",
"size=%u ", call.
tuple->
size());
875 call.
Dump(CHARACTER__DEBUG);
877 Call_EditCorporateContacts
args;
878 if (!args.Decode(&call.
tuple)) {
879 codelog(SERVICE__ERROR,
"%s: Failed to decode arguments.",
GetName());
892 sLog.Warning(
"CharMgrService::Handle_GetFactions()",
"size= %u", call.
tuple->
size() );
893 call.
Dump(CHARACTER__TRACE);
CharMgrBound(PyServiceMgr *mgr, uint32 ownerID, uint16 contFlag)
PyRep * GetCharPrivateInfo(uint32 charID)
#define sConfig
A macro for easier access to the singleton.
Dispatcher *const m_dispatch
PyCallable_Make_InnerDispatcher(CharMgrService) CharMgrService
bool SetNote(uint32 ownerID, uint32 itemID, const char *str)
void SendErrorMsg(const char *fmt,...)
#define _log(type, fmt,...)
PyRep * GetItem(size_t index) const
Returns Python object.
static bool GetCharHomeStation(uint32 charID, uint32 &stationID)
virtual PyRep * Clone() const =0
Clones object.
PyRep * GetOwnerNoteLabels(uint32 charID)
void UpdateContact(int32 standing, uint32 charID, uint32 ownerID)
Python floating point number.
int32 GetCharacterID() const
int32 GetCorporationID() const
void SetAFK(bool set=true)
storage_type::const_iterator const_iterator
static uint32 IntegerValueU32(PyRep *pRep)
std::string m_strBoundObjectName
CharacterRef GetChar() const
const char * GetName() const
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
PyRep * GetKillOrLoss(uint32 charID)
void AddContact(uint32 ownerID, uint32 charID, int32 standing, bool inWatchlist)
PyRep * GetCharPublicInfo(uint32 charID)
void _SetCallDispatcher(CallDispatcher *d)
UserError & AddISK(const char *name, double isk)
Shorthand method for adding an ISK amount.
virtual PyBoundObject * CreateBoundObject(Client *pClient, const PyRep *bind_args)
static PyRep * ListStations(uint32 ownerID, std::ostringstream &flagIDs, bool forCorp=false, bool bpOnly=false)
#define is_log_enabled(type)
#define sLog
Evaluates to a NewLog instance.
PyCallable_Make_Dispatcher(CharMgrBound)
#define codelog(type, fmt,...)
virtual ~CharMgrService()
void SetBlockContact(uint32 charID, uint32 ownerID, bool blocked)
static PyRep * ListStationBlueprintItems(uint32 ownerID, uint32 stationID, bool forCorp=false)
static void TranserFunds(uint32 fromID, uint32 toID, double amount, std::string reason="", uint8 entryTypeID=Journal::EntryType::Undefined, uint32 referenceID=0, uint16 fromKey=Account::KeyType::Cash, uint16 toKey=Account::KeyType::Cash, Client *pClient=nullptr)
PyServiceMgr *const m_manager
const char * GetName() const
Python object "ccp_exceptions.UserError".
#define PyCallable_REG_CALL(c, m)
PyRep * GetLabels(uint32 charID)
void AddBounty(uint32 charID, uint32 ownerID, uint32 amount)
PyRep * GetContacts(uint32 charID, bool blocked)
PyRep * GetCharPublicInfo3(uint32 charID)
PyCallable_DECL_CALL(List)
float GetBalance(uint8 type=Account::CreditType::ISK)
bool GetActiveCloneType(uint32 charID, uint32 &typeID)
static PyRep * ListStationItems(uint32 ownerID, uint32 stationID)
std::string GetCharName(uint32 charID)
void RemoveContact(uint32 charID, uint32 ownerID)
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type()() itemID() copy() materialLevel()() itemID(attributeID)-Retrieves attribute value." ) COMMAND( setattr
Dispatcher *const m_dispatch
void Dump(LogType type) const
const std::string & description() const
static int64 IntegerValue(PyRep *pRep)
void SetDescription(const char *newDescription)
static PyRep * List(uint32 ownerID)
Dispatcher *const m_dispatch
PyString * GetNote(uint32 ownerID, uint32 itemID)
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.