1
0

Fixed ClientHandle:GetProtocolVersion returning wrong number.

This commit is contained in:
Mattes D 2017-01-23 17:42:52 +01:00
parent b872f9bef7
commit 6b0c795655
4 changed files with 7 additions and 13 deletions

View File

@ -680,7 +680,7 @@ void cClientHandle::HandlePing(void)
bool cClientHandle::HandleLogin(UInt32 a_ProtocolVersion, const AString & a_Username) bool cClientHandle::HandleLogin(const AString & a_Username)
{ {
{ {
cCSLock lock(m_CSState); cCSLock lock(m_CSState);
@ -696,16 +696,10 @@ bool cClientHandle::HandleLogin(UInt32 a_ProtocolVersion, const AString & a_User
// LOGD("Handling login for client %s @ %s (%p), state = %d", a_Username.c_str(), m_IPString.c_str(), static_cast<void *>(this), m_State.load()); // LOGD("Handling login for client %s @ %s (%p), state = %d", a_Username.c_str(), m_IPString.c_str(), static_cast<void *>(this), m_State.load());
// If the protocol version hasn't been set yet, set it now:
if (m_ProtocolVersion == 0)
{
m_ProtocolVersion = a_ProtocolVersion;
}
m_Username = a_Username; m_Username = a_Username;
// Let the plugins know about this event, they may refuse the player: // Let the plugins know about this event, they may refuse the player:
if (cRoot::Get()->GetPluginManager()->CallHookLogin(*this, a_ProtocolVersion, a_Username)) if (cRoot::Get()->GetPluginManager()->CallHookLogin(*this, m_ProtocolVersion, a_Username))
{ {
Destroy(); Destroy();
return false; return false;

View File

@ -359,7 +359,7 @@ public: // tolua_export
/** Called when the protocol has finished logging the user in. /** Called when the protocol has finished logging the user in.
Return true to allow the user in; false to kick them. Return true to allow the user in; false to kick them.
*/ */
bool HandleLogin(UInt32 a_ProtocolVersion, const AString & a_Username); bool HandleLogin(const AString & a_Username);
void SendData(const char * a_Data, size_t a_Size); void SendData(const char * a_Data, size_t a_Size);

View File

@ -2201,7 +2201,7 @@ void cProtocol_1_8_0::HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBu
} }
StartEncryption(DecryptedKey); StartEncryption(DecryptedKey);
m_Client->HandleLogin(4, m_Client->GetUsername()); m_Client->HandleLogin(m_Client->GetUsername());
} }
@ -2238,7 +2238,7 @@ void cProtocol_1_8_0::HandlePacketLoginStart(cByteBuffer & a_ByteBuffer)
return; return;
} }
m_Client->HandleLogin(4, Username); m_Client->HandleLogin(Username);
} }

View File

@ -2223,7 +2223,7 @@ void cProtocol_1_9_0::HandlePacketLoginEncryptionResponse(cByteBuffer & a_ByteBu
} }
StartEncryption(DecryptedKey); StartEncryption(DecryptedKey);
m_Client->HandleLogin(4, m_Client->GetUsername()); m_Client->HandleLogin(m_Client->GetUsername());
} }
@ -2260,7 +2260,7 @@ void cProtocol_1_9_0::HandlePacketLoginStart(cByteBuffer & a_ByteBuffer)
return; return;
} }
m_Client->HandleLogin(4, Username); m_Client->HandleLogin(Username);
} }