1
0
Fork 0

Removed GetProtocolVersion() from the protocols.

This commit is contained in:
Howaner 2014-09-11 22:27:35 +02:00
parent d815aeaefd
commit 6d5a5eb665
7 changed files with 6 additions and 19 deletions

View File

@ -46,11 +46,11 @@ typedef unsigned char Byte;
class cProtocol
{
public:
cProtocol(cClientHandle * a_Client, int a_ProtocolVersion) :
m_ProtocolVersion(a_ProtocolVersion),
cProtocol(cClientHandle * a_Client) :
m_Client(a_Client)
{
}
virtual ~cProtocol() {}
/// Called when client sends some data
@ -131,11 +131,7 @@ public:
/// Returns the ServerID used for authentication through session.minecraft.net
virtual AString GetAuthServerID(void) = 0;
/** Returns the protocol version of this protocol. */
int GetProtocolVersion(void) const { return m_ProtocolVersion; }
protected:
int m_ProtocolVersion;
cClientHandle * m_Client;
cCriticalSection m_CSPacket; // Each SendXYZ() function must acquire this CS in order to send the whole packet at once

View File

@ -16,7 +16,6 @@ Documentation:
#include "../ClientHandle.h"
#include "../World.h"
#include "ChunkDataSerializer.h"
#include "ProtocolRecognizer.h"
#include "../Entities/Entity.h"
#include "../Entities/ExpOrb.h"
#include "../Mobs/Monster.h"
@ -133,7 +132,7 @@ typedef unsigned char Byte;
cProtocol125::cProtocol125(cClientHandle * a_Client) :
super(a_Client, cProtocolRecognizer::PROTO_VERSION_1_2_5),
super(a_Client),
m_ReceivedData(32 KiB),
m_LastSentDimension(dimNotSet)
{

View File

@ -5,7 +5,6 @@
#include "Globals.h"
#include "ChunkDataSerializer.h"
#include "ProtocolRecognizer.h"
#include "Protocol132.h"
#include "../Root.h"
#include "../Server.h"
@ -79,7 +78,6 @@ cProtocol132::cProtocol132(cClientHandle * a_Client) :
super(a_Client),
m_IsEncrypted(false)
{
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_3_2;
}

View File

@ -23,7 +23,6 @@ Implements the 1.4.x protocol classes representing these protocols:
#include "../UI/Window.h"
#include "../Entities/Pickup.h"
#include "../Entities/FallingBlock.h"
#include "ProtocolRecognizer.h"
#ifdef _MSC_VER
#pragma warning(push)
@ -73,7 +72,6 @@ enum
cProtocol142::cProtocol142(cClientHandle * a_Client) :
super(a_Client)
{
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_4_2;
}
@ -152,7 +150,6 @@ void cProtocol142::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_Do
cProtocol146::cProtocol146(cClientHandle * a_Client) :
super(a_Client)
{
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_4_6;
}

View File

@ -12,7 +12,6 @@ Implements the 1.7.x protocol classes:
#include "Globals.h"
#include "json/json.h"
#include "Protocol17x.h"
#include "ProtocolRecognizer.h"
#include "ChunkDataSerializer.h"
#include "PolarSSL++/Sha1Checksum.h"
@ -93,7 +92,7 @@ extern bool g_ShouldLogCommIn, g_ShouldLogCommOut;
// cProtocol172:
cProtocol172::cProtocol172(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
super(a_Client, cProtocolRecognizer::PROTO_VERSION_1_7_2),
super(a_Client),
m_ServerAddress(a_ServerAddress),
m_ServerPort(a_ServerPort),
m_State(a_State),
@ -3064,7 +3063,6 @@ void cProtocol172::cPacketizer::WriteEntityProperties(const cEntity & a_Entity)
cProtocol176::cProtocol176(cClientHandle * a_Client, const AString &a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
super(a_Client, a_ServerAddress, a_ServerPort, a_State)
{
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_7_6;
}

View File

@ -11,7 +11,6 @@ Implements the 1.8.x protocol classes:
#include "Globals.h"
#include "json/json.h"
#include "Protocol18x.h"
#include "ProtocolRecognizer.h"
#include "ChunkDataSerializer.h"
#include "PolarSSL++/Sha1Checksum.h"
@ -92,7 +91,7 @@ extern bool g_ShouldLogCommIn, g_ShouldLogCommOut;
// cProtocol180:
cProtocol180::cProtocol180(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
super(a_Client, cProtocolRecognizer::PROTO_VERSION_1_8_0),
super(a_Client),
m_ServerAddress(a_ServerAddress),
m_ServerPort(a_ServerPort),
m_State(a_State),

View File

@ -26,7 +26,7 @@
cProtocolRecognizer::cProtocolRecognizer(cClientHandle * a_Client) :
super(a_Client, 0),
super(a_Client),
m_Protocol(NULL),
m_Buffer(512)
{