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 "
ObjectGuid.h
"
22
#include <string>
23
#include <iosfwd>
24
#include <set>
25
26
enum
DumpTableType
27
{
28
DTT_CHARACTER
,
// // characters
29
30
DTT_CHAR_TABLE
,
// // character_achievement, character_achievement_progress,
31
// character_action, character_aura, character_homebind,
32
// character_queststatus, character_queststatus_rewarded, character_reputation,
33
// character_spell, character_spell_cooldown, character_ticket, character_talent,
34
// character_cuf_profiles
35
36
DTT_CURRENCY
,
// // character_currency
37
38
DTT_EQSET_TABLE
,
// <- guid // character_equipmentsets
39
40
DTT_INVENTORY
,
// -> item guids collection // character_inventory
41
42
DTT_CHAR_TRANSMOG
,
// <- guid // character_transmog_outfits
43
44
DTT_MAIL
,
// -> mail ids collection // mail
45
// -> item_text
46
47
DTT_MAIL_ITEM
,
// <- mail ids // mail_items
48
// -> item guids collection
49
50
DTT_ITEM
,
// <- item guids // item_instance
51
// -> item_text
52
53
DTT_ITEM_GIFT
,
// <- item guids // character_gifts
54
55
DTT_ITEM_TABLE
,
// <- item guids // item_instance_artifact, item_instance_artifact_powers, item_instance_azerite
56
// item_instance_azerite_empowered, item_instance_azerite_milestone_power,
57
// item_instance_azerite_unlocked_essence, item_instance_gems, item_instance_modifiers,
58
// item_instance_transmog
59
60
DTT_PET
,
// -> pet guids collection // character_pet
61
DTT_PET_TABLE
// <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
62
};
63
64
enum
DumpReturn
65
{
66
DUMP_SUCCESS
,
67
DUMP_FILE_OPEN_ERROR
,
68
DUMP_TOO_MANY_CHARS
,
69
DUMP_FILE_BROKEN
,
70
DUMP_CHARACTER_DELETED
71
};
72
73
struct
DumpTable
;
74
struct
TableStruct
;
75
class
StringTransaction
;
76
77
class
TC_GAME_API
PlayerDump
78
{
79
public
:
80
PlayerDump
(
PlayerDump
const
&) =
delete
;
81
PlayerDump
(
PlayerDump
&&) =
delete
;
82
PlayerDump
&
operator=
(
PlayerDump
const
&) =
delete
;
83
PlayerDump
&
operator=
(
PlayerDump
&&) =
delete
;
84
85
static
void
InitializeTables();
86
87
protected
:
88
PlayerDump
() =
default
;
89
~PlayerDump
() =
default
;
90
};
91
92
class
TC_GAME_API
PlayerDumpWriter
final :
public
PlayerDump
93
{
94
public
:
95
PlayerDumpWriter
();
96
97
bool
GetDump(
ObjectGuid::LowType
guid, std::string& dump);
98
DumpReturn
WriteDumpToFile(std::string
const
& file,
ObjectGuid::LowType
guid);
99
DumpReturn
WriteDumpToString(std::string& dump,
ObjectGuid::LowType
guid);
100
101
private
:
102
bool
AppendTable(
StringTransaction
& trans,
ObjectGuid::LowType
guid,
TableStruct
const
& tableStruct,
DumpTable
const
& dumpTable);
103
void
PopulateGuids(
ObjectGuid::LowType
guid);
104
105
std::set<uint32>
_pets
;
106
std::set<uint32>
_mails
;
107
std::set<ObjectGuid::LowType>
_items
;
108
109
std::set<uint64>
_itemSets
;
110
};
111
112
class
TC_GAME_API
PlayerDumpReader
final :
public
PlayerDump
113
{
114
public
:
115
PlayerDumpReader
() =
default
;
116
117
DumpReturn
LoadDumpFromFile(std::string
const
& file,
uint32
account, std::string name,
ObjectGuid::LowType
guid);
118
DumpReturn
LoadDumpFromString(std::string
const
& dump,
uint32
account, std::string name,
ObjectGuid::LowType
guid);
119
120
private
:
121
DumpReturn
LoadDump(std::istream& input,
uint32
account, std::string name,
ObjectGuid::LowType
guid);
122
};
123
124
#endif
TC_GAME_API
#define TC_GAME_API
Definition
Define.h:129
uint32
uint32_t uint32
Definition
Define.h:154
ObjectGuid.h
DumpReturn
DumpReturn
Definition
PlayerDump.h:65
DUMP_FILE_OPEN_ERROR
@ DUMP_FILE_OPEN_ERROR
Definition
PlayerDump.h:67
DUMP_CHARACTER_DELETED
@ DUMP_CHARACTER_DELETED
Definition
PlayerDump.h:70
DUMP_SUCCESS
@ DUMP_SUCCESS
Definition
PlayerDump.h:66
DUMP_TOO_MANY_CHARS
@ DUMP_TOO_MANY_CHARS
Definition
PlayerDump.h:68
DUMP_FILE_BROKEN
@ DUMP_FILE_BROKEN
Definition
PlayerDump.h:69
DumpTableType
DumpTableType
Definition
PlayerDump.h:27
DTT_EQSET_TABLE
@ DTT_EQSET_TABLE
Definition
PlayerDump.h:38
DTT_INVENTORY
@ DTT_INVENTORY
Definition
PlayerDump.h:40
DTT_CHAR_TABLE
@ DTT_CHAR_TABLE
Definition
PlayerDump.h:30
DTT_CURRENCY
@ DTT_CURRENCY
Definition
PlayerDump.h:36
DTT_PET_TABLE
@ DTT_PET_TABLE
Definition
PlayerDump.h:61
DTT_MAIL
@ DTT_MAIL
Definition
PlayerDump.h:44
DTT_MAIL_ITEM
@ DTT_MAIL_ITEM
Definition
PlayerDump.h:47
DTT_ITEM_TABLE
@ DTT_ITEM_TABLE
Definition
PlayerDump.h:55
DTT_CHAR_TRANSMOG
@ DTT_CHAR_TRANSMOG
Definition
PlayerDump.h:42
DTT_PET
@ DTT_PET
Definition
PlayerDump.h:60
DTT_ITEM
@ DTT_ITEM
Definition
PlayerDump.h:50
DTT_ITEM_GIFT
@ DTT_ITEM_GIFT
Definition
PlayerDump.h:53
DTT_CHARACTER
@ DTT_CHARACTER
Definition
PlayerDump.h:28
ObjectGuid::LowType
uint64 LowType
Definition
ObjectGuid.h:321
PlayerDumpReader
Definition
PlayerDump.h:113
PlayerDumpReader::PlayerDumpReader
PlayerDumpReader()=default
PlayerDumpWriter
Definition
PlayerDump.h:93
PlayerDumpWriter::_pets
std::set< uint32 > _pets
Definition
PlayerDump.h:105
PlayerDumpWriter::PlayerDumpWriter
PlayerDumpWriter()
PlayerDumpWriter::_itemSets
std::set< uint64 > _itemSets
Definition
PlayerDump.h:109
PlayerDumpWriter::_items
std::set< ObjectGuid::LowType > _items
Definition
PlayerDump.h:107
PlayerDumpWriter::_mails
std::set< uint32 > _mails
Definition
PlayerDump.h:106
PlayerDump
Definition
PlayerDump.h:78
PlayerDump::operator=
PlayerDump & operator=(PlayerDump &&)=delete
PlayerDump::~PlayerDump
~PlayerDump()=default
PlayerDump::PlayerDump
PlayerDump(PlayerDump const &)=delete
PlayerDump::operator=
PlayerDump & operator=(PlayerDump const &)=delete
PlayerDump::PlayerDump
PlayerDump()=default
PlayerDump::PlayerDump
PlayerDump(PlayerDump &&)=delete
StringTransaction
Definition
PlayerDump.cpp:156
DumpTable
Definition
PlayerDump.cpp:84
TableStruct
Definition
PlayerDump.cpp:187
server
game
Tools
PlayerDump.h
Generated on Sun May 10 2026 02:09:04 for TrinityCore by
1.9.8