From b1032ed6203a5839906fab7137484b0ef8f0e58f Mon Sep 17 00:00:00 2001 From: pete318 Date: Sun, 11 Oct 2015 00:17:46 +0100 Subject: Change many uint32 to ObjectGuid::LowType in line with 6.x changes. --- src/server/game/Tools/PlayerDump.cpp | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/server/game/Tools/PlayerDump.cpp') diff --git a/src/server/game/Tools/PlayerDump.cpp b/src/server/game/Tools/PlayerDump.cpp index 8710100d9b3..1657b6cd028 100644 --- a/src/server/game/Tools/PlayerDump.cpp +++ b/src/server/game/Tools/PlayerDump.cpp @@ -158,38 +158,38 @@ bool changetoknth(std::string &str, int n, char const* with, bool insert = false return true; } -uint32 registerNewGuid(uint32 oldGuid, std::map &guidMap, uint32 hiGuid) +ObjectGuid::LowType registerNewGuid(ObjectGuid::LowType oldGuid, std::map &guidMap, ObjectGuid::LowType hiGuid) { - std::map::const_iterator itr = guidMap.find(oldGuid); + std::map::const_iterator itr = guidMap.find(oldGuid); if (itr != guidMap.end()) return itr->second; - uint32 newguid = hiGuid + guidMap.size(); + ObjectGuid::LowType newguid = hiGuid + guidMap.size(); guidMap[oldGuid] = newguid; return newguid; } -bool changeGuid(std::string &str, int n, std::map &guidMap, uint32 hiGuid, bool nonzero = false) +bool changeGuid(std::string &str, int n, std::map &guidMap, ObjectGuid::LowType hiGuid, bool nonzero = false) { char chritem[20]; - uint32 oldGuid = atoi(getnth(str, n).c_str()); + ObjectGuid::LowType oldGuid = atoi(getnth(str, n).c_str()); if (nonzero && oldGuid == 0) return true; // not an error - uint32 newGuid = registerNewGuid(oldGuid, guidMap, hiGuid); + ObjectGuid::LowType newGuid = registerNewGuid(oldGuid, guidMap, hiGuid); snprintf(chritem, 20, "%u", newGuid); return changenth(str, n, chritem, false, nonzero); } -bool changetokGuid(std::string &str, int n, std::map &guidMap, uint32 hiGuid, bool nonzero = false) +bool changetokGuid(std::string &str, int n, std::map &guidMap, ObjectGuid::LowType hiGuid, bool nonzero = false) { char chritem[20]; - uint32 oldGuid = atoi(gettoknth(str, n).c_str()); + ObjectGuid::LowType oldGuid = atoi(gettoknth(str, n).c_str()); if (nonzero && oldGuid == 0) return true; // not an error - uint32 newGuid = registerNewGuid(oldGuid, guidMap, hiGuid); + ObjectGuid::LowType newGuid = registerNewGuid(oldGuid, guidMap, hiGuid); snprintf(chritem, 20, "%u", newGuid); return changetoknth(str, n, chritem, false, nonzero); @@ -216,7 +216,7 @@ std::string CreateDumpString(char const* tableName, QueryResult result) return ss.str(); } -std::string PlayerDumpWriter::GenerateWhereStr(char const* field, uint32 guid) +std::string PlayerDumpWriter::GenerateWhereStr(char const* field, ObjectGuid::LowType guid) { std::ostringstream wherestr; wherestr << field << " = '" << guid << '\''; @@ -245,25 +245,25 @@ std::string PlayerDumpWriter::GenerateWhereStr(char const* field, GUIDs const& g return wherestr.str(); } -void StoreGUID(QueryResult result, uint32 field, std::set& guids) +void StoreGUID(QueryResult result, uint32 field, std::set& guids) { Field* fields = result->Fetch(); - uint32 guid = fields[field].GetUInt32(); + ObjectGuid::LowType guid = fields[field].GetUInt32(); if (guid) guids.insert(guid); } -void StoreGUID(QueryResult result, uint32 data, uint32 field, std::set& guids) +void StoreGUID(QueryResult result, uint32 data, uint32 field, std::set& guids) { Field* fields = result->Fetch(); std::string dataStr = fields[data].GetString(); - uint32 guid = atoi(gettoknth(dataStr, field).c_str()); + ObjectGuid::LowType guid = atoi(gettoknth(dataStr, field).c_str()); if (guid) guids.insert(guid); } // Writing - High-level functions -bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tableFrom, char const*tableTo, DumpTableType type) +bool PlayerDumpWriter::DumpTable(std::string& dump, ObjectGuid::LowType guid, char const*tableFrom, char const*tableTo, DumpTableType type) { GUIDs const* guids = NULL; char const* fieldname = NULL; @@ -340,7 +340,7 @@ bool PlayerDumpWriter::DumpTable(std::string& dump, uint32 guid, char const*tabl return true; } -bool PlayerDumpWriter::GetDump(uint32 guid, std::string &dump) +bool PlayerDumpWriter::GetDump(ObjectGuid::LowType guid, std::string &dump) { dump = "IMPORTANT NOTE: THIS DUMPFILE IS MADE FOR USE WITH THE 'PDUMP' COMMAND ONLY - EITHER THROUGH INGAME CHAT OR ON CONSOLE!\n"; dump += "IMPORTANT NOTE: DO NOT apply it directly - it will irreversibly DAMAGE and CORRUPT your database! You have been warned!\n\n"; @@ -355,7 +355,7 @@ bool PlayerDumpWriter::GetDump(uint32 guid, std::string &dump) return true; } -DumpReturn PlayerDumpWriter::WriteDump(const std::string& file, uint32 guid) +DumpReturn PlayerDumpWriter::WriteDump(const std::string& file, ObjectGuid::LowType guid) { if (sWorld->getBoolConfig(CONFIG_PDUMP_NO_PATHS)) if (strstr(file.c_str(), "\\") || strstr(file.c_str(), "/")) @@ -394,7 +394,7 @@ void fixNULLfields(std::string &line) } } -DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, std::string name, uint32 guid) +DumpReturn PlayerDumpReader::LoadDump(std::string const& file, uint32 account, std::string name, ObjectGuid::LowType guid) { uint32 charcount = AccountMgr::GetCharactersCount(account); if (charcount >= 10) -- cgit v1.2.3