summaryrefslogtreecommitdiffstats
path: root/src/Server.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-10-02 22:27:32 +0200
committerGitHub <noreply@github.com>2021-10-02 22:27:32 +0200
commit1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa (patch)
treebb20f3445773dca9c348ee2939ddc5609e8dbfa0 /src/Server.cpp
parentBlaze shoot sound fix (diff)
downloadcuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.gz
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.bz2
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.lz
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.xz
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.tar.zst
cuberite-1a0d9450eaa0f3c2ff475175f5d45932fd4dd7fa.zip
Diffstat (limited to '')
-rw-r--r--src/Server.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Server.cpp b/src/Server.cpp
index 8be63c083..08142b008 100644
--- a/src/Server.cpp
+++ b/src/Server.cpp
@@ -709,7 +709,7 @@ void cServer::KickUser(int a_ClientID, const AString & a_Reason)
-void cServer::AuthenticateUser(int a_ClientID, const AString & a_Name, const cUUID & a_UUID, const Json::Value & a_Properties)
+void cServer::AuthenticateUser(int a_ClientID, AString && a_Username, const cUUID & a_UUID, Json::Value && a_Properties)
{
cCSLock Lock(m_CSClients);
@@ -720,14 +720,14 @@ void cServer::AuthenticateUser(int a_ClientID, const AString & a_Name, const cUU
return;
}
- for (auto itr = m_Clients.begin(); itr != m_Clients.end(); ++itr)
+ for (const auto & Client : m_Clients)
{
- if ((*itr)->GetUniqueID() == a_ClientID)
+ if (Client->GetUniqueID() == a_ClientID)
{
- (*itr)->Authenticate(a_Name, a_UUID, a_Properties);
+ Client->Authenticate(std::move(a_Username), a_UUID, std::move(a_Properties));
return;
}
- } // for itr - m_Clients[]
+ }
}