EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PaperDollService.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: caytchen
24 */
25 
26 #include "eve-server.h"
27 
28 #include "PyServiceCD.h"
30 
32 
34 : PyService(mgr, "paperDollServer"),
35  m_dispatch(new Dispatcher(this))
36 {
37  _SetCallDispatcher(m_dispatch);
38 
39  PyCallable_REG_CALL(PaperDollService, GetPaperDollData);
40  PyCallable_REG_CALL(PaperDollService, GetMyPaperDollData);
41  PyCallable_REG_CALL(PaperDollService, ConvertAndSavePaperDoll);
42  PyCallable_REG_CALL(PaperDollService, GetPaperDollPortraitDataFor);
43  PyCallable_REG_CALL(PaperDollService, UpdateExistingCharacterFull);
44  PyCallable_REG_CALL(PaperDollService, UpdateExistingCharacterLimited);
45 }
46 
48  delete m_dispatch;
49 }
50 
51 //17:35:32 L PaperDollService::Handle_GetPaperDollData(): size=1
52 PyResult PaperDollService::Handle_GetPaperDollData(PyCallArgs &call) {
53  call.Dump(PLAYER__CALL_DUMP);
54  // this is called when viewing full body of a character.
55 
56  return m_db.GetPaperDollAvatarColors(call.tuple->GetItem(0)->AsInt()->value());
57 }
58 
59 PyResult PaperDollService::Handle_ConvertAndSavePaperDoll(PyCallArgs &call) {
60  call.Dump(PLAYER__CALL_DUMP);
61  return nullptr;
62 }
63 
64 PyResult PaperDollService::Handle_UpdateExistingCharacterFull(PyCallArgs &call) {
65  call.Dump(PLAYER__CALL_DUMP);
66  /*
67  sm.RemoteSvc('paperDollServer').UpdateExistingCharacterFull(charID, dollInfo, portraitInfo, dollExists)
68  */
69  return nullptr;
70 }
71 
72 PyResult PaperDollService::Handle_UpdateExistingCharacterLimited(PyCallArgs &call) {
73  call.Dump(PLAYER__CALL_DUMP);
74  /*
75  sm.RemoteSvc('paperDollServer').UpdateExistingCharacterLimited(charID, dollData, portraitInfo, dollExists)
76  */
77  /*)
78 00:46:38 [SvcCall] Service photoUploadSvc::Upload()
79 00:46:38 W ImageServer: ReportNewImage() called.
80 00:46:38 M PhotoUploadSvc: Received image from account 3, size: 57621
81 00:46:39 [SvcCall] Service paperDollServer::UpdateExistingCharacterLimited()
82 */
83  return nullptr;
84 }
85 
86 PyResult PaperDollService::Handle_GetPaperDollPortraitDataFor(PyCallArgs &call) {
87  // data = sm.RemoteSvc('paperDollServer').GetPaperDollPortraitDataFor(charID)
88  /*
89  portraitData = sm.GetService('cc').GetPortraitData(charID)
90  if portraitData is not None:
91  self.lightingID = portraitData.lightID
92  self.lightColorID = portraitData.lightColorID
93  self.lightIntensity = portraitData.lightIntensity
94  path = self.GetBackgroundPathFromID(portraitData.backgroundID)
95  if path in ccConst.backgroundOptions:
96  self.backdropPath = path
97  self.poseID = portraitData.portraitPoseNumber
98  self.cameraPos = (portraitData.cameraX, portraitData.cameraY, portraitData.cameraZ)
99  self.cameraPoi = (portraitData.cameraPoiX, portraitData.cameraPoiY, portraitData.cameraPoiZ)
100  self.cameraFov = portraitData.cameraFieldOfView
101  params = self.GetControlParametersFromPoseData(portraitData, fromDB=True).values()
102  self.characterSvc.SetControlParametersFromList(params, charID)
103  */
105 }
106 
107 PyResult PaperDollService::Handle_GetMyPaperDollData(PyCallArgs &call)
108 {
109  call.Dump(PLAYER__CALL_DUMP);
110 
111  PyDict* args = new PyDict;
112 
114  args->SetItemString( "modifiers", m_db.GetPaperDollAvatarModifiers(call.client->GetCharacterID()) );
115  args->SetItemString( "appearance", m_db.GetPaperDollAvatar(call.client->GetCharacterID()) );
117 
118  return new PyObject("util.KeyVal", args);
119 }
PyRep * GetPaperDollAvatarColors(uint32 charID) const
Definition: PaperDollDB.cpp:48
Dispatcher *const m_dispatch
PyRep * GetPaperDollAvatarModifiers(uint32 charID) const
Definition: PaperDollDB.cpp:61
PyRep * GetItem(size_t index) const
Returns Python object.
Definition: PyRep.h:602
PyRep * GetPaperDollAvatar(uint32 charID) const
Definition: PaperDollDB.cpp:32
int32 value() const
Definition: PyRep.h:247
virtual ~PaperDollService()
Python's dictionary.
Definition: PyRep.h:719
int32 GetCharacterID() const
Definition: Client.h:113
* args
Python object.
Definition: PyRep.h:826
Client *const client
Definition: PyCallable.h:49
#define PyCallable_REG_CALL(c, m)
Definition: PyServiceCD.h:78
Dispatcher *const m_dispatch
Deals with character image stuff.
PyCallable_Make_InnerDispatcher(PaperDollService) PaperDollService
PyRep * GetPaperDollPortraitData(uint32 charID) const
Definition: PaperDollDB.cpp:87
void Dump(LogType type) const
Definition: PyCallable.cpp:81
PyRep * GetPaperDollAvatarSculpts(uint32 charID) const
Definition: PaperDollDB.cpp:74
static int64 IntegerValue(PyRep *pRep)
Definition: PyRep.cpp:118
PyInt * AsInt()
Definition: PyRep.h:122
void SetItemString(const char *key, PyRep *value)
SetItemString adds or sets a database entry.
Definition: PyRep.h:812
PyTuple * tuple
Definition: PyCallable.h:50