changed from using iterator to auto for server and clienthandle
This commit is contained in:
parent
20dcceb7e6
commit
8edfd78295
@ -1803,9 +1803,9 @@ bool cClientHandle::HandleHandshake(const AString & a_Username)
|
|||||||
{
|
{
|
||||||
std::list<AString> usernamesServer = cRoot::Get()->GetServer()->GetUsernames();
|
std::list<AString> usernamesServer = cRoot::Get()->GetServer()->GetUsernames();
|
||||||
|
|
||||||
for (std::list<AString>::iterator itr = usernamesServer.begin(); itr != usernamesServer.end(); ++itr)
|
for (auto item : usernamesServer)
|
||||||
{
|
{
|
||||||
if ((*itr).compare(a_Username) == 0)
|
if ((item).compare(a_Username) == 0)
|
||||||
{
|
{
|
||||||
Kick("User already logged in.");
|
Kick("User already logged in.");
|
||||||
return false;
|
return false;
|
||||||
|
@ -308,9 +308,9 @@ std::list<AString> cServer::GetUsernames()
|
|||||||
{
|
{
|
||||||
std::list<AString> usernames;
|
std::list<AString> usernames;
|
||||||
cCSLock Lock(m_CSClients);
|
cCSLock Lock(m_CSClients);
|
||||||
for (ClientList::iterator itr = m_Clients.begin(); itr != m_Clients.end(); ++itr)
|
for (auto client : m_Clients)
|
||||||
{
|
{
|
||||||
AString username = (*itr)->GetUsername();
|
AString username = (client)->GetUsername();
|
||||||
usernames.insert(usernames.begin(),username);
|
usernames.insert(usernames.begin(),username);
|
||||||
}
|
}
|
||||||
return usernames;
|
return usernames;
|
||||||
|
Loading…
Reference in New Issue
Block a user