summaryrefslogtreecommitdiffstats
path: root/src/ClientHandle.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-10-06 17:38:42 +0200
committerHowaner <franzi.moos@googlemail.com>2014-10-06 17:38:42 +0200
commita59f2d15fbaa934f517d9bb5fbe4737078188f9d (patch)
tree3e54201e4cffb6b9675eb6a1584925b911f924f8 /src/ClientHandle.cpp
parentBetter StreamNextChunk() method (diff)
parentFixed crash in ForEachEntityInBox API. (diff)
downloadcuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.tar
cuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.tar.gz
cuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.tar.bz2
cuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.tar.lz
cuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.tar.xz
cuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.tar.zst
cuberite-a59f2d15fbaa934f517d9bb5fbe4737078188f9d.zip
Diffstat (limited to '')
-rw-r--r--src/ClientHandle.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp
index 3c73296a4..535f9d386 100644
--- a/src/ClientHandle.cpp
+++ b/src/ClientHandle.cpp
@@ -92,7 +92,8 @@ cClientHandle::cClientHandle(const cSocket * a_Socket, int a_ViewDistance) :
m_NumBlockChangeInteractionsThisTick(0),
m_UniqueID(0),
m_HasSentPlayerChunk(false),
- m_Locale("en_GB")
+ m_Locale("en_GB"),
+ m_ProtocolVersion(0)
{
m_Protocol = new cProtocolRecognizer(this);
@@ -672,15 +673,22 @@ void cClientHandle::HandlePing(void)
bool cClientHandle::HandleLogin(int a_ProtocolVersion, const AString & a_Username)
{
+ // If the protocol version hasn't been set yet, set it now:
+ if (m_ProtocolVersion == 0)
+ {
+ m_ProtocolVersion = a_ProtocolVersion;
+ }
+
m_Username = a_Username;
+ // Let the plugins know about this event, they may refuse the player:
if (cRoot::Get()->GetPluginManager()->CallHookLogin(this, a_ProtocolVersion, a_Username))
{
Destroy();
return false;
}
- // Schedule for authentication; until then, let them wait (but do not block)
+ // Schedule for authentication; until then, let the player wait (but do not block)
m_State = csAuthenticating;
cRoot::Get()->GetAuthenticator().Authenticate(GetUniqueID(), GetUsername(), m_Protocol->GetAuthServerID());
return true;