TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PlayerDump.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2008-2016 TrinityCore <http://www.trinitycore.org/>
3  * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License as published by the
7  * Free Software Foundation; either version 2 of the License, or (at your
8  * option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  *
15  * You should have received a copy of the GNU General Public License along
16  * with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
19 #ifndef _PLAYER_DUMP_H
20 #define _PLAYER_DUMP_H
21 
22 #include "ObjectGuid.h"
23 #include <string>
24 #include <map>
25 #include <set>
26 
28 {
29  DTT_CHARACTER, // // characters
30 
31  DTT_CHAR_TABLE, // // character_achievement, character_achievement_progress,
32  // character_action, character_aura, character_homebind,
33  // character_queststatus, character_queststatus_rewarded, character_reputation,
34  // character_spell, character_spell_cooldown, character_ticket, character_talent.
35  // character_cuf_profiles
36 
37  DTT_CURRENCY, // // character_currency
38 
39  DTT_EQSET_TABLE, // <- guid // character_equipmentsets
40 
41  DTT_INVENTORY, // -> item guids collection // character_inventory
42 
43  DTT_MAIL, // -> mail ids collection // mail
44  // -> item_text
45 
46  DTT_MAIL_ITEM, // <- mail ids // mail_items
47  // -> item guids collection
48 
49  DTT_ITEM, // <- item guids // item_instance
50  // -> item_text
51 
52  DTT_ITEM_GIFT, // <- item guids // character_gifts
53 
54  DTT_PET, // -> pet guids collection // character_pet
55  DTT_PET_TABLE // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
56 };
57 
59 {
66 };
67 
69 {
70  public:
71  typedef std::set<ObjectGuid::LowType> DumpGuidSet;
72  typedef std::map<ObjectGuid::LowType, ObjectGuid::LowType> DumpGuidMap;
73 
74  protected:
75  PlayerDump() { }
76 };
77 
79 {
80  public:
82 
83  bool GetDump(ObjectGuid::LowType guid, std::string& dump);
84  DumpReturn WriteDump(std::string const& file, ObjectGuid::LowType guid);
85 
86  private:
87 
88  bool DumpTable(std::string& dump, ObjectGuid::LowType guid, char const* tableFrom, char const* tableTo, DumpTableType type);
89  std::string GenerateWhereStr(char const* field, DumpGuidSet const& guids, DumpGuidSet::const_iterator& itr);
90  std::string GenerateWhereStr(char const* field, ObjectGuid::LowType guid);
91 
95 };
96 
98 {
99  public:
101 
102  DumpReturn LoadDump(std::string const& file, uint32 account, std::string name, ObjectGuid::LowType guid);
103 };
104 
105 #endif
Definition: PlayerDump.h:31
DumpReturn
Definition: PlayerDump.h:58
Definition: PlayerDump.h:49
Definition: PlayerDump.h:68
Definition: PlayerDump.h:97
Definition: PlayerDump.cpp:29
PlayerDumpWriter()
Definition: PlayerDump.h:81
Definition: PlayerDump.h:78
DumpTableType
Definition: PlayerDump.h:27
std::map< ObjectGuid::LowType, ObjectGuid::LowType > DumpGuidMap
Definition: PlayerDump.h:72
Definition: PlayerDump.h:61
uint64 LowType
Definition: ObjectGuid.h:199
DumpGuidSet items
Definition: PlayerDump.h:94
DumpGuidSet pets
Definition: PlayerDump.h:92
Definition: PlayerDump.h:60
Definition: PlayerDump.h:37
Definition: PlayerDump.h:64
uint32_t uint32
Definition: Define.h:150
Definition: PlayerDump.h:46
Definition: PlayerDump.h:39
Definition: PlayerDump.h:29
Definition: PlayerDump.h:55
DumpGuidSet mails
Definition: PlayerDump.h:93
#define TC_GAME_API
Definition: Define.h:134
Definition: PlayerDump.h:63
Definition: PlayerDump.h:62
Definition: PlayerDump.h:52
PlayerDump()
Definition: PlayerDump.h:75
Definition: PlayerDump.h:54
std::set< ObjectGuid::LowType > DumpGuidSet
Definition: PlayerDump.h:71
PlayerDumpReader()
Definition: PlayerDump.h:100
Definition: PlayerDump.h:65
Definition: PlayerDump.h:41
Definition: PlayerDump.h:43