diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-01-20 18:39:16 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-01-20 18:39:16 +0100 |
commit | 7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b (patch) | |
tree | cde505c4726c53f67b168e7e4ce22007cc72ef1a /source/cClientHandle.cpp | |
parent | Terrain generation is synchronous again, async generation has bugs. (diff) | |
download | cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.tar cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.tar.gz cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.tar.bz2 cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.tar.lz cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.tar.xz cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.tar.zst cuberite-7b840aa5d8c925f8ced6289a5ed3dde4a6f8e77b.zip |
Diffstat (limited to 'source/cClientHandle.cpp')
-rw-r--r-- | source/cClientHandle.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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<cPacket*> 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<cPacket_Login*>(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!");
|