aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Tools/PlayerDump.cpp
diff options
context:
space:
mode:
authorpete318 <pete318@hotmail.com>2015-10-11 00:17:46 +0100
committerpete318 <pete318@hotmail.com>2015-10-12 23:10:41 +0200
commitb1032ed6203a5839906fab7137484b0ef8f0e58f (patch)
tree79e418a6fb2a65e50814db850fa910790f48a9cf /src/server/game/Tools/PlayerDump.cpp
parentf179c4180fec834c2d588f27994452649bdbe87c (diff)
Change many uint32 to ObjectGuid::LowType in line with 6.x changes.
Diffstat (limited to 'src/server/game/Tools/PlayerDump.cpp')
-rw-r--r--src/server/game/Tools/PlayerDump.cpp36
1 files changed, 18 insertions, 18 deletions
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<uint32, uint32> &guidMap, uint32 hiGuid)
+ObjectGuid::LowType registerNewGuid(ObjectGuid::LowType oldGuid, std::map<ObjectGuid::LowType, ObjectGuid::LowType> &guidMap, ObjectGuid::LowType hiGuid)
{
- std::map<uint32, uint32>::const_iterator itr = guidMap.find(oldGuid);
+ std::map<ObjectGuid::LowType, ObjectGuid::LowType>::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<uint32, uint32> &guidMap, uint32 hiGuid, bool nonzero = false)
+bool changeGuid(std::string &str, int n, std::map<ObjectGuid::LowType, ObjectGuid::LowType> &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<uint32, uint32> &guidMap, uint32 hiGuid, bool nonzero = false)
+bool changetokGuid(std::string &str, int n, std::map<ObjectGuid::LowType, ObjectGuid::LowType> &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<uint32>& guids)
+void StoreGUID(QueryResult result, uint32 field, std::set<ObjectGuid::LowType>& 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<uint32>& guids)
+void StoreGUID(QueryResult result, uint32 data, uint32 field, std::set<ObjectGuid::LowType>& 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)