TrinityCore
Loading...
Searching...
No Matches
PlayerDump.h
Go to the documentation of this file.
1/*
2 * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef _PLAYER_DUMP_H
19#define _PLAYER_DUMP_H
20
21#include <string>
22#include <iosfwd>
23#include <map>
24#include <set>
25#include "ObjectGuid.h"
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
36 DTT_EQSET_TABLE, // <- guid // character_equipmentsets
37
38 DTT_INVENTORY, // -> item guids collection // character_inventory
39
40 DTT_MAIL, // -> mail ids collection // mail
41 // -> item_text
42
43 DTT_MAIL_ITEM, // <- mail ids // mail_items
44 // -> item guids collection
45
46 DTT_ITEM, // <- item guids // item_instance
47 // -> item_text
48
49 DTT_ITEM_GIFT, // <- item guids // character_gifts
50
51 DTT_PET, // -> pet guids collection // character_pet
52 DTT_PET_TABLE // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
53};
54
63
64struct DumpTable;
65struct TableStruct;
67
69{
70 public:
71 static void InitializeTables();
72
73 protected:
75};
76
78{
79 public:
81
82 bool GetDump(ObjectGuid::LowType guid, std::string& dump);
83 DumpReturn WriteDumpToFile(std::string const& file, ObjectGuid::LowType guid);
84 DumpReturn WriteDumpToString(std::string& dump, ObjectGuid::LowType guid);
85
86 private:
87 bool AppendTable(StringTransaction& trans, ObjectGuid::LowType guid, TableStruct const& tableStruct, DumpTable const& dumpTable);
88 void PopulateGuids(ObjectGuid::LowType guid);
89
90 std::set<ObjectGuid::LowType> _pets;
91 std::set<ObjectGuid::LowType> _mails;
92 std::set<ObjectGuid::LowType> _items;
93
94 std::set<uint64> _itemSets;
95};
96
98{
99 public:
101
102 DumpReturn LoadDumpFromFile(std::string const& file, uint32 account, std::string name, ObjectGuid::LowType guid);
103 DumpReturn LoadDumpFromString(std::string const& dump, uint32 account, std::string name, ObjectGuid::LowType guid);
104
105 private:
106 DumpReturn LoadDump(std::istream& input, uint32 account, std::string name, ObjectGuid::LowType guid);
107};
108
109#endif
#define TC_GAME_API
Definition Define.h:114
uint32_t uint32
Definition Define.h:133
DumpReturn
Definition PlayerDump.h:56
@ DUMP_FILE_OPEN_ERROR
Definition PlayerDump.h:58
@ DUMP_CHARACTER_DELETED
Definition PlayerDump.h:61
@ DUMP_SUCCESS
Definition PlayerDump.h:57
@ DUMP_TOO_MANY_CHARS
Definition PlayerDump.h:59
@ DUMP_FILE_BROKEN
Definition PlayerDump.h:60
DumpTableType
Definition PlayerDump.h:28
@ DTT_EQSET_TABLE
Definition PlayerDump.h:36
@ DTT_INVENTORY
Definition PlayerDump.h:38
@ DTT_CHAR_TABLE
Definition PlayerDump.h:31
@ DTT_PET_TABLE
Definition PlayerDump.h:52
@ DTT_MAIL
Definition PlayerDump.h:40
@ DTT_MAIL_ITEM
Definition PlayerDump.h:43
@ DTT_PET
Definition PlayerDump.h:51
@ DTT_ITEM
Definition PlayerDump.h:46
@ DTT_ITEM_GIFT
Definition PlayerDump.h:49
@ DTT_CHARACTER
Definition PlayerDump.h:29
uint32 LowType
Definition ObjectGuid.h:142
std::set< ObjectGuid::LowType > _mails
Definition PlayerDump.h:91
std::set< ObjectGuid::LowType > _pets
Definition PlayerDump.h:90
std::set< uint64 > _itemSets
Definition PlayerDump.h:94
std::set< ObjectGuid::LowType > _items
Definition PlayerDump.h:92