diff options
author | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-12 22:08:23 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@outlook.com> | 2020-09-18 17:41:06 +0200 |
commit | 7f372b12cb01f7df9d5466de11b36494353613a8 (patch) | |
tree | cdc570e1e5318beba83cc3b165efa0704b2c0edb /src/Protocol/Protocol_1_8.h | |
parent | Remove unused ServerPort member (diff) | |
download | cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.tar cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.tar.gz cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.tar.bz2 cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.tar.lz cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.tar.xz cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.tar.zst cuberite-7f372b12cb01f7df9d5466de11b36494353613a8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol_1_8.h | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/Protocol/Protocol_1_8.h b/src/Protocol/Protocol_1_8.h index 92eb4b88a..47e483941 100644 --- a/src/Protocol/Protocol_1_8.h +++ b/src/Protocol/Protocol_1_8.h @@ -31,7 +31,7 @@ class cProtocol_1_8_0: public: - cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, UInt32 a_State); + cProtocol_1_8_0(cClientHandle * a_Client, const AString & a_ServerAddress, UInt16 a_ServerPort, State a_State); /** Called when client sends some data: */ virtual void DataReceived(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size) override; @@ -134,6 +134,9 @@ public: protected: + /** State of the protocol. */ + State m_State; + /** Adds the received (unencrypted) data to m_ReceivedData, parses complete packets */ virtual void AddReceivedData(cByteBuffer & a_Buffer, const char * a_Data, size_t a_Size); @@ -190,7 +193,6 @@ protected: The message payload is still in the bytebuffer, the handler reads it specifically for each handled channel */ virtual void HandleVanillaPluginMessage(cByteBuffer & a_ByteBuffer, const AString & a_Channel); - /** Sends the data to the client, encrypting them if needed. */ virtual void SendData(const char * a_Data, size_t a_Size) override; @@ -229,11 +231,20 @@ protected: /** Writes the block entity data for the specified block entity into the packet. */ virtual void WriteBlockEntity(cPacketizer & a_Pkt, const cBlockEntity & a_BlockEntity); - /** State of the protocol. 1 = status, 2 = login, 3 = game */ - UInt32 m_State; - private: + AString m_ServerAddress; + + AString m_AuthServerID; + + bool m_IsEncrypted; + + cAesCfb128Decryptor m_Decryptor; + cAesCfb128Encryptor m_Encryptor; + + /** The logfile where the comm is logged, when g_ShouldLogComm is true */ + cFile m_CommLogFile; + /** Sends an entity teleport packet. Mitigates a 1.8 bug where the position in the entity spawn packet is ignored, and so entities don't show up until a teleport is sent. */ @@ -247,16 +258,4 @@ private: Protocols <= 1.12 use strings, hence this is a static as the string-mapping was append-only for the versions that used it. Returns an empty string, handled correctly by the client, for newer, unsupported statistics. */ static const char * GetProtocolStatisticName(Statistic a_Statistic); - - AString m_ServerAddress; - - AString m_AuthServerID; - - bool m_IsEncrypted; - - cAesCfb128Decryptor m_Decryptor; - cAesCfb128Encryptor m_Encryptor; - - /** The logfile where the comm is logged, when g_ShouldLogComm is true */ - cFile m_CommLogFile; } ; |