Minor optimization in PlayerDumpReader::LoadDump().
--HG-- branch : trunk
This commit is contained in:
@@ -421,7 +421,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
|||||||
bool incHighest = true;
|
bool incHighest = true;
|
||||||
if (guid != 0 && guid < objmgr.m_hiCharGuid)
|
if (guid != 0 && guid < objmgr.m_hiCharGuid)
|
||||||
{
|
{
|
||||||
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE guid = '%d'", guid);
|
result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE guid = '%d'", guid);
|
||||||
if (result)
|
if (result)
|
||||||
guid = objmgr.m_hiCharGuid; // use first free if exists
|
guid = objmgr.m_hiCharGuid; // use first free if exists
|
||||||
else incHighest = false;
|
else incHighest = false;
|
||||||
@@ -436,7 +436,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
|||||||
if (ObjectMgr::CheckPlayerName(name,true) == CHAR_NAME_SUCCESS)
|
if (ObjectMgr::CheckPlayerName(name,true) == CHAR_NAME_SUCCESS)
|
||||||
{
|
{
|
||||||
CharacterDatabase.escape_string(name); // for safe, we use name only for sql quearies anyway
|
CharacterDatabase.escape_string(name); // for safe, we use name only for sql quearies anyway
|
||||||
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE name = '%s'", name.c_str());
|
result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str());
|
||||||
if (result)
|
if (result)
|
||||||
name = ""; // use the one from the dump
|
name = ""; // use the one from the dump
|
||||||
}
|
}
|
||||||
@@ -545,7 +545,7 @@ DumpReturn PlayerDumpReader::LoadDump(const std::string& file, uint32 account, s
|
|||||||
name = getnth(line, 4);
|
name = getnth(line, 4);
|
||||||
CharacterDatabase.escape_string(name);
|
CharacterDatabase.escape_string(name);
|
||||||
|
|
||||||
result = CharacterDatabase.PQuery("SELECT * FROM characters WHERE name = '%s'", name.c_str());
|
result = CharacterDatabase.PQuery("SELECT 1 FROM characters WHERE name = '%s'", name.c_str());
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
if(!changenth(line, 37, "1")) // rename on login: `at_login` field 37 in raw field list
|
if(!changenth(line, 37, "1")) // rename on login: `at_login` field 37 in raw field list
|
||||||
|
|||||||
Reference in New Issue
Block a user