EvEmu  0.8.4
11 September 2021
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
ServiceDB.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 __SERVICEDB_H_INCL__
28 #define __SERVICEDB_H_INCL__
29 
30 #include "eve-server.h"
31 #include "POD_containers.h"
32 
41 class ServiceDB
42 {
43 public:
44 
45  static bool GetAccountInformation(CryptoChallengePacket& ccp, AccountData& aData, std::string& failMsg);
46  static bool UpdateAccountHash( const char* username, std::string &hash );
47  static bool IncrementLoginCount(uint32 accountID );
48  static void UpdatePassword(uint32 accountID, const char* pass);
49 
50  static void SaveKillOrLoss(CharKillData& data);
51 
52  uint32 GetStationOwner(uint32 stationID);
53 
54  // not used cause eveConstants table doesnt exist...omitted from ccp dump
55  static bool GetConstant(const char *name, uint32 &into);
56 
57  static void SetServerOnlineStatus(bool online=false);
58  static void SetCharacterOnlineStatus(uint32 char_id, bool online=false);
59  static void SetAccountOnlineStatus(uint32 accountID, bool online=false);
60  static void SetAccountBanStatus(uint32 accountID, bool banned=false);
61  static void SaveServerStats(double threads, float rss, float vm, float user, float kernel, uint32 items, uint32 bubbles);
62 
63  static uint32 SetClientSeed();
64 
65  static PyRep* LookupChars(const char *match, bool exact=false);
66  static PyRep* LookupOwners(const char *match, bool exact=false);
67  static PyRep* LookupCorporations(const std::string &);
68  static PyRep* LookupFactions(const std::string &);
69  static PyRep* LookupCorporationTickers(const std::string &);
70  static PyRep* LookupStations(const std::string &);
71  static PyRep* LookupKnownLocationsByGroup(const std::string &, uint32);
72 
73  static PyRep* PrimeOwners(std::vector<int32>& itemIDs);
74 
75  // tests for invalid characters
76  static bool ValidateAccountName(CryptoChallengePacket& ccp, std::string& failMsg);
77 
78  // get corp hangar names for `.cargo` command
79  static void GetCorpHangarNames(uint32 corpID, std::map<uint8, std::string> &hangarNames);
80 
81 
82 protected:
83  void ProcessStringChange(const char* key, const std::string& oldValue, std::string newValue, PyDict* notif, std::vector< std::string >& dbQ);
84  void ProcessRealChange(const char * key, double oldValue, double newValue, PyDict * notif, std::vector<std::string> & dbQ);
85  void ProcessIntChange(const char * key, uint32 oldValue, uint32 newValue, PyDict * notif, std::vector<std::string> & dbQ);
86  void ProcessLongChange(const char* key, int64 oldValue, int64 newValue, PyDict* notif, std::vector< std::string >& dbQ);
87 
100  static uint32 CreateNewAccount( const char* login, const char* pass, const char* passHash, int64 role );
101 
102 };
103 
104 #endif
105 
106 
Base Python wire object.
Definition: PyRep.h:66
static bool IncrementLoginCount(uint32 accountID)
Definition: ServiceDB.cpp:140
static void SetCharacterOnlineStatus(uint32 char_id, bool online=false)
Definition: ServiceDB.cpp:177
uint32 GetStationOwner(uint32 stationID)
Definition: ServiceDB.cpp:226
void ProcessRealChange(const char *key, double oldValue, double newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:287
void ProcessIntChange(const char *key, uint32 oldValue, uint32 newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:304
Python's dictionary.
Definition: PyRep.h:719
static PyRep * LookupCorporationTickers(const std::string &)
Definition: ServiceDB.cpp:483
static PyRep * LookupOwners(const char *match, bool exact=false)
Definition: ServiceDB.cpp:391
static void SaveKillOrLoss(CharKillData &data)
Definition: ServiceDB.cpp:212
static uint32 CreateNewAccount(const char *login, const char *pass, const char *passHash, int64 role)
Definition: ServiceDB.cpp:151
static void SetAccountBanStatus(uint32 accountID, bool banned=false)
Definition: ServiceDB.cpp:205
static uint32 SetClientSeed()
Definition: ServiceDB.cpp:34
static void SaveServerStats(double threads, float rss, float vm, float user, float kernel, uint32 items, uint32 bubbles)
Definition: ServiceDB.cpp:336
static void GetCorpHangarNames(uint32 corpID, std::map< uint8, std::string > &hangarNames)
Definition: ServiceDB.cpp:567
static bool GetConstant(const char *name, uint32 &into)
Definition: ServiceDB.cpp:242
void ProcessStringChange(const char *key, const std::string &oldValue, std::string newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:266
static PyRep * LookupKnownLocationsByGroup(const std::string &, uint32)
Definition: ServiceDB.cpp:521
static PyRep * LookupCorporations(const std::string &)
Definition: ServiceDB.cpp:445
static void UpdatePassword(uint32 accountID, const char *pass)
Definition: ServiceDB.cpp:170
static void SetAccountOnlineStatus(uint32 accountID, bool online=false)
Definition: ServiceDB.cpp:198
void ProcessLongChange(const char *key, int64 oldValue, int64 newValue, PyDict *notif, std::vector< std::string > &dbQ)
Definition: ServiceDB.cpp:320
unsigned __int32 uint32
Definition: eve-compat.h:50
static bool UpdateAccountHash(const char *username, std::string &hash)
Definition: ServiceDB.cpp:125
static PyRep * PrimeOwners(std::vector< int32 > &itemIDs)
Definition: ServiceDB.cpp:540
static PyRep * LookupChars(const char *match, bool exact=false)
Definition: ServiceDB.cpp:358
signed __int64 int64
Definition: eve-compat.h:51
static bool GetAccountInformation(CryptoChallengePacket &ccp, AccountData &aData, std::string &failMsg)
Definition: ServiceDB.cpp:70
static void SetServerOnlineStatus(bool online=false)
Definition: ServiceDB.cpp:186
static PyRep * LookupStations(const std::string &)
Definition: ServiceDB.cpp:502
static bool ValidateAccountName(CryptoChallengePacket &ccp, std::string &failMsg)
Definition: ServiceDB.cpp:43
typeID Spawn an NPC with the specified type text Search for items matching the specified query() type() key(value)-Send an OnRemoteMessage" ) COMMAND( setbpattr
static PyRep * LookupFactions(const std::string &)
Definition: ServiceDB.cpp:464
entityID heal the character with the entityID note giving you detailed ship status information gives a list of all dynamic entities and players and their destinyState in this bubble shows some current destiny variables save all items