From 7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b Mon Sep 17 00:00:00 2001 From: faketruth Date: Fri, 20 Jan 2012 17:39:16 +0000 Subject: MCServer is now compatible with Minecraft client 1.1 (as long as the client is not using any mods/plugins I think) git-svn-id: http://mc-server.googlecode.com/svn/trunk@165 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/cClientHandle.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source/cClientHandle.cpp') diff --git a/source/cClientHandle.cpp b/source/cClientHandle.cpp index 46669848e..6e029e14a 100644 --- a/source/cClientHandle.cpp +++ b/source/cClientHandle.cpp @@ -85,7 +85,7 @@ typedef std::list PacketList; struct cClientHandle::sClientHandleState { sClientHandleState() - : ProtocolVersion( 22 ) + : ProtocolVersion( 23 ) , pReceiveThread( 0 ) , pSendThread( 0 ) , pAuthenticateThread( 0 ) @@ -483,10 +483,14 @@ void cClientHandle::HandlePacket( cPacket* a_Packet ) { LOG("LOGIN %s", GetUsername() ); cPacket_Login* PacketData = reinterpret_cast(a_Packet); - if (PacketData->m_ProtocolVersion != m_pState->ProtocolVersion) { + if (PacketData->m_ProtocolVersion < m_pState->ProtocolVersion) { Kick("Your client is outdated!"); return; } + else if( PacketData->m_ProtocolVersion > m_pState->ProtocolVersion ) { + Kick("Your client version is higher than the server!"); + return; + } if( m_pState->Username.compare( PacketData->m_Username ) != 0 ) { Kick("Login Username does not match Handshake username!"); -- cgit v1.2.3