Removed GetProtocolVersion() from the protocols.
This commit is contained in:
parent
d815aeaefd
commit
6d5a5eb665
@ -46,11 +46,11 @@ typedef unsigned char Byte;
|
|||||||
class cProtocol
|
class cProtocol
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
cProtocol(cClientHandle * a_Client, int a_ProtocolVersion) :
|
cProtocol(cClientHandle * a_Client) :
|
||||||
m_ProtocolVersion(a_ProtocolVersion),
|
|
||||||
m_Client(a_Client)
|
m_Client(a_Client)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~cProtocol() {}
|
virtual ~cProtocol() {}
|
||||||
|
|
||||||
/// Called when client sends some data
|
/// Called when client sends some data
|
||||||
@ -131,11 +131,7 @@ public:
|
|||||||
/// Returns the ServerID used for authentication through session.minecraft.net
|
/// Returns the ServerID used for authentication through session.minecraft.net
|
||||||
virtual AString GetAuthServerID(void) = 0;
|
virtual AString GetAuthServerID(void) = 0;
|
||||||
|
|
||||||
/** Returns the protocol version of this protocol. */
|
|
||||||
int GetProtocolVersion(void) const { return m_ProtocolVersion; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int m_ProtocolVersion;
|
|
||||||
cClientHandle * m_Client;
|
cClientHandle * m_Client;
|
||||||
cCriticalSection m_CSPacket; // Each SendXYZ() function must acquire this CS in order to send the whole packet at once
|
cCriticalSection m_CSPacket; // Each SendXYZ() function must acquire this CS in order to send the whole packet at once
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ Documentation:
|
|||||||
#include "../ClientHandle.h"
|
#include "../ClientHandle.h"
|
||||||
#include "../World.h"
|
#include "../World.h"
|
||||||
#include "ChunkDataSerializer.h"
|
#include "ChunkDataSerializer.h"
|
||||||
#include "ProtocolRecognizer.h"
|
|
||||||
#include "../Entities/Entity.h"
|
#include "../Entities/Entity.h"
|
||||||
#include "../Entities/ExpOrb.h"
|
#include "../Entities/ExpOrb.h"
|
||||||
#include "../Mobs/Monster.h"
|
#include "../Mobs/Monster.h"
|
||||||
@ -133,7 +132,7 @@ typedef unsigned char Byte;
|
|||||||
|
|
||||||
|
|
||||||
cProtocol125::cProtocol125(cClientHandle * a_Client) :
|
cProtocol125::cProtocol125(cClientHandle * a_Client) :
|
||||||
super(a_Client, cProtocolRecognizer::PROTO_VERSION_1_2_5),
|
super(a_Client),
|
||||||
m_ReceivedData(32 KiB),
|
m_ReceivedData(32 KiB),
|
||||||
m_LastSentDimension(dimNotSet)
|
m_LastSentDimension(dimNotSet)
|
||||||
{
|
{
|
||||||
|
@ -5,7 +5,6 @@
|
|||||||
|
|
||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "ChunkDataSerializer.h"
|
#include "ChunkDataSerializer.h"
|
||||||
#include "ProtocolRecognizer.h"
|
|
||||||
#include "Protocol132.h"
|
#include "Protocol132.h"
|
||||||
#include "../Root.h"
|
#include "../Root.h"
|
||||||
#include "../Server.h"
|
#include "../Server.h"
|
||||||
@ -79,7 +78,6 @@ cProtocol132::cProtocol132(cClientHandle * a_Client) :
|
|||||||
super(a_Client),
|
super(a_Client),
|
||||||
m_IsEncrypted(false)
|
m_IsEncrypted(false)
|
||||||
{
|
{
|
||||||
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_3_2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -23,7 +23,6 @@ Implements the 1.4.x protocol classes representing these protocols:
|
|||||||
#include "../UI/Window.h"
|
#include "../UI/Window.h"
|
||||||
#include "../Entities/Pickup.h"
|
#include "../Entities/Pickup.h"
|
||||||
#include "../Entities/FallingBlock.h"
|
#include "../Entities/FallingBlock.h"
|
||||||
#include "ProtocolRecognizer.h"
|
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
#pragma warning(push)
|
#pragma warning(push)
|
||||||
@ -73,7 +72,6 @@ enum
|
|||||||
cProtocol142::cProtocol142(cClientHandle * a_Client) :
|
cProtocol142::cProtocol142(cClientHandle * a_Client) :
|
||||||
super(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) :
|
cProtocol146::cProtocol146(cClientHandle * a_Client) :
|
||||||
super(a_Client)
|
super(a_Client)
|
||||||
{
|
{
|
||||||
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_4_6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -12,7 +12,6 @@ Implements the 1.7.x protocol classes:
|
|||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "json/json.h"
|
#include "json/json.h"
|
||||||
#include "Protocol17x.h"
|
#include "Protocol17x.h"
|
||||||
#include "ProtocolRecognizer.h"
|
|
||||||
#include "ChunkDataSerializer.h"
|
#include "ChunkDataSerializer.h"
|
||||||
#include "PolarSSL++/Sha1Checksum.h"
|
#include "PolarSSL++/Sha1Checksum.h"
|
||||||
|
|
||||||
@ -93,7 +92,7 @@ extern bool g_ShouldLogCommIn, g_ShouldLogCommOut;
|
|||||||
// cProtocol172:
|
// cProtocol172:
|
||||||
|
|
||||||
cProtocol172::cProtocol172(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
|
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_ServerAddress(a_ServerAddress),
|
||||||
m_ServerPort(a_ServerPort),
|
m_ServerPort(a_ServerPort),
|
||||||
m_State(a_State),
|
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) :
|
cProtocol176::cProtocol176(cClientHandle * a_Client, const AString &a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
|
||||||
super(a_Client, a_ServerAddress, a_ServerPort, a_State)
|
super(a_Client, a_ServerAddress, a_ServerPort, a_State)
|
||||||
{
|
{
|
||||||
m_ProtocolVersion = cProtocolRecognizer::PROTO_VERSION_1_7_6;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@ Implements the 1.8.x protocol classes:
|
|||||||
#include "Globals.h"
|
#include "Globals.h"
|
||||||
#include "json/json.h"
|
#include "json/json.h"
|
||||||
#include "Protocol18x.h"
|
#include "Protocol18x.h"
|
||||||
#include "ProtocolRecognizer.h"
|
|
||||||
#include "ChunkDataSerializer.h"
|
#include "ChunkDataSerializer.h"
|
||||||
#include "PolarSSL++/Sha1Checksum.h"
|
#include "PolarSSL++/Sha1Checksum.h"
|
||||||
|
|
||||||
@ -92,7 +91,7 @@ extern bool g_ShouldLogCommIn, g_ShouldLogCommOut;
|
|||||||
// cProtocol180:
|
// cProtocol180:
|
||||||
|
|
||||||
cProtocol180::cProtocol180(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State) :
|
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_ServerAddress(a_ServerAddress),
|
||||||
m_ServerPort(a_ServerPort),
|
m_ServerPort(a_ServerPort),
|
||||||
m_State(a_State),
|
m_State(a_State),
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
|
|
||||||
cProtocolRecognizer::cProtocolRecognizer(cClientHandle * a_Client) :
|
cProtocolRecognizer::cProtocolRecognizer(cClientHandle * a_Client) :
|
||||||
super(a_Client, 0),
|
super(a_Client),
|
||||||
m_Protocol(NULL),
|
m_Protocol(NULL),
|
||||||
m_Buffer(512)
|
m_Buffer(512)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user