2 * Copyright (C) 2005-2008 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
27 #include "DynamicObject.h"
28 #include "GameObject.h"
32 #include "ItemPrototype.h"
33 #include "NPCHandler.h"
34 #include "Database/DatabaseEnv.h"
35 #include "AuctionHouseObject.h"
38 #include "ObjectAccessor.h"
39 #include "ObjectDefines.h"
40 #include "Policies/Singleton.h"
41 #include "Database/SQLStorage.h"
49 DTT_CHARACTER
, // // characters
51 DTT_CHAR_TABLE
, // // character_action, character_aura, character_homebind,
52 // character_queststatus, character_reputation,
53 // character_spell, character_spell_cooldown, character_ticket,
56 DTT_INVENTORY
, // -> item guids collection // character_inventory
58 DTT_MAIL
, // -> mail ids collection // mail
61 DTT_MAIL_ITEM
, // <- mail ids // mail_items
62 // -> item guids collection
64 DTT_ITEM
, // <- item guids // item_instance
67 DTT_ITEM_GIFT
, // <- item guids // character_gifts
69 DTT_PET
, // -> pet guids collection // character_pet
70 DTT_PET_TABLE
, // <- pet guids // pet_aura, pet_spell, pet_spell_cooldown
71 DTT_ITEM_TEXT
, // <- item_text // item_text
89 class PlayerDumpWriter
: public PlayerDump
94 std::string
GetDump(uint32 guid
);
95 DumpReturn
WriteDump(std::string file
, uint32 guid
);
97 typedef std::set
<uint32
> GUIDs
;
99 void DumpTable(std::string
& dump
, uint32 guid
, char const*tableFrom
, char const*tableTo
, DumpTableType type
);
100 std::string
GenerateWhereStr(char const* field
, GUIDs
const& guids
, GUIDs::const_iterator
& itr
);
101 std::string
GenerateWhereStr(char const* field
, uint32 guid
);
109 class PlayerDumpReader
: public PlayerDump
112 PlayerDumpReader() {}
114 DumpReturn
LoadDump(std::string file
, uint32 account
, std::string name
, uint32 guid
);