EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PaperDollDB.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: Reve
24  Providing clothes to the poor
25  Updates: Allan
26 */
27 
28 #include "eve-server.h"
29 
30 #include "character/PaperDollDB.h"
31 
33 
34  DBQueryResult res;
35  if (!sDatabase.RunQuery(res,
36  "SELECT hairDarkness FROM avatars WHERE charID=%u", charID))
37  {
38  _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str());
39  return nullptr;
40  }
41 
42  DBResultRow row;
43  res.GetRow(row);
44 
45  return DBRowToRow(row, "util.Row");
46 }
47 
49 
50  DBQueryResult res;
51  if (!sDatabase.RunQuery(res,
52  "SELECT colorID, colorNameA, colorNameBC, weight, gloss FROM avatar_colors WHERE charID=%u", charID))
53  {
54  _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str());
55  return nullptr;
56  }
57 
58  return DBResultToCRowset(res);
59 }
60 
62 
63  DBQueryResult res;
64  if (!sDatabase.RunQuery(res,
65  "SELECT modifierLocationID, paperdollResourceID, paperdollResourceVariation FROM avatar_modifiers WHERE charID=%u", charID))
66  {
67  _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str());
68  return nullptr;
69  }
70 
71  return DBResultToCRowset(res);
72 }
73 
75 
76  DBQueryResult res;
77  if (!sDatabase.RunQuery(res,
78  "SELECT sculptLocationID, weightUpDown, weightLeftRight, weightForwardBack FROM avatar_sculpts WHERE charID=%u", charID))
79  {
80  _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str());
81  return nullptr;
82  }
83 
84  return DBResultToCRowset(res);
85 }
86 
88 {
89  DBQueryResult res;
90  if (!sDatabase.RunQuery(res, "SELECT * FROM chrPortraitData WHERE charID = %u", charID)) {
91  _log(DATABASE__ERROR, "Error in GetMyPaperDollData query: %s", res.error.c_str());
92  return nullptr;
93  }
94 
95  return DBResultToCRowset(res);
96 }
Base Python wire object.
Definition: PyRep.h:66
PyRep * GetPaperDollAvatarColors(uint32 charID) const
Definition: PaperDollDB.cpp:48
#define sDatabase
Definition: dbcore.h:199
PyRep * GetPaperDollAvatarModifiers(uint32 charID) const
Definition: PaperDollDB.cpp:61
#define _log(type, fmt,...)
Definition: logsys.h:124
PyObjectEx * DBResultToCRowset(DBQueryResult &result)
Definition: EVEDBUtils.cpp:402
PyRep * GetPaperDollAvatar(uint32 charID) const
Definition: PaperDollDB.cpp:32
bool GetRow(DBResultRow &into)
Definition: dbcore.cpp:552
PyObject * DBRowToRow(DBResultRow &row, const char *type)
Definition: EVEDBUtils.cpp:208
const char * c_str() const
Definition: dbcore.h:48
unsigned __int32 uint32
Definition: eve-compat.h:50
DBerror error
Definition: dbcore.h:69
PyRep * GetPaperDollPortraitData(uint32 charID) const
Definition: PaperDollDB.cpp:87
PyRep * GetPaperDollAvatarSculpts(uint32 charID) const
Definition: PaperDollDB.cpp:74