EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
LSCDB.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, Aknor Jaden
24 */
25 
26 
27 #ifndef __LSCDB_H_INCL__
28 #define __LSCDB_H_INCL__
29 
30 #include "ServiceDB.h"
31 
32 class Client;
33 class LSCService;
34 class LSCChannel;
35 
36 class LSCDB
37 : public ServiceDB
38 {
39 public:
40  uint32 StoreMail(uint32 senderID, uint32 recipID, const char * subject, const char * message, int64 sentTime);
42  PyRep *GetMailDetails(uint32 messageID, uint32 readerID);
43  bool MarkMessageRead(uint32 messageID);
44  bool DeleteMessage(uint32 messageID, uint32 readerID);
45  void GetChannelNames(uint32 charID, std::vector<std::string> & names);
46 
48  bool IsChannelNameAvailable(std::string name);
49  bool IsChannelIDAvailable(int32 channel_ID);
50  bool IsChannelSubscribedByThisChar(uint32 char_ID, int32 channel_ID);
51 
52  std::string GetRegionName(uint32 id) { return GetChannelName(id, "mapRegions", "regionName", "regionID"); }
53  std::string GetConstellationName(uint32 id) { return GetChannelName(id, "mapConstellations", "constellationName", "constellationID"); }
54  std::string GetSolarSystemName(uint32 id) { return GetChannelName(id, "mapSolarSystems", "solarSystemName", "solarSystemID"); }
55  std::string GetCorporationName(uint32 id) { return GetChannelName(id, "crpCorporation", "corporationName", "corporationID"); }
56  std::string GetAllianceName(uint32 id) { return GetChannelName(id, "alnAlliance", "shortName", "allianceID"); }
57  std::string GetCharacterName(uint32 id) { return GetChannelName(id, "chrCharacters", "characterName", "charID"); }
58 
59  int32 GetChannelID(std::string &name);
60 
61  void GetChannelInformation(int32 channelID, std::string & name,
62  std::string & motd, uint32 & ownerid, std::string & compkey,
63  bool & memberless, std::string & password, bool & maillist,
64  uint32 & cspa);
65 
66  void GetChannelSubscriptions(uint32 charID, std::vector<long> & ids, std::vector<std::string> & names,
67  std::vector<std::string> & MOTDs, std::vector<unsigned long> & ownerids, std::vector<std::string> & compkeys,
68  std::vector<int> & memberless, std::vector<std::string> & passwords, std::vector<int> & maillists,
69  std::vector<int> & cspas, int & channelCount);
70 
71  bool GetChannelInfo(int32 channelID, std::string& name, std::string& motd);
72 
73  int32 GetChannelIDFromComparisonKey(std::string compkey);
74 
75  void UpdateChannelInfo(LSCChannel *channel);
76  void UpdateSubscription(int32 channelID, Client* pClient);
77 
78  void DeleteChannel(int32 channelID);
79  void DeleteSubscription(int32 channelID, uint32 charID);
80 
81 
82 protected:
83  std::string GetChannelName(uint32 id, const char * table, const char * column, const char * key);
84 };
85 
86 
87 #endif
Base Python wire object.
Definition: PyRep.h:66
int32 GetNextAvailableChannelID()
Definition: LSCDB.cpp:58
std::string GetRegionName(uint32 id)
Definition: LSCDB.h:52
bool MarkMessageRead(uint32 messageID)
Definition: LSCDB.cpp:505
bool IsChannelSubscribedByThisChar(uint32 char_ID, int32 channel_ID)
Definition: LSCDB.cpp:198
void DeleteChannel(int32 channelID)
Definition: LSCDB.cpp:130
void UpdateSubscription(int32 channelID, Client *pClient)
Definition: LSCDB.cpp:121
std::string GetSolarSystemName(uint32 id)
Definition: LSCDB.h:54
void UpdateChannelInfo(LSCChannel *channel)
Definition: LSCDB.cpp:88
void DeleteSubscription(int32 channelID, uint32 charID)
Definition: LSCDB.cpp:136
std::string GetConstellationName(uint32 id)
Definition: LSCDB.h:53
uint32 StoreMail(uint32 senderID, uint32 recipID, const char *subject, const char *message, int64 sentTime)
Definition: LSCDB.cpp:399
PyRep * GetMailDetails(uint32 messageID, uint32 readerID)
Definition: LSCDB.cpp:462
bool IsChannelIDAvailable(int32 channel_ID)
Definition: LSCDB.cpp:172
std::string GetAllianceName(uint32 id)
Definition: LSCDB.h:56
int32 GetChannelIDFromComparisonKey(std::string compkey)
Definition: LSCDB.cpp:365
signed __int32 int32
Definition: eve-compat.h:49
void GetChannelNames(uint32 charID, std::vector< std::string > &names)
Definition: LSCDB.cpp:33
Python object.
Definition: PyRep.h:826
std::string GetCorporationName(uint32 id)
Definition: LSCDB.h:55
Definition: LSCDB.h:36
Definition: Client.h:66
unsigned __int32 uint32
Definition: eve-compat.h:50
void GetChannelSubscriptions(uint32 charID, std::vector< long > &ids, std::vector< std::string > &names, std::vector< std::string > &MOTDs, std::vector< unsigned long > &ownerids, std::vector< std::string > &compkeys, std::vector< int > &memberless, std::vector< std::string > &passwords, std::vector< int > &maillists, std::vector< int > &cspas, int &channelCount)
Definition: LSCDB.cpp:285
signed __int64 int64
Definition: eve-compat.h:51
int32 GetChannelID(std::string &name)
Definition: LSCDB.cpp:222
const int cspa
Definition: LSCService.cpp:132
bool IsChannelNameAvailable(std::string name)
Definition: LSCDB.cpp:145
void GetChannelInformation(int32 channelID, std::string &name, std::string &motd, uint32 &ownerid, std::string &compkey, bool &memberless, std::string &password, bool &maillist, uint32 &cspa)
Definition: LSCDB.cpp:240
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
bool DeleteMessage(uint32 messageID, uint32 readerID)
Definition: LSCDB.cpp:522
std::string GetCharacterName(uint32 id)
Definition: LSCDB.h:57
std::string GetChannelName(uint32 id, const char *table, const char *column, const char *key)
Definition: LSCDB.cpp:382
bool GetChannelInfo(int32 channelID, std::string &name, std::string &motd)
Definition: LSCDB.cpp:344
PyObject * GetMailHeaders(uint32 recID)
Definition: LSCDB.cpp:446