[8449] Deprecate healing/damage item mods and merge internal data in to spell power.
[getmangos.git] / src / game / PlayerDump.h
blob90fd2ac0e02badae68787bd4e7370204daf52ece
1 /*
2 * Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #ifndef _PLAYER_DUMP_H
20 #define _PLAYER_DUMP_H
22 #include <string>
23 #include <map>
24 #include <set>
26 enum DumpTableType
28 DTT_CHARACTER, // // characters
30 DTT_CHAR_TABLE, // // character_achievement, character_achievement_progress,
31 // character_action, character_aura, character_homebind,
32 // character_queststatus, character_reputation, character_spell,
33 // character_spell_cooldown, character_ticket, character_tutorial
35 DTT_INVENTORY, // -> item guids collection // character_inventory
37 DTT_MAIL, // -> mail ids collection // mail
38 // -> item_text
40 DTT_MAIL_ITEM, // <- mail ids // mail_items
41 // -> item guids collection
43 DTT_ITEM, // <- item guids // item_instance
44 // -> item_text
46 DTT_ITEM_GIFT, // <- item guids // character_gifts
48 DTT_PET, // -> pet guids collection // character_pet
49 DTT_PET_TABLE, // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
50 DTT_ITEM_TEXT, // <- item_text // item_text
53 enum DumpReturn
55 DUMP_SUCCESS,
56 DUMP_FILE_OPEN_ERROR,
57 DUMP_TOO_MANY_CHARS,
58 DUMP_UNEXPECTED_END,
59 DUMP_FILE_BROKEN,
62 class PlayerDump
64 protected:
65 PlayerDump() {}
68 class PlayerDumpWriter : public PlayerDump
70 public:
71 PlayerDumpWriter() {}
73 std::string GetDump(uint32 guid);
74 DumpReturn WriteDump(const std::string& file, uint32 guid);
75 private:
76 typedef std::set<uint32> GUIDs;
78 void DumpTable(std::string& dump, uint32 guid, char const*tableFrom, char const*tableTo, DumpTableType type);
79 std::string GenerateWhereStr(char const* field, GUIDs const& guids, GUIDs::const_iterator& itr);
80 std::string GenerateWhereStr(char const* field, uint32 guid);
82 GUIDs pets;
83 GUIDs mails;
84 GUIDs items;
85 GUIDs texts;
88 class PlayerDumpReader : public PlayerDump
90 public:
91 PlayerDumpReader() {}
93 DumpReturn LoadDump(const std::string& file, uint32 account, std::string name, uint32 guid);
96 #endif