EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CharacterDB.h
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 #ifndef __CHARACTERDB_H_INCL__
28 #define __CHARACTERDB_H_INCL__
29 
30 #include "ServiceDB.h"
31 
32 // struct for portraitInfo
33 struct PortraitInfo {
37  float cameraX;
38  float cameraY;
39  float cameraZ;
41  float cameraPoiX;
42  float cameraPoiY;
43  float cameraPoiZ;
49  float headTilt;
50  float orientChar;
51  float browLeftCurl;
57  float eyeClose;
60  float squintLeft;
61  float squintRight;
62  float jawSideways;
63  float jawUp;
64  float puckerLips;
65  float frownLeft;
66  float frownRight;
67  float smileLeft;
68  float smileRight;
69 };
70 
71 /* POD structure for skills in queue */
72 struct QueuedSkill {
77 };
78 typedef std::vector<QueuedSkill> SkillQueue;
79 
80 class PyObject;
81 class PyString;
82 class PyObjectEx;
83 class CharacterData;
85 class CharKillData;
86 class ItemFactory;
87 class InventoryItem;
88 class Client;
89 class ItemData;
90 class CorpData;
91 
92 class CharacterDB : public ServiceDB
93 {
94 public:
95  static uint32 NewCharacter(const CharacterData& data, const CorpData& corpData);
96  static bool SaveCharacter(uint32 charID, const CharacterData &data);
97  static bool SaveCorpData(uint32 charID, const CorpData &data);
98  void DeleteCharacter(uint32 charID);
99  // this changes corp member counts, adds employment history, and updates char's corp and start date
100  static void AddEmployment(uint32 charID, uint32 corpID, uint32 oldCorpID=0);
101  static void GetCharacterData(uint32 charID, std::map<std::string, int64> &characterDataMap);
102  static bool GetCharHomeStation(uint32 charID, uint32 &stationID);
103  //if you want to get the typeID of the clone use GetActiveCloneType
104  static bool GetActiveCloneID(uint32 charID, uint32 &itemID);
105  static PyRep *GetInfoWindowDataForChar(uint32 charID);
106  static uint32 GetStartingStationByCareer(uint32 careerID);
107 
108  static PyRep* List(uint32 ownerID);
109  static PyRep* ListStations(uint32 ownerID, std::ostringstream& flagIDs, bool forCorp=false, bool bpOnly=false);
110  static PyRep* ListStationItems(uint32 ownerID, uint32 stationID);
111  static PyRep* ListStationBlueprintItems(uint32 ownerID, uint32 stationID, bool forCorp=false);
112 
113  PyRep *GetCharacterList(uint32 accountID);
114  PyRep *GetCharSelectInfo(uint32 charID);
115  void SetAvatar(uint32 charID, PyRep* hairDarkness);
116  void SetAvatarColors(uint32 charID, uint32 colorID, uint32 colorNameA, uint32 colorNameBC, double weight, double gloss);
117  void SetAvatarModifiers(uint32 charID, PyRep* modifierLocationID, PyRep* paperdollResourceID, PyRep* paperdollResourceVariation);
118  void SetAvatarSculpts(uint32 charID, PyRep* sculptLocationID, PyRep* weightUpDown, PyRep* weightLeftRight, PyRep* weightForwardBack);
119  void SetPortraitInfo(uint32 charID, PortraitInfo &data);
120  PyRep *GetCharPublicInfo(uint32 charID);
123 
124  //PyObject *GetAgentPublicInfo(uint32 agentID);
126  PyRep *GetOwnerNote(uint32 charID, uint32 noteID);
127  uint32 PickAlternateShip(uint32 charID, uint32 locationID);
128  void SetCurrentShip(uint32 charID, uint32 shipID);
129  void SetCurrentPod(uint32 charID, uint32 podID);
130 
131  bool ChangeCloneType(uint32 charID, uint32 typeID);
132  static bool ChangeCloneLocation(uint32 charID, uint32 locationID);
133  bool GetCharClones(uint32 charID, std::vector<uint32> &into);
134  bool GetActiveCloneType(uint32 charID, uint32 &typeID);
135  std::string GetCharName(uint32 charID);
136 
137  PyRep* GetContacts(uint32 charID, bool blocked);
138  void AddContact(uint32 ownerID, uint32 charID, int32 standing, bool inWatchlist);
139  void UpdateContact(int32 standing, uint32 charID, uint32 ownerID);
140  void RemoveContact(uint32 charID, uint32 ownerID);
141  void SetBlockContact(uint32 charID, uint32 ownerID, bool blocked);
142 
143  bool GetCharItems(uint32 charID, std::vector<uint32> &into);
144  bool GetCareerBySchool(uint32 schoolID, uint8 &raceID, uint32 &careerID);
145  bool GetCorporationBySchool(uint32 schoolID, uint32 &corporationID);
146  bool GetLocationCorporationByCareer(CharacterData &cdata, uint32 &corporationID);
147  bool DoesCorporationExist(uint32 corpID);
148 
160  bool GetAttributesFromAncestry(uint32 ancestryID, uint8 &intelligence, uint8 &charisma, uint8 &perception, uint8 &memory, uint8 &willpower);
161 
162  bool GetBaseSkills(std::map< uint32, uint8 >& into);
163  bool GetSkillsByRace(uint32 raceID, std::map< uint32, uint8 >& into);
164  bool GetSkillsByCareer(uint32 careerID, std::map< uint32, uint8 >& into);
165 
171  PyString* GetNote(uint32 ownerID, uint32 itemID);
172 
182  bool SetNote(uint32 ownerID, uint32 itemID, const char *str);
183 
184  uint32 AddOwnerNote(uint32 charID, const std::string &label, const std::string &content);
185  bool EditOwnerNote(uint32 charID, uint32 noteID, const std::string &label, const std::string &content);
186 
187  int64 PrepareCharacterForDelete(uint32 accountID, uint32 charID);
188  void CancelCharacterDeletePrepare(uint32 accountID, uint32 charID);
189 
190  bool ReportRespec(uint32 characterId);
191  PyRep* GetRespecInfo(uint32 characterId);
192 
200  bool LoadSkillQueue(uint32 charID, SkillQueue &into);
201  bool LoadPausedSkillQueue(uint32 charID, SkillQueue &into);
209  bool SaveSkillQueue(uint32 charID, SkillQueue &queue);
210  bool SavePausedSkillQueue(uint32 charID, SkillQueue &queue);
211  void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint32 skillTypeID, uint8 skillLevel, uint32 absolutePoints);
212  PyRep* GetSkillHistory(uint32 charID);
213  void UpdateSkillQueueEndTime(int64 endtime, uint32 charID);
214 
215  void SetLogInTime(uint32 charID);
216  void SetLogOffTime(uint32 charID);
217 
218  void addOwnerCache(uint32 ownerID, std::string ownerName, uint32 typeID);
219 
220  PyRep* GetBounty(uint32 charID, uint32 ownerID);
222  void AddBounty(uint32 charID, uint32 ownerID, uint32 amount);
223 
224  PyRep* GetKillOrLoss(uint32 charID);
225 
226  static void SetCorpRole(uint32 charID, int64 role);
227  static int64 GetCorpRole(uint32 charID);
228  static uint32 GetCorpID(uint32 charID);
229  static float GetCorpTaxRate(uint32 charID);
230  static PyRep* GetMyCorpMates(uint32 corpID);
231 
232  // get skill level for given skill for offline character (used by market tax)
233  static uint8 GetSkillLevel(uint32 charID, uint16 skillTypeID);
234 
235  PyRep* GetLabels(uint32 charID);
236  void SetLabel(uint32 charID, uint32 color, std::string name);
237  void EditLabel(uint32 charID, uint32 labelID, uint32 color, std::string name);
238  void DeleteLabel(uint32 charID, uint32 labelID);
239 
240  void VisitSystem(uint32 solarSystemID, uint32 charID);
241 
242  // name validation shit
243  void ValidateCharName(std::string name); // called on CreateCharacterWithDoll() and will throw on error
244  PyRep* ValidateCharNameRep(std::string name); // called by "Check Name" button in char creation. returns integer
245 };
246 
247 #endif
float cameraZ
Definition: CharacterDB.h:39
Base Python wire object.
Definition: PyRep.h:66
PyRep * GetCharPrivateInfo(uint32 charID)
float jawSideways
Definition: CharacterDB.h:62
unsigned __int8 uint8
Definition: eve-compat.h:46
bool LoadSkillQueue(uint32 charID, SkillQueue &into)
bool GetCharClones(uint32 charID, std::vector< uint32 > &into)
bool SetNote(uint32 ownerID, uint32 itemID, const char *str)
static bool ChangeCloneLocation(uint32 charID, uint32 locationID)
static float GetCorpTaxRate(uint32 charID)
static bool SaveCorpData(uint32 charID, const CorpData &data)
void SetAvatarColors(uint32 charID, uint32 colorID, uint32 colorNameA, uint32 colorNameBC, double weight, double gloss)
bool SaveSkillQueue(uint32 charID, SkillQueue &queue)
float smileLeft
Definition: CharacterDB.h:67
uint32 PickAlternateShip(uint32 charID, uint32 locationID)
Python string.
Definition: PyRep.h:430
PyRep * GetCharSelectInfo(uint32 charID)
void SetAvatarModifiers(uint32 charID, PyRep *modifierLocationID, PyRep *paperdollResourceID, PyRep *paperdollResourceVariation)
PyRep * GetRespecInfo(uint32 characterId)
float puckerLips
Definition: CharacterDB.h:64
float browRightTighten
Definition: CharacterDB.h:55
static bool SaveCharacter(uint32 charID, const CharacterData &data)
Definition: CharacterDB.cpp:66
bool EditOwnerNote(uint32 charID, uint32 noteID, const std::string &label, const std::string &content)
float frownLeft
Definition: CharacterDB.h:65
static bool GetCharHomeStation(uint32 charID, uint32 &stationID)
float eyeClose
Definition: CharacterDB.h:57
PyRep * GetCharacterList(uint32 accountID)
float browRightUpDown
Definition: CharacterDB.h:56
PyRep * GetOwnerNoteLabels(uint32 charID)
bool GetCharItems(uint32 charID, std::vector< uint32 > &into)
uint8 level
Definition: CharacterDB.h:73
static PyRep * GetMyCorpMates(uint32 corpID)
PyRep * GetBounty(uint32 charID, uint32 ownerID)
void UpdateContact(int32 standing, uint32 charID, uint32 ownerID)
float browRightCurl
Definition: CharacterDB.h:54
bool DoesCorporationExist(uint32 corpID)
void UpdateSkillQueueEndTime(int64 endtime, uint32 charID)
void SetLogOffTime(uint32 charID)
PyRep * GetSkillHistory(uint32 charID)
float headTilt
Definition: CharacterDB.h:49
PyRep * GetKillOrLoss(uint32 charID)
float eyesLookHorizontal
Definition: CharacterDB.h:59
void AddContact(uint32 ownerID, uint32 charID, int32 standing, bool inWatchlist)
PyRep * GetCharPublicInfo(uint32 charID)
void CancelCharacterDeletePrepare(uint32 accountID, uint32 charID)
signed __int32 int32
Definition: eve-compat.h:49
static PyRep * ListStations(uint32 ownerID, std::ostringstream &flagIDs, bool forCorp=false, bool bpOnly=false)
void DeleteCharacter(uint32 charID)
void addOwnerCache(uint32 ownerID, std::string ownerName, uint32 typeID)
static uint32 GetStartingStationByCareer(uint32 careerID)
static PyRep * GetInfoWindowDataForChar(uint32 charID)
bool GetAttributesFromAncestry(uint32 ancestryID, uint8 &intelligence, uint8 &charisma, uint8 &perception, uint8 &memory, uint8 &willpower)
float browLeftCurl
Definition: CharacterDB.h:51
int64 PrepareCharacterForDelete(uint32 accountID, uint32 charID)
int64 endTime
Definition: CharacterDB.h:75
Python extended object.
Definition: PyRep.h:861
void SetCurrentShip(uint32 charID, uint32 shipID)
bool SavePausedSkillQueue(uint32 charID, SkillQueue &queue)
float squintLeft
Definition: CharacterDB.h:60
Python object.
Definition: PyRep.h:826
void VisitSystem(uint32 solarSystemID, uint32 charID)
float browLeftTighten
Definition: CharacterDB.h:52
static uint8 GetSkillLevel(uint32 charID, uint16 skillTypeID)
uint32 lightID
Definition: CharacterDB.h:35
void SetBlockContact(uint32 charID, uint32 ownerID, bool blocked)
static PyRep * ListStationBlueprintItems(uint32 ownerID, uint32 stationID, bool forCorp=false)
float portraitPoseNumber
Definition: CharacterDB.h:48
float cameraFieldOfView
Definition: CharacterDB.h:40
float frownRight
Definition: CharacterDB.h:66
bool GetCareerBySchool(uint32 schoolID, uint8 &raceID, uint32 &careerID)
float orientChar
Definition: CharacterDB.h:50
static bool GetActiveCloneID(uint32 charID, uint32 &itemID)
static uint32 GetCorpID(uint32 charID)
Definition: Client.h:66
uint32 lightColorID
Definition: CharacterDB.h:36
int64 startTime
Definition: CharacterDB.h:76
PyRep * GetLabels(uint32 charID)
unsigned __int32 uint32
Definition: eve-compat.h:50
void AddBounty(uint32 charID, uint32 ownerID, uint32 amount)
bool GetSkillsByRace(uint32 raceID, std::map< uint32, uint8 > &into)
void EditLabel(uint32 charID, uint32 labelID, uint32 color, std::string name)
float headLookTargetY
Definition: CharacterDB.h:45
PyRep * GetContacts(uint32 charID, bool blocked)
PyRep * GetOwnerNote(uint32 charID, uint32 noteID)
bool LoadPausedSkillQueue(uint32 charID, SkillQueue &into)
PyRep * GetCharPublicInfo3(uint32 charID)
uint32 AddOwnerNote(uint32 charID, const std::string &label, const std::string &content)
static int64 GetCorpRole(uint32 charID)
uint32 backgroundID
Definition: CharacterDB.h:34
bool GetActiveCloneType(uint32 charID, uint32 &typeID)
float smileRight
Definition: CharacterDB.h:68
void SetAvatarSculpts(uint32 charID, PyRep *sculptLocationID, PyRep *weightUpDown, PyRep *weightLeftRight, PyRep *weightForwardBack)
void SetPortraitInfo(uint32 charID, PortraitInfo &data)
static PyRep * ListStationItems(uint32 ownerID, uint32 stationID)
void SetLogInTime(uint32 charID)
float cameraPoiX
Definition: CharacterDB.h:41
std::string GetCharName(uint32 charID)
static void GetCharacterData(uint32 charID, std::map< std::string, int64 > &characterDataMap)
float browLeftUpDown
Definition: CharacterDB.h:53
signed __int64 int64
Definition: eve-compat.h:51
void SetLabel(uint32 charID, uint32 color, std::string name)
void RemoveContact(uint32 charID, uint32 ownerID)
void SetAvatar(uint32 charID, PyRep *hairDarkness)
bool GetBaseSkills(std::map< uint32, uint8 > &into)
float cameraPoiZ
Definition: CharacterDB.h:43
static uint32 NewCharacter(const CharacterData &data, const CorpData &corpData)
Definition: CharacterDB.cpp:33
uint16 typeID
Definition: CharacterDB.h:74
std::vector< QueuedSkill > SkillQueue
Definition: CharacterDB.h:78
float headLookTargetZ
Definition: CharacterDB.h:46
bool ReportRespec(uint32 characterId)
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
static void AddEmployment(uint32 charID, uint32 corpID, uint32 oldCorpID=0)
float cameraX
Definition: CharacterDB.h:37
PyRep * ValidateCharNameRep(std::string name)
bool GetSkillsByCareer(uint32 careerID, std::map< uint32, uint8 > &into)
float lightIntensity
Definition: CharacterDB.h:47
bool GetCorporationBySchool(uint32 schoolID, uint32 &corporationID)
float headLookTargetX
Definition: CharacterDB.h:44
float eyesLookVertical
Definition: CharacterDB.h:58
void SetCurrentPod(uint32 charID, uint32 podID)
static void SetCorpRole(uint32 charID, int64 role)
static PyRep * List(uint32 ownerID)
unsigned __int16 uint16
Definition: eve-compat.h:48
void DeleteLabel(uint32 charID, uint32 labelID)
float cameraPoiY
Definition: CharacterDB.h:42
PyRep * GetTopBounties()
bool GetLocationCorporationByCareer(CharacterData &cdata, uint32 &corporationID)
PyString * GetNote(uint32 ownerID, uint32 itemID)
float cameraY
Definition: CharacterDB.h:38
float squintRight
Definition: CharacterDB.h:61
bool ChangeCloneType(uint32 charID, uint32 typeID)
void ValidateCharName(std::string name)
void SaveSkillHistory(uint16 eventID, double logDate, uint32 characterID, uint32 skillTypeID, uint8 skillLevel, uint32 absolutePoints)