EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CharMgrService.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  Updates: Allan
25 */
26 
27 #include "eve-server.h"
28 
29 #include "../../eve-common/EVE_Character.h"
30 
31 #include "PyBoundObject.h"
32 #include "PyServiceCD.h"
33 #include "EntityList.h"
34 #include "account/AccountService.h"
36 #include "packets/CorporationPkts.h"
37 
39 : public PyBoundObject
40 {
41 public:
43 
44  CharMgrBound(PyServiceMgr *mgr, uint32 ownerID, uint16 contFlag)
45  : PyBoundObject(mgr),
46  m_dispatch(new Dispatcher(this)),
47  m_ownerID(ownerID),
48  m_containerFlag(contFlag)
49  {
51 
52  m_strBoundObjectName = "CharMgrBound";
53 
55  PyCallable_REG_CALL(CharMgrBound, ListStations);
56  PyCallable_REG_CALL(CharMgrBound, ListStationItems);
57  PyCallable_REG_CALL(CharMgrBound, ListStationBlueprintItems);
58  }
59 
60  virtual ~CharMgrBound() {delete m_dispatch;}
61 
62  virtual void Release() {
63  //I hate this statement
64  delete this;
65  }
66 
68  PyCallable_DECL_CALL(ListStations);
69  PyCallable_DECL_CALL(ListStationItems);
70  PyCallable_DECL_CALL(ListStationBlueprintItems);
71 
72 protected:
73  Dispatcher *const m_dispatch;
74 
76  uint16 m_containerFlag; // this is EVEContainerType defined in EVE_Inventory.h
77 };
78 
79 
80 PyResult CharMgrBound::Handle_List( PyCallArgs& call )
81 {
83 }
84 
85 PyResult CharMgrBound::Handle_ListStationItems( PyCallArgs& call )
86 {
87  // this is the assets window
89 }
90 
91 PyResult CharMgrBound::Handle_ListStations( PyCallArgs& call )
92 {
93  //stations = sm.GetService('invCache').GetInventory(const.containerGlobal).ListStations(blueprintOnly, isCorp)
94 
95  call.Dump(CHARACTER__DEBUG);
96  std::ostringstream flagIDs;
97  flagIDs << flagHangar;
100  uint32 ownerID(m_ownerID);
101  bool bpOnly(PyRep::IntegerValue(call.tuple->GetItem(0)));
102  bool isCorp(PyRep::IntegerValue(call.tuple->GetItem(1)));
103 
104  if (isCorp) {
105  Client* pClient = sEntityList.FindClientByCharID(m_ownerID);
106  if (pClient == nullptr)
107  return nullptr; // make error here
108  ownerID = pClient->GetCorporationID();
109  // add corp hangar flags
110  flagIDs << "," << flagCorpHangar2 << "," << flagCorpHangar3 << "," << flagCorpHangar4 << ",";
111  flagIDs << flagCorpHangar5 << "," << flagCorpHangar6 << "," << flagCorpHangar7;
112  }
113 
114  return CharacterDB::ListStations(ownerID, flagIDs, isCorp, bpOnly);
115 }
116 
117 PyResult CharMgrBound::Handle_ListStationBlueprintItems( PyCallArgs& call )
118 {
119  // this is the BP tab of the S&I window
120  call.Dump(CHARACTER__DEBUG);
121 
126  uint32 ownerID(m_ownerID);
127 
128  uint32 locationID(PyRep::IntegerValueU32(call.tuple->GetItem(0)));
129  uint32 stationID(PyRep::IntegerValueU32(call.tuple->GetItem(1)));
130  bool forCorp(PyRep::IntegerValueU32(call.tuple->GetItem(2)));
131 
132  if (forCorp) { //forCorp
133  Client* pClient = sEntityList.FindClientByCharID(m_ownerID);
134  if (pClient == nullptr)
135  return nullptr; // make error here
136  ownerID = pClient->GetCorporationID();
137  }
138  return CharacterDB::ListStationBlueprintItems(ownerID, stationID, forCorp);
139 }
140 
141 
143 
145 : PyService(mgr, "charMgr"),
146  m_dispatch(new Dispatcher(this))
147 {
148  _SetCallDispatcher(m_dispatch);
149 
150  PyCallable_REG_CALL(CharMgrService, GetPublicInfo);
151  PyCallable_REG_CALL(CharMgrService, GetPublicInfo3);
152  PyCallable_REG_CALL(CharMgrService, GetPrivateInfo);
153  PyCallable_REG_CALL(CharMgrService, GetTopBounties);
154  PyCallable_REG_CALL(CharMgrService, AddToBounty);
155  PyCallable_REG_CALL(CharMgrService, GetContactList);
156  PyCallable_REG_CALL(CharMgrService, GetCloneTypeID);
157  PyCallable_REG_CALL(CharMgrService, GetHomeStation);
158  PyCallable_REG_CALL(CharMgrService, GetFactions);
159  PyCallable_REG_CALL(CharMgrService, SetActivityStatus);
160  PyCallable_REG_CALL(CharMgrService, GetSettingsInfo);
161  PyCallable_REG_CALL(CharMgrService, LogSettings);
162  PyCallable_REG_CALL(CharMgrService, GetCharacterDescription);
163  PyCallable_REG_CALL(CharMgrService, SetCharacterDescription);
164  PyCallable_REG_CALL(CharMgrService, GetPaperdollState);
167  PyCallable_REG_CALL(CharMgrService, AddOwnerNote);
168  PyCallable_REG_CALL(CharMgrService, GetOwnerNote);
169  PyCallable_REG_CALL(CharMgrService, GetOwnerNoteLabels);
170  PyCallable_REG_CALL(CharMgrService, AddContact);
171  PyCallable_REG_CALL(CharMgrService, EditContact);
172  PyCallable_REG_CALL(CharMgrService, DeleteContacts);
173  PyCallable_REG_CALL(CharMgrService, GetRecentShipKillsAndLosses);
174  PyCallable_REG_CALL(CharMgrService, BlockOwners);
175  PyCallable_REG_CALL(CharMgrService, UnblockOwners);
176  PyCallable_REG_CALL(CharMgrService, EditContactsRelationshipID);
177  PyCallable_REG_CALL(CharMgrService, GetImageServerLink);
178  //these 2 are for labels in PnP window;
180  PyCallable_REG_CALL(CharMgrService, CreateLabel);
181 }
182 
184  delete m_dispatch;
185 }
186 
188  _log(CHARACTER__BIND, "CharMgrService bind request:");
189  bind_args->Dump(CHARACTER__BIND, " ");
190  Call_TwoIntegerArgs args;
191  //crap
192  PyRep* tmp(bind_args->Clone());
193  if (!args.Decode(&tmp)) {
194  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
195  return nullptr;
196  }
197 
198  return new CharMgrBound(m_manager, args.arg1, args.arg2);
199 }
200 
201 PyResult CharMgrService::Handle_GetImageServerLink( PyCallArgs& call )
202 {
203  // only called by billboard service for bounties...
204  // serverLink = sm.RemoteSvc('charMgr').GetImageServerLink()
205  std::stringstream urlBuilder;
206  urlBuilder << "http://" << sConfig.net.imageServer << ":" << sConfig.net.imageServerPort << "/";
207 
208  return new PyString(urlBuilder.str());
209 }
210 
211 PyResult CharMgrService::Handle_GetRecentShipKillsAndLosses( PyCallArgs& call )
212 { /* cached object - can return db object as DBResultToCRowset*/
213  return m_db.GetKillOrLoss(call.client->GetCharacterID());
214 }
215 
216 PyResult CharMgrService::Handle_GetTopBounties( PyCallArgs& call )
217 {
218  return m_db.GetTopBounties();
219 }
220 
221 PyResult CharMgrService::Handle_GetLabels( PyCallArgs& call )
222 {
223  return m_db.GetLabels(call.client->GetCharacterID());
224 }
225 
226 PyResult CharMgrService::Handle_GetPaperdollState( PyCallArgs& call )
227 {
229 }
230 
231 PyResult CharMgrService::Handle_GetPublicInfo3(PyCallArgs &call)
232 {
233  Call_SingleIntegerArg arg;
234  if(!arg.Decode(&call.tuple)) {
235  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
236  return nullptr;
237  }
238 
239  return m_db.GetCharPublicInfo3(arg.arg);
240 }
241 
242 PyResult CharMgrService::Handle_GetContactList(PyCallArgs &call)
243 {
244  PyDict* dict = new PyDict();
245  dict->SetItemString("addresses", m_db.GetContacts(call.client->GetCharacterID(), false));
246  dict->SetItemString("blocked", m_db.GetContacts(call.client->GetCharacterID(), true));
247  PyObject* args = new PyObject("util.KeyVal", dict);
248  if (is_log_enabled(CLIENT__RSP_DUMP))
249  args->Dump(CLIENT__RSP_DUMP, "");
250  return args;
251 }
252 
253 PyResult CharMgrService::Handle_GetPrivateInfo( PyCallArgs& call )
254 {
255  // self.memberinfo = self.charMgr.GetPrivateInfo(self.charID)
256  // this is called by corp/editMember
257 
258  // single int arg: charid
259  Call_SingleIntegerArg arg;
260  if(!arg.Decode(&call.tuple)) {
261  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
262  return nullptr;
263  }
264 
265  PyRep* args(m_db.GetCharPrivateInfo(arg.arg));
266  if (is_log_enabled(CLIENT__RSP_DUMP))
267  args->Dump(CLIENT__RSP_DUMP, "");
268  return args;
269 }
270 
271 PyResult CharMgrService::Handle_GetPublicInfo(PyCallArgs &call) {
272  //single int arg: char id or corp id
273  Call_SingleIntegerArg arg;
274  if(!arg.Decode(&call.tuple)) {
275  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
276  return nullptr;
277  }
278 
279  /*if(IsAgent(args.arg)) {
280  //handle agents special right now...
281  PyRep *result = m_db.GetAgentPublicInfo(args.arg);
282  if(result == nullptr) {
283  codelog(CLIENT__ERROR, "%s: Failed to find agent %u", call.client->GetName(), args.arg);
284  return nullptr;
285  }
286  return result;
287  }*/
288 
289  PyRep *result = m_db.GetCharPublicInfo(arg.arg);
290  if (result == nullptr)
291  codelog(CHARACTER__ERROR, "%s: Failed to find char %u", call.client->GetName(), arg.arg);
292 
293  return result;
294 }
295 
296 PyResult CharMgrService::Handle_AddToBounty( PyCallArgs& call )
297 {
298  Call_TwoIntegerArgs args;
299  if (!args.Decode(&call.tuple)) {
300  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
301  return nullptr;
302  }
303 
304  if (call.client->GetCharacterID() == args.arg1){
305  call.client->SendErrorMsg("You cannot put a bounty on yourself.");
306  return nullptr;
307  }
308 
309  if (args.arg2 < call.client->GetBalance()) {
310  std::string reason = "Placing Bounty on ";
311  reason += m_db.GetCharName(args.arg1);
313  m_db.AddBounty(args.arg1, call.client->GetCharacterID(), args.arg2);
314  // new system gives target a mail from concord about placement of bounty and char name placing it.
315  } else {
316  std::map<std::string, PyRep *> res;
317  res["amount"] = new PyFloat(args.arg2);
318  res["balance"] = new PyFloat(call.client->GetBalance());
319  throw UserError ("NotEnoughMoney")
320  .AddISK ("amount", args.arg2)
321  .AddISK ("balance", call.client->GetBalance ());
322  }
323 
324  return PyStatic.NewNone();
325 }
326 
327 PyResult CharMgrService::Handle_GetCloneTypeID( PyCallArgs& call )
328 {
329  uint32 typeID;
330  if (!m_db.GetActiveCloneType(call.client->GetCharacterID(), typeID ) )
331  {
332  // This should not happen, because a clone is created at char creation.
333  // We don't have a clone, so return a basic one. cloneTypeID = 9917 (Clone Grade Delta)
334  typeID = 9917;
335  sLog.Debug( "CharMgrService", "Returning a basic clone for Char %u of type %u", call.client->GetCharacterID(), typeID );
336  }
337  return new PyInt(typeID);
338 }
339 
340 PyResult CharMgrService::Handle_GetHomeStation( PyCallArgs& call )
341 {
342  uint32 stationID = 0;
343  if (!CharacterDB::GetCharHomeStation(call.client->GetCharacterID(), stationID) ) {
344  sLog.Error( "CharMgrService", "Could't get the home station for Char %u", call.client->GetCharacterID() );
345  return PyStatic.NewNone();
346  }
347  return new PyInt(stationID);
348 }
349 
350 PyResult CharMgrService::Handle_SetActivityStatus( PyCallArgs& call ) {
351  Call_TwoIntegerArgs args;
352  if(!args.Decode(&call.tuple)) {
353  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
354  return nullptr;
355  }
356 
357  sLog.Cyan("CharMgrService::SetActivityStatus()", "Player %s(%u) AFK:%s, time:%i.", \
358  call.client->GetName(), call.client->GetCharacterID(), (args.arg1 ? "true" : "false"), args.arg2);
359 
360  if (args.arg1) {
361  call.client->SetAFK(true);
362  } else {
363  call.client->SetAFK(false);
364  }
365 
366  // call code here to set an AFK watchdog? config option?
367  // returns nothing
368  return nullptr;
369 }
370 
371 PyResult CharMgrService::Handle_GetCharacterDescription(PyCallArgs &call)
372 {
373  //takes characterID
374  Call_SingleIntegerArg args;
375  if(!args.Decode(&call.tuple)) {
376  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
377  return nullptr;
378  }
379 
380  sItemFactory.SetUsingClient(call.client);
381  CharacterRef c = sItemFactory.GetCharacter(args.arg);
382  if (!c ) {
383  _log(CHARACTER__ERROR, "GetCharacterDescription failed to load character %u.", args.arg);
384  return nullptr;
385  }
386 
387  return new PyString(c->description());
388 }
389 
390 PyResult CharMgrService::Handle_SetCharacterDescription(PyCallArgs &call)
391 {
392  //takes WString of bio
393  Call_SingleStringArg args;
394  if(!args.Decode(&call.tuple)) {
395  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
396  return nullptr;
397  }
398 
399  CharacterRef c = call.client->GetChar();
400  if (!c ) {
401  _log(CHARACTER__ERROR, "SetCharacterDescription called with no char!");
402  return nullptr;
403  }
404  c->SetDescription(args.arg.c_str());
405 
406  return nullptr;
407 }
408 
413 PyResult CharMgrService::Handle_GetSettingsInfo( PyCallArgs& call ) {
425  // Called in file "carbon/client/script/ui/services/settingsSvc.py"
426  // This should return a marshaled python function.
427  // It returns a tuple containing a dict that is then sent to
428  // charMgr::LogSettings if the tuple has a length greater than zero.
429  PyTuple* res = new PyTuple( 2 );
430  // This returns an empty tuple
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
440  };
441  int codeLen = sizeof(code) / sizeof(*code);
442  std::string codeString(code, code + codeLen);
443  res->items[ 0 ] = new PyString(codeString);
444 
445  // error code? 0 = no error
446  // if called with any value other than zero the exception output will show 'Verified = False'
447  // if called with zero 'Verified = True'
448  /* Just a note
449  * due to the client being in placebo mode, the verification code in evecrypto just checks if the signature is 0.
450  * when the client is in cryptoapi mode it verifies the signature is signed by CCP's rsa key.
451  */
452 
453  res->items[ 1 ] = new PyInt( 0 );
454  return res;
455 }
456 
457 // this is a return call from client after GetSettingsInfo
458 PyResult CharMgrService::Handle_LogSettings( PyCallArgs& call ) {
459  /*
460  * [PyTuple 1 items]
461  * [PyTuple 2 items]
462  * [PyInt 0]
463  * [PySubStream 734 bytes]
464  * [PyTuple 4 items]
465  * [PyInt 1]
466  * [PyString "LogSettings"]
467  * [PyTuple 1 items]
468  * [PyDict 36 kvp]
469  * [PyString "locale"]
470  * [PyString "en_US"]
471  * [PyString "shadowquality"]
472  * [PyInt 1]
473  * [PyString "video_vendorid"]
474  * [PyIntegerVar 4318]
475  * [PyString "dronemodelsenabled"]
476  * [PyInt 1]
477  * [PyString "loadstationenv2"]
478  * [PyInt 1]
479  * [PyString "video_deviceid"]
480  * [PyIntegerVar 3619]
481  * [PyString "camerashakesenabled"]
482  * [PyInt 1]
483  * [PyString "interiorshaderquality"]
484  * [PyInt 0]
485  * [PyString "presentation_interval"]
486  * [PyInt 1]
487  * [PyString "windowed_resolution"]
488  * [PyString "1440x900"]
489  * [PyString "explosioneffectssenabled"]
490  * [PyInt 1]
491  * [PyString "uiscalingfullscreen"]
492  * [PyFloat 1]
493  * [PyString "lod"]
494  * [PyInt 1]
495  * [PyString "audioenabled"]
496  * [PyInt 1]
497  * [PyString "voiceenabled"]
498  * [PyInt 1]
499  * [PyString "autodepth_stencilformat"]
500  * [PyInt 75]
501  * [PyString "hdrenabled"]
502  * [PyInt 1]
503  * [PyString "backbuffer_format"]
504  * [PyInt 22]
505  * [PyString "effectssenabled"]
506  * [PyInt 1]
507  * [PyString "breakpadUpload"]
508  * [PyInt 1]
509  * [PyString "windowed"]
510  * [PyBool True]
511  * [PyString "transgaming"]
512  * [PyBool False]
513  * [PyString "missilesenabled"]
514  * [PyInt 1]
515  * [PyString "sunocclusion"]
516  * [PyInt 1]
517  * [PyString "optionalupgrade"]
518  * [PyInt 0]
519  * [PyString "uiscalingwindowed"]
520  * [PyFloat 1]
521  * [PyString "textureqality"]
522  * [PyInt 0]
523  * [PyString "interiorgraphicsquality"]
524  * [PyInt 0]
525  * [PyString "antialiasing"]
526  * [PyInt 2]
527  * [PyString "defaultDockingView"]
528  * [PyString "hangar"]
529  * [PyString "turretsenabled"]
530  * [PyInt 1]
531  * [PyString "advancedcamera"]
532  * [PyInt 0]
533  * [PyString "postprocessing"]
534  * [PyInt 1]
535  * [PyString "fixedwindow"]
536  * [PyBool False]
537  * [PyString "shaderquality"]
538  * [PyInt 3]
539  * [PyString "fullscreen_resolution"]
540  * [PyString "1440x900"]
541  * [PyDict 1 kvp]
542  * [PyString "machoVersion"]
543  * [PyInt 1]
544  */
545  sLog.Warning( "CharMgrService::Handle_LogSettings()", "size= %u", call.tuple->size() );
546  call.Dump(CHARACTER__TRACE);
547  return nullptr;
548 }
549 
550 //17:09:10 L CharMgrService::Handle_GetNote(): size= 1
551 PyResult CharMgrService::Handle_GetNote( PyCallArgs& call )
552 {
553  uint32 ownerID = call.client->GetCharacterID();
554  uint32 itemID = call.tuple->GetItem(0)->AsInt()->value();
555 
556  PyString *str = m_db.GetNote(ownerID, itemID);
557  if(!str)
558  str = new PyString("");
559 
560  return str;
561 }
562 
563 PyResult CharMgrService::Handle_SetNote(PyCallArgs &call)
564 {
565  Call_SetNote args;
566  if(!args.Decode(&call.tuple)) {
567  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
568  return nullptr;
569  }
570 
571  m_db.SetNote(call.client->GetCharacterID(), args.itemID, args.note.c_str());
572 
573  return PyStatic.NewNone();
574 }
575 
576 PyResult CharMgrService::Handle_AddOwnerNote( PyCallArgs& call ) {
577  /*
578  15:51:12 Server: AddOwnerNote call made to charMgr
579  15:51:12 [SvcCall] Service charMgr: calling AddOwnerNote
580  15:51:12 CharMgrService::Handle_AddOwnerNote(): size=2
581  15:51:12 [SvcCall] Call Arguments:
582  15:51:12 [SvcCall] Tuple: 2 elements
583  15:51:12 [SvcCall] [ 0] String: 'S:Folders'
584  15:51:12 [SvcCall] [ 1] WString: '1::F::0::Main|'
585  15:51:12 [SvcCall] Call Named Arguments:
586  15:51:12 [SvcCall] Argument 'machoVersion':
587  15:51:12 [SvcCall] Integer field: 1
588 
589  15:54:45 Server: AddOwnerNote call made to charMgr
590  15:54:45 [SvcCall] Service charMgr: calling AddOwnerNote
591  15:54:45 CharMgrService::Handle_AddOwnerNote(): size=2
592  15:54:45 [SvcCall] Call Arguments:
593  15:54:45 [SvcCall] Tuple: 2 elements
594  15:54:45 [SvcCall] [ 0] String: 'S:Folders'
595  15:54:45 [SvcCall] [ 1] WString: '1::F::0::Main|2::F::0::test|'
596  15:54:45 [SvcCall] Call Named Arguments:
597  15:54:45 [SvcCall] Argument 'machoVersion':
598  15:54:45 [SvcCall] Integer field: 1
599 
600  10:41:26 W CharMgrService::Handle_GetOwnerNoteLabels(): size= 0
601  10:41:26 [CharDebug] Call Arguments:
602  10:41:26 [CharDebug] Tuple: Empty
603  10:41:26 [CharDebug] Named Arguments:
604  10:41:26 [CharDebug] machoVersion
605  10:41:26 [CharDebug] Integer: 1
606  10:41:39 [Service] charMgr::AddOwnerNote()
607  10:41:39 W CharMgrService::Handle_AddOwnerNote(): size=2
608  10:41:39 [CharDebug] Call Arguments:
609  10:41:39 [CharDebug] Tuple: 2 elements
610  10:41:39 [CharDebug] [ 0] WString: 'N:testing this shit'
611  10:41:39 [CharDebug] [ 1] String: '<br>'
612  10:41:39 [CharDebug] Named Arguments:
613  10:41:39 [CharDebug] machoVersion
614  10:41:39 [CharDebug] Integer: 1
615 
616  /../carbon/client/script/ui/control/buttons.py(245) OnClick
617  /client/script/ui/shared/neocom/notepad.py(706) NewNote
618  /client/script/ui/shared/neocom/notepad.py(581) ShowNote
619  id = 'None'
620  self = form.Notepad object at 0x4052ac30, name=notepad, destroyed=False>
621  force = 0
622  t = 'N'
623  noteID = ['N', 'None']
624  ValueError: invalid literal for int() with base 10: 'None'
625 
626  /client/script/ui/shared/neocom/notepad.py(802) OnClick
627  /client/script/ui/shared/neocom/notepad.py(581) ShowNote
628  id = 'None'
629  self = form.Notepad object at 0x4052ac30, name=notepad, destroyed=False>
630  force = 0
631  t = 'N'
632  noteID = ['N', 'None']
633  ValueError: invalid literal for int() with base 10: 'None'
634 
635  10:57:20 W CharMgrService::Handle_AddOwnerNote(): size=2
636  10:57:20 [CharDebug] Call Arguments:
637  10:57:20 [CharDebug] Tuple: 2 elements
638  10:57:20 [CharDebug] [ 0] WString: 'N:new note in new folder'
639  10:57:20 [CharDebug] [ 1] String: '<br>'
640  10:57:20 [CharDebug] Named Arguments:
641  10:57:20 [CharDebug] machoVersion
642  10:57:20 [CharDebug] Integer: 1
643 
644  /client/script/ui/shared/neocom/notepad.py(706) NewNote
645  /client/script/ui/shared/neocom/notepad.py(581) ShowNote
646  id = 'None'
647  self = form.Notepad object at 0x4052ac30, name=notepad, destroyed=False>
648  force = 0
649  t = 'N'
650  noteID = ['N', 'None']
651  ValueError: invalid literal for int() with base 10: 'None'
652 
653  on notepad close....
654  10:58:09 [Service] charMgr::AddOwnerNote()
655  10:58:09 W CharMgrService::Handle_AddOwnerNote(): size=2
656  10:58:09 [CharDebug] Call Arguments:
657  10:58:09 [CharDebug] Tuple: 2 elements
658  10:58:09 [CharDebug] [ 0] String: 'S:Folders'
659  10:58:09 [CharDebug] [ 1] WString: '1::F::0::Main|2::F::0::added folder|3::N::2::None|'
660  10:58:09 [CharDebug] Named Arguments:
661  10:58:09 [CharDebug] machoVersion
662  10:58:09 [CharDebug] Integer: 1
663 
664 
665  */
666 
667  sLog.Warning( "CharMgrService::Handle_AddOwnerNote()", "size=%u ", call.tuple->size());
668  call.Dump(CHARACTER__DEBUG);
669 
670  return nullptr;
671 }
672 
673 
674 PyResult CharMgrService::Handle_GetOwnerNote(PyCallArgs &call)
675 { /*
676  [PyObjectEx Type2]
677  [PyTuple 2 items]
678  [PyTuple 1 items]
679  [PyToken dbutil.CRowset]
680  [PyDict 1 kvp]
681  [PyString "header"]
682  [PyObjectEx Normal]
683  [PyTuple 2 items]
684  [PyToken blue.DBRowDescriptor]
685  [PyTuple 1 items]
686  [PyTuple 6 items]
687  [PyTuple 2 items]
688  [PyString "noteDate"]
689  [PyInt 64]
690  [PyTuple 2 items]
691  [PyString "typeID"]
692  [PyInt 2]
693  [PyTuple 2 items]
694  [PyString "referenceID"]
695  [PyInt 3]
696  [PyTuple 2 items]
697  [PyString "note"]
698  [PyInt 130]
699  [PyTuple 2 items]
700  [PyString "userID"]
701  [PyInt 3]
702  [PyTuple 2 items]
703  [PyString "label"]
704  [PyInt 130]
705  [PyPackedRow 19 bytes]
706  ["noteDate" => <129041092800000000> [FileTime]]
707  ["typeID" => <1> [I2]]
708  ["referenceID" => <1661059544> [I4]]
709  ["note" => <1::F::0::Main|> [WStr]]
710  ["userID" => <0> [I4]]
711  ["label" => <S:Folders> [WStr]]
712  */
713 
714  sLog.Warning( "CharMgrService::Handle_GetOwnerNote()", "size= %u", call.tuple->size() );
715  call.Dump(CHARACTER__DEBUG);
716  return nullptr;
717  //return m_db.GetOwnerNote(call.client->GetCharacterID());
718 }
719 
720 PyResult CharMgrService::Handle_GetOwnerNoteLabels(PyCallArgs &call)
721 { /*
722  [PyObjectEx Type2]
723  [PyTuple 2 items]
724  [PyTuple 1 items]
725  [PyToken dbutil.CRowset]
726  [PyDict 1 kvp]
727  [PyString "header"]
728  [PyObjectEx Normal]
729  [PyTuple 2 items]
730  [PyToken blue.DBRowDescriptor]
731  [PyTuple 1 items]
732  [PyTuple 2 items]
733  [PyTuple 2 items]
734  [PyString "noteID"]
735  [PyInt 3]
736  [PyTuple 2 items]
737  [PyString "label"]
738  [PyInt 130]
739  [PyPackedRow 5 bytes]
740  ["noteID" => <4424362> [I4]]
741  ["label" => <S:Folders> [WStr]]
742  [PyPackedRow 5 bytes]
743  ["noteID" => <4424363> [I4]]
744  ["label" => <N:Ratting - Chaining Rules> [WStr]]
745  [PyPackedRow 5 bytes]
746  ["noteID" => <4424364> [I4]]
747  ["label" => <N:Harbinger Training Schedule> [WStr]]
748  [PyPackedRow 5 bytes]
749  ["noteID" => <4424365> [I4]]
750  ["label" => <N:Damage Types for Races and Rats> [WStr]]
751  [PyPackedRow 5 bytes]
752  ["noteID" => <5332889> [I4]]
753  ["label" => <N:KES Link> [WStr]]
754  [PyPackedRow 5 bytes]
755  ["noteID" => <5536321> [I4]]
756  ["label" => <N:Pelorn's PvP Route> [WStr]]
757  [PyNone]
758 */
759  sLog.Warning( "CharMgrService::Handle_GetOwnerNoteLabels()", "size= %u", call.tuple->size() );
760  call.Dump(CHARACTER__DEBUG);
761 
763 }
764 
769 //18:07:30 L CharMgrService::Handle_AddContact(): size=1, 0=Integer(2784)
770 //18:07:35 L CharMgrService::Handle_AddContact(): size=1, 0=Integer(63177)
771 PyResult CharMgrService::Handle_AddContact( PyCallArgs& call )
772 {
773  sLog.Warning( "CharMgrService::Handle_AddContact()", "size=%u ", call.tuple->size());
774  call.Dump(CHARACTER__DEBUG);
775 
776  Call_AddContact args;
777  if (!args.Decode(&call.tuple)) {
778  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
779  return nullptr;
780  }
781 
782  //TODO: Notify char that they have been added as a contact if notify is True
783 
784  m_db.AddContact(call.client->GetCharacterID(), args.charID, args.standing, args.inWatchlist);
785  return nullptr;
786 }
787 
788 PyResult CharMgrService::Handle_EditContact( PyCallArgs& call )
789 {
790  sLog.Warning( "CharMgrService::Handle_EditContact()", "size=%u ", call.tuple->size());
791  call.Dump(CHARACTER__DEBUG);
792 
793  Call_AddContact args;
794  if (!args.Decode(&call.tuple)) {
795  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
796  return nullptr;
797  }
798 
799  m_db.UpdateContact(args.standing, args.charID, call.client->GetCharacterID());
800  return nullptr;
801 }
802 
803 PyResult CharMgrService::Handle_CreateLabel( PyCallArgs& call )
804 {
805  sLog.Warning( "CharMgrService::Handle_CreateLabel()", "size=%u ", call.tuple->size());
806  call.Dump(CHARACTER__DEBUG);
807 
808  return nullptr;
809 }
810 
811 PyResult CharMgrService::Handle_DeleteContacts( PyCallArgs& call )
812 {
813  // sm.RemoteSvc('charMgr').DeleteContacts([contactIDs])
814 
815  sLog.Warning( "CharMgrService::Handle_DeleteContacts()", "size=%u ", call.tuple->size());
816  call.Dump(CHARACTER__DEBUG);
817 
818  Call_RemoveCorporateContacts args;
819  if (!args.Decode(&call.tuple)) {
820  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
821  return nullptr;
822  }
823 
824  for (PyList::const_iterator itr = args.contactIDs->begin(); itr != args.contactIDs->end(); ++itr) {
826  }
827 
828  return nullptr;
829 }
830 
831 PyResult CharMgrService::Handle_BlockOwners( PyCallArgs& call )
832 {
833  // sm.RemoteSvc('charMgr').BlockOwners([ownerID])
834  sLog.Warning( "CharMgrService::Handle_BlockOwners()", "size=%u ", call.tuple->size());
835  call.Dump(CHARACTER__DEBUG);
836 
837  Call_RemoveCorporateContacts args;
838  if (!args.Decode(&call.tuple)) {
839  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
840  return nullptr;
841  }
842 
843  for (PyList::const_iterator itr = args.contactIDs->begin(); itr != args.contactIDs->end(); ++itr) {
845  }
846 
847  return nullptr;
848 }
849 
850 PyResult CharMgrService::Handle_UnblockOwners( PyCallArgs& call )
851 {
852  // sm.RemoteSvc('charMgr').UnblockOwners(blocked)
853  sLog.Warning( "CharMgrService::Handle_UnblockOwners()", "size=%u ", call.tuple->size());
854  call.Dump(CHARACTER__DEBUG);
855 
856  Call_RemoveCorporateContacts args;
857  if (!args.Decode(&call.tuple)) {
858  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
859  return nullptr;
860  }
861 
862  for (PyList::const_iterator itr = args.contactIDs->begin(); itr != args.contactIDs->end(); ++itr) {
864  }
865 
866  return nullptr;
867 }
868 
869 PyResult CharMgrService::Handle_EditContactsRelationshipID( PyCallArgs& call )
870 {
871  /*
872  sm.RemoteSvc('charMgr').EditContactsRelationshipID(contactIDs, relationshipID)
873  */
874  sLog.Warning( "CharMgrService::Handle_EditContactsRelationshipID()", "size=%u ", call.tuple->size());
875  call.Dump(CHARACTER__DEBUG);
876 
877  Call_EditCorporateContacts args;
878  if (!args.Decode(&call.tuple)) {
879  codelog(SERVICE__ERROR, "%s: Failed to decode arguments.", GetName());
880  return nullptr;
881  }
882 
883  for (PyList::const_iterator itr = args.contactIDs->begin(); itr != args.contactIDs->end(); ++itr) {
884  m_db.UpdateContact(args.relationshipID, PyRep::IntegerValueU32(*itr), call.tuple->size());
885  }
886 
887  return nullptr;
888 }
889 
890 PyResult CharMgrService::Handle_GetFactions( PyCallArgs& call )
891 {
892  sLog.Warning( "CharMgrService::Handle_GetFactions()", "size= %u", call.tuple->size() );
893  call.Dump(CHARACTER__TRACE);
894  return nullptr;
895 }
CharMgrBound(PyServiceMgr *mgr, uint32 ownerID, uint16 contFlag)
Base Python wire object.
Definition: PyRep.h:66
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,...)
Definition: Client.cpp:2719
CharacterDB m_db
virtual void Release()
#define _log(type, fmt,...)
Definition: logsys.h:124
PyRep * GetItem(size_t index) const
Returns Python object.
Definition: PyRep.h:602
Python string.
Definition: PyRep.h:430
int32 value() const
Definition: PyRep.h:247
Python's dictionary.
Definition: PyRep.h:719
size_t size() const
Definition: PyRep.h:591
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.
Definition: PyRep.h:292
int32 GetCharacterID() const
Definition: Client.h:113
int32 GetCorporationID() const
Definition: Client.h:123
void SetAFK(bool set=true)
Definition: Client.h:97
#define sEntityList
Definition: EntityList.h:208
storage_type::const_iterator const_iterator
Definition: PyRep.h:644
uint16 m_containerFlag
static uint32 IntegerValueU32(PyRep *pRep)
Definition: PyRep.cpp:134
std::string m_strBoundObjectName
Definition: PyBoundObject.h:54
CharacterRef GetChar() const
Definition: Client.h:164
Python tuple.
Definition: PyRep.h:567
const char * GetName() const
Definition: PyService.h:54
void Dump(FILE *into, const char *pfx) const
Dumps object to file.
Definition: PyRep.cpp:84
PyRep * GetKillOrLoss(uint32 charID)
void AddContact(uint32 ownerID, uint32 charID, int32 standing, bool inWatchlist)
PyRep * GetCharPublicInfo(uint32 charID)
void _SetCallDispatcher(CallDispatcher *d)
Definition: PyCallable.h:87
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)
* args
#define is_log_enabled(type)
Definition: logsys.h:78
#define sLog
Evaluates to a NewLog instance.
Definition: LogNew.h:250
Python object.
Definition: PyRep.h:826
PyCallable_Make_Dispatcher(CharMgrBound)
#define codelog(type, fmt,...)
Definition: logsys.h:128
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)
Python integer.
Definition: PyRep.h:231
virtual ~CharMgrBound()
PyServiceMgr *const m_manager
Definition: PyService.h:91
#define PyStatic
Definition: PyRep.h:1209
const char * GetName() const
Definition: Client.h:94
Client *const client
Definition: PyCallable.h:49
Python object "ccp_exceptions.UserError".
Definition: PyExceptions.h:121
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
Definition: Client.h:66
PyRep * GetLabels(uint32 charID)
unsigned __int32 uint32
Definition: eve-compat.h:50
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)
Definition: Client.h:176
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
Definition: PyCallable.cpp:81
#define sItemFactory
Definition: ItemFactory.h:165
storage_type items
Definition: PyRep.h:628
const std::string & description() const
Definition: Character.h:284
static int64 IntegerValue(PyRep *pRep)
Definition: PyRep.cpp:118
void SetDescription(const char *newDescription)
Definition: Character.cpp:421
PyInt * AsInt()
Definition: PyRep.h:122
static PyRep * List(uint32 ownerID)
unsigned __int16 uint16
Definition: eve-compat.h:48
Dispatcher *const m_dispatch
PyRep * GetTopBounties()
PyString * GetNote(uint32 ownerID, uint32 itemID)
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
PyTuple * tuple
Definition: PyCallable.h:50