Core/Player: Prevented infinite growth of allowedCharsToLogin container and changed its type to better reflect its purpose
This commit is contained in:
@@ -205,6 +205,7 @@ void WorldSession::HandleCharEnum(QueryResult result)
|
|||||||
|
|
||||||
data << num;
|
data << num;
|
||||||
|
|
||||||
|
_allowedCharsToLogin.clear();
|
||||||
if (result)
|
if (result)
|
||||||
{
|
{
|
||||||
do
|
do
|
||||||
@@ -213,7 +214,7 @@ void WorldSession::HandleCharEnum(QueryResult result)
|
|||||||
sLog->outDetail("Loading char guid %u from account %u.",guidlow,GetAccountId());
|
sLog->outDetail("Loading char guid %u from account %u.",guidlow,GetAccountId());
|
||||||
if (Player::BuildEnumData(result, &data))
|
if (Player::BuildEnumData(result, &data))
|
||||||
{
|
{
|
||||||
m_AllowedCharsToLogin.push_back(guidlow);
|
_allowedCharsToLogin.insert(guidlow);
|
||||||
++num;
|
++num;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -883,17 +883,13 @@ class WorldSession
|
|||||||
void LogUnprocessedTail(WorldPacket *packet);
|
void LogUnprocessedTail(WorldPacket *packet);
|
||||||
|
|
||||||
// EnumData helpers
|
// EnumData helpers
|
||||||
bool CharCanLogin(uint32 LowGUID)
|
bool CharCanLogin(uint32 lowGUID)
|
||||||
{
|
{
|
||||||
if (find(m_AllowedCharsToLogin.begin(),
|
return _allowedCharsToLogin.find(lowGUID) != _allowedCharsToLogin.end();
|
||||||
m_AllowedCharsToLogin.end(),
|
|
||||||
LowGUID) == m_AllowedCharsToLogin.end())
|
|
||||||
return false;
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
// this stores the GUIDs of the characters who can login
|
// this stores the GUIDs of the characters who can login
|
||||||
// characters who failed on Player::BuildEnumData shouldn't login
|
// characters who failed on Player::BuildEnumData shouldn't login
|
||||||
std::list<uint32> m_AllowedCharsToLogin;
|
std::set<uint32> _allowedCharsToLogin;
|
||||||
|
|
||||||
uint32 m_GUIDLow; // set loggined or recently logout player (while m_playerRecentlyLogout set)
|
uint32 m_GUIDLow; // set loggined or recently logout player (while m_playerRecentlyLogout set)
|
||||||
Player *_player;
|
Player *_player;
|
||||||
|
|||||||
Reference in New Issue
Block a user