Use cMultiVersionProtocol's buffer

This commit is contained in:
Tiger Wang
2020-07-18 19:23:10 +01:00
parent 5141d05ba6
commit bc1b70dcde
4 changed files with 33 additions and 37 deletions
+2 -5
View File
@@ -34,7 +34,7 @@ public:
cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State);
/** Called when client sends some data: */
virtual void DataReceived(const char * a_Data, size_t a_Size) override;
virtual void DataReceived(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size) override;
/** Sending stuff to clients (alphabetically sorted): */
virtual void SendAttachEntity (const cEntity & a_Entity, const cEntity & a_Vehicle) override;
@@ -143,9 +143,6 @@ protected:
/** State of the protocol. 1 = status, 2 = login, 3 = game */
UInt32 m_State;
/** Buffer for the received data */
cByteBuffer m_ReceivedData;
bool m_IsEncrypted;
cAesCfb128Decryptor m_Decryptor;
@@ -155,7 +152,7 @@ protected:
cFile m_CommLogFile;
/** Adds the received (unencrypted) data to m_ReceivedData, parses complete packets */
virtual void AddReceivedData(const char * a_Data, size_t a_Size);
virtual void AddReceivedData(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size);
/** Nobody inherits 1.8, so it doesn't use this method */
virtual UInt32 GetPacketID(ePacketType a_Packet) override;