summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2021-10-03 19:09:25 +0200
committerGitHub <noreply@github.com>2021-10-03 19:09:25 +0200
commit1d72306bae40c38a8a684cc412b0478fb0920d63 (patch)
tree82e26d2b9dba9e0c9c1a197281f41fa2a537fe6d /src/ClientHandle.cpp
parentWorld: change spawnpoint type to int (#5313) (diff)
downloadcuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.tar
cuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.tar.gz
cuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.tar.bz2
cuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.tar.lz
cuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.tar.xz
cuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.tar.zst
cuberite-1d72306bae40c38a8a684cc412b0478fb0920d63.zip
Diffstat (limited to 'src/ClientHandle.cpp')
-rw-r--r--src/ClientHandle.cpp74
1 files changed, 36 insertions, 38 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index efe4c9d48..4745ff7cd 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -335,49 +335,47 @@ bool cClientHandle::BungeeAuthenticate()
void cClientHandle::Authenticate(AString && a_Name, const cUUID & a_UUID, Json::Value && a_Properties)
{
- {
- cCSLock lock(m_CSState);
- /*
- LOGD("Processing authentication for client %s @ %s (%p), state = %d",
- m_Username.c_str(), m_IPString.c_str(), static_cast<void *>(this), m_State.load()
- );
- //*/
+ cCSLock Lock(m_CSState);
+ /*
+ LOGD("Processing authentication for client %s @ %s (%p), state = %d",
+ m_Username.c_str(), m_IPString.c_str(), static_cast<void *>(this), m_State.load()
+ );
+ //*/
- if (m_State != csAuthenticating)
- {
- return;
- }
+ if (m_State != csAuthenticating)
+ {
+ return;
+ }
- ASSERT(m_Player == nullptr);
+ ASSERT(m_Player == nullptr);
- if (!BungeeAuthenticate())
- {
- return;
- }
+ if (!BungeeAuthenticate())
+ {
+ return;
+ }
- m_Username = std::move(a_Name);
+ m_Username = std::move(a_Name);
- // Only assign UUID and properties if not already pre-assigned (BungeeCord sends those in the Handshake packet):
- if (m_UUID.IsNil())
- {
- m_UUID = a_UUID;
- }
- if (m_Properties.empty())
- {
- m_Properties = std::move(a_Properties);
- }
+ // Only assign UUID and properties if not already pre-assigned (BungeeCord sends those in the Handshake packet):
+ if (m_UUID.IsNil())
+ {
+ m_UUID = a_UUID;
+ }
+ if (m_Properties.empty())
+ {
+ m_Properties = std::move(a_Properties);
+ }
- // Send login success (if the protocol supports it):
- m_Protocol->SendLoginSuccess();
+ // Send login success (if the protocol supports it):
+ m_Protocol->SendLoginSuccess();
- if (m_ForgeHandshake.IsForgeClient)
- {
- m_ForgeHandshake.BeginForgeHandshake(*this);
- }
- else
- {
- FinishAuthenticate();
- }
+ if (m_ForgeHandshake.IsForgeClient)
+ {
+ m_ForgeHandshake.BeginForgeHandshake(*this);
+ }
+ else
+ {
+ FinishAuthenticate();
}
}
@@ -745,8 +743,8 @@ bool cClientHandle::HandleLogin()
m_State = csAuthenticating;
} // lock(m_CSState)
- // Schedule for authentication; until then, let the player wait (but do not block)
- cRoot::Get()->GetAuthenticator().Authenticate(GetUniqueID(), std::move(m_Username), m_Protocol->GetAuthServerID());
+ // Schedule for authentication; until then, let the player wait (but do not block):
+ cRoot::Get()->GetAuthenticator().Authenticate(GetUniqueID(), m_Username, m_Protocol->GetAuthServerID());
return true;
}