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
27
enum
DumpTableType
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
55
enum
DumpReturn
56
{
57
DUMP_SUCCESS
,
58
DUMP_FILE_OPEN_ERROR
,
59
DUMP_TOO_MANY_CHARS
,
60
DUMP_FILE_BROKEN
,
61
DUMP_CHARACTER_DELETED
62
};
63
64
struct
DumpTable
;
65
struct
TableStruct
;
66
class
StringTransaction
;
67
68
class
TC_GAME_API
PlayerDump
69
{
70
public
:
71
static
void
InitializeTables();
72
73
protected
:
74
PlayerDump
() { }
75
};
76
77
class
TC_GAME_API
PlayerDumpWriter
:
public
PlayerDump
78
{
79
public
:
80
PlayerDumpWriter
() { }
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
97
class
TC_GAME_API
PlayerDumpReader
:
public
PlayerDump
98
{
99
public
:
100
PlayerDumpReader
() { }
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
TC_GAME_API
#define TC_GAME_API
Definition
Define.h:114
uint32
uint32_t uint32
Definition
Define.h:133
ObjectGuid.h
DumpReturn
DumpReturn
Definition
PlayerDump.h:56
DUMP_FILE_OPEN_ERROR
@ DUMP_FILE_OPEN_ERROR
Definition
PlayerDump.h:58
DUMP_CHARACTER_DELETED
@ DUMP_CHARACTER_DELETED
Definition
PlayerDump.h:61
DUMP_SUCCESS
@ DUMP_SUCCESS
Definition
PlayerDump.h:57
DUMP_TOO_MANY_CHARS
@ DUMP_TOO_MANY_CHARS
Definition
PlayerDump.h:59
DUMP_FILE_BROKEN
@ DUMP_FILE_BROKEN
Definition
PlayerDump.h:60
DumpTableType
DumpTableType
Definition
PlayerDump.h:28
DTT_EQSET_TABLE
@ DTT_EQSET_TABLE
Definition
PlayerDump.h:36
DTT_INVENTORY
@ DTT_INVENTORY
Definition
PlayerDump.h:38
DTT_CHAR_TABLE
@ DTT_CHAR_TABLE
Definition
PlayerDump.h:31
DTT_PET_TABLE
@ DTT_PET_TABLE
Definition
PlayerDump.h:52
DTT_MAIL
@ DTT_MAIL
Definition
PlayerDump.h:40
DTT_MAIL_ITEM
@ DTT_MAIL_ITEM
Definition
PlayerDump.h:43
DTT_PET
@ DTT_PET
Definition
PlayerDump.h:51
DTT_ITEM
@ DTT_ITEM
Definition
PlayerDump.h:46
DTT_ITEM_GIFT
@ DTT_ITEM_GIFT
Definition
PlayerDump.h:49
DTT_CHARACTER
@ DTT_CHARACTER
Definition
PlayerDump.h:29
ObjectGuid::LowType
uint32 LowType
Definition
ObjectGuid.h:142
PlayerDumpReader
Definition
PlayerDump.h:98
PlayerDumpReader::PlayerDumpReader
PlayerDumpReader()
Definition
PlayerDump.h:100
PlayerDumpWriter
Definition
PlayerDump.h:78
PlayerDumpWriter::PlayerDumpWriter
PlayerDumpWriter()
Definition
PlayerDump.h:80
PlayerDumpWriter::_mails
std::set< ObjectGuid::LowType > _mails
Definition
PlayerDump.h:91
PlayerDumpWriter::_pets
std::set< ObjectGuid::LowType > _pets
Definition
PlayerDump.h:90
PlayerDumpWriter::_itemSets
std::set< uint64 > _itemSets
Definition
PlayerDump.h:94
PlayerDumpWriter::_items
std::set< ObjectGuid::LowType > _items
Definition
PlayerDump.h:92
PlayerDump
Definition
PlayerDump.h:69
PlayerDump::PlayerDump
PlayerDump()
Definition
PlayerDump.h:74
StringTransaction
Definition
PlayerDump.cpp:128
DumpTable
Definition
PlayerDump.cpp:83
TableStruct
Definition
PlayerDump.cpp:158
server
game
Tools
PlayerDump.h
Generated on Sun May 10 2026 02:30:18 for TrinityCore by
1.9.8