Change many uint32 to ObjectGuid::LowType in line with 6.x changes.
(cherry picked from commit b1032ed620)
Conflicts:
src/server/game/AuctionHouse/AuctionHouseMgr.h
src/server/game/Entities/Corpse/Corpse.cpp
src/server/game/Entities/Creature/Creature.cpp
src/server/game/Entities/DynamicObject/DynamicObject.cpp
src/server/game/Entities/DynamicObject/DynamicObject.h
src/server/game/Entities/GameObject/GameObject.cpp
src/server/game/Entities/GameObject/GameObject.h
src/server/game/Entities/Object/ObjectGuid.h
src/server/game/Entities/Pet/Pet.cpp
src/server/game/Entities/Pet/Pet.h
src/server/game/Entities/Player/Player.cpp
src/server/game/Entities/Transport/Transport.h
src/server/game/Globals/ObjectMgr.cpp
src/server/game/Guilds/Guild.h
src/server/game/Guilds/GuildMgr.cpp
src/server/game/Guilds/GuildMgr.h
src/server/game/Mails/Mail.h
src/server/game/Maps/Map.cpp
src/server/game/Maps/TransportMgr.cpp
src/server/game/Maps/TransportMgr.h
src/server/game/OutdoorPvP/OutdoorPvP.h
This commit is contained in:
1 parent
b20c9ae283
commit
6664a3acc3
81 files changed
+415
-415
No files matched your search
@@ -160,38 +160,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);
|
||||
@@ -218,7 +218,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 << '\'';
|
||||
@@ -247,25 +247,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;
|
||||
@@ -345,7 +345,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";
|
||||
@@ -360,7 +360,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(), "/"))
|
||||
@@ -399,7 +399,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)
|
||||
|
||||
Reference in new issue
Block a user