1
0

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
This commit is contained in:
faketruth
2012-01-20 17:39:16 +00:00
parent 50a7722242
commit 7b840aa5d8
5 changed files with 27 additions and 6 deletions

View File

@@ -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!");