summaryrefslogtreecommitdiffstats
path: root/source/Protocol132.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-31 23:59:57 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-31 23:59:57 +0200
commit7824ce9d6352664bd291e57a3084e5c51af5d4a6 (patch)
tree8ba7b1476ec2c807b9ed2f0d7cb224f219dbd57b /source/Protocol132.h
parentFix for the nightbuild script packing the wrong PDBs (diff)
downloadcuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.tar
cuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.tar.gz
cuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.tar.bz2
cuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.tar.lz
cuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.tar.xz
cuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.tar.zst
cuberite-7824ce9d6352664bd291e57a3084e5c51af5d4a6.zip
Diffstat (limited to '')
-rw-r--r--source/Protocol132.h40
1 files changed, 35 insertions, 5 deletions
diff --git a/source/Protocol132.h b/source/Protocol132.h
index a0e16b585..2373693b7 100644
--- a/source/Protocol132.h
+++ b/source/Protocol132.h
@@ -24,28 +24,58 @@ class cProtocol132 :
public:
cProtocol132(cClientHandle * a_Client);
+
+ // DEBUG:
+ virtual ~cProtocol132();
/// Called when client sends some data:
virtual void DataReceived(const char * a_Data, int a_Size) override;
+
+ // Sending commands:
+ virtual void SendBlockAction (int a_BlockX, int a_BlockY, int a_BlockZ, char a_Byte1, char a_Byte2, BLOCKTYPE a_BlockType) override;
+ virtual void SendBlockChange (int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta) override;
+ virtual void SendChunkData (int a_ChunkX, int a_ChunkZ, cChunkDataSerializer & a_Serializer) override;
+ virtual void SendDestroyEntity(const cEntity & a_Entity) override;
+ virtual void SendLogin (const cPlayer & a_Player) override;
+ virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
+ virtual void SendSpawnMob (const cMonster & a_Mob) override;
+ virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
+
+ // DEBUG:
+ virtual void SendKeepAlive (int a_PingID) override;
/// Handling of the additional packets:
virtual int ParsePacket(unsigned char a_PacketType) override;
// Modified packets:
- virtual int ParseHandshake(void) override;
- virtual int ParseLogin (void) override;
+ virtual int ParseBlockPlace (void) override;
+ virtual int ParseHandshake (void) override;
+ virtual int ParseLogin (void) override;
+ virtual int ParsePlayerAbilities(void) override;
// New packets:
virtual int ParseClientStatuses (void);
virtual int ParseEncryptionKeyResponse(void);
-
- virtual void SendData(const char * a_Data, int a_Size);
+ virtual int ParseLocaleViewDistance (void);
protected:
bool m_IsEncrypted;
- CryptoPP::CFB_Mode<CryptoPP::AES>::Decryption m_Decryptor; // ((byte*)sDecryptedSharedSecret.c_str(),(unsigned int)16, IV, 1);
+ CryptoPP::CFB_Mode<CryptoPP::AES>::Decryption m_Decryptor;
CryptoPP::CFB_Mode<CryptoPP::AES>::Encryption m_Encryptor;
+ // DEBUG:
+ AString m_DataToSend;
+ int m_CurrentIn, m_CurrentOut;
+ int m_EncIn, m_EncOut;
+
+ virtual void SendData(const char * a_Data, int a_Size) override;
+
+ // DEBUG:
+ virtual void Flush(void) override;
+
+ // Items in slots are sent differently
+ virtual void WriteItem(const cItem & a_Item) override;
+
/// Decrypts the key and nonce, checks nonce, starts the symmetric encryption
void HandleEncryptionKeyResponse(const AString & a_EncKey, const AString & a_EncNonce);