Project SkyFire Core
SkyFire 5.4.8 server core API documentation
Loading...
Searching...
No Matches
PlayerDump.h
Go to the documentation of this file.
1/*
2* This file is part of Project SkyFire https://www.projectskyfire.org.
3* See LICENSE.md file for Copyright information
4*/
5
6#ifndef SF_PLAYER_DUMP_H
7#define SF_PLAYER_DUMP_H
8
9#include "Define.h"
10
11#include <map>
12#include <set>
13#include <string>
14
16{
17 DTT_CHARACTER, // // characters
18
19 DTT_CHAR_TABLE, // // character_achievement, character_achievement_progress,
20 // character_action, character_aura, character_homebind,
21 // character_queststatus, character_queststatus_rewarded, character_reputation,
22 // character_spell, character_spell_cooldown, character_ticket, character_talent.
23 // character_cuf_profiles, character_currency
24
25 DTT_EQSET_TABLE, // <- guid // character_equipmentsets
26
27 DTT_INVENTORY, // -> item guids collection // character_inventory
28
29 DTT_MAIL, // -> mail ids collection // mail
30 // -> item_text
31
32 DTT_MAIL_ITEM, // <- mail ids // mail_items
33 // -> item guids collection
34
35 DTT_ITEM, // <- item guids // item_instance
36 // -> item_text
37
38 DTT_ITEM_GIFT, // <- item guids // character_gifts
39
40 DTT_PET, // -> pet guids collection // character_pet
41 DTT_PET_DECLINEDNAME, // <- pet guids // character_pet_declinedname
42 DTT_PET_TABLE // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
43};
44
45namespace Skyfire
46{
47namespace PlayerDump
48{
50 {
51 uint32 const Guid = 1;
52 uint32 const Account = 3;
53 uint32 const Name = 4;
54 uint32 const Race = 6;
55 uint32 const Class = 7;
56 uint32 const Gender = 8;
57 uint32 const Level = 9;
58 uint32 const AtLogin = 41;
61 uint32 const DeleteDate = 68;
62 }
63
64 namespace PetFields
65 {
66 uint32 const Id = 1;
67 uint32 const Owner = 3;
68 }
69
71 {
72 uint32 const Id = 1;
73 uint32 const Owner = 2;
74 }
75}
76}
77
87
89{
90protected:
92};
93
95{
96public:
98
99 bool GetDump(uint32 guid, std::string& dump);
100 DumpReturn WriteDump(std::string const& file, uint32 guid);
101private:
102 typedef std::set<uint32> GUIDs;
103
104 bool DumpTable(std::string& dump, uint32 guid, char const* tableFrom, char const* tableTo, DumpTableType type);
105 std::string GenerateWhereStr(char const* field, GUIDs const& guids, GUIDs::const_iterator& itr);
106 std::string GenerateWhereStr(char const* field, uint32 guid);
107
111};
112
114{
115public:
117
118 DumpReturn LoadDump(std::string const& file, uint32 account, std::string name, uint32 guid);
119};
120
121#endif
std::uint32_t uint32
Definition Define.h:77
DumpReturn
Definition PlayerDump.h:79
@ DUMP_FILE_OPEN_ERROR
Definition PlayerDump.h:81
@ DUMP_CHARACTER_DELETED
Definition PlayerDump.h:85
@ DUMP_SUCCESS
Definition PlayerDump.h:80
@ DUMP_TOO_MANY_CHARS
Definition PlayerDump.h:82
@ DUMP_FILE_BROKEN
Definition PlayerDump.h:84
@ DUMP_UNEXPECTED_END
Definition PlayerDump.h:83
DumpTableType
Definition PlayerDump.h:16
@ DTT_EQSET_TABLE
Definition PlayerDump.h:25
@ DTT_INVENTORY
Definition PlayerDump.h:27
@ DTT_CHAR_TABLE
Definition PlayerDump.h:19
@ DTT_PET_TABLE
Definition PlayerDump.h:42
@ DTT_MAIL
Definition PlayerDump.h:29
@ DTT_MAIL_ITEM
Definition PlayerDump.h:32
@ DTT_PET_DECLINEDNAME
Definition PlayerDump.h:41
@ DTT_PET
Definition PlayerDump.h:40
@ DTT_ITEM
Definition PlayerDump.h:35
@ DTT_ITEM_GIFT
Definition PlayerDump.h:38
@ DTT_CHARACTER
Definition PlayerDump.h:17
DumpReturn LoadDump(std::string const &file, uint32 account, std::string name, uint32 guid)
bool GetDump(uint32 guid, std::string &dump)
bool DumpTable(std::string &dump, uint32 guid, char const *tableFrom, char const *tableTo, DumpTableType type)
std::set< uint32 > GUIDs
Definition PlayerDump.h:102
DumpReturn WriteDump(std::string const &file, uint32 guid)
std::string GenerateWhereStr(char const *field, GUIDs const &guids, GUIDs::const_iterator &itr)