diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-23 17:57:25 +0200 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-09-23 17:57:25 +0200 |
commit | 60c29274d38c652d26b5c71955daef7d66114c7b (patch) | |
tree | fe2ba84e095c5249234451767a0e99f77e672829 /source | |
parent | ProtoProxy: added the PACKET_PLAYER_ABILITIES packet parsing for client-side (diff) | |
download | cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.tar cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.tar.gz cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.tar.bz2 cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.tar.lz cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.tar.xz cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.tar.zst cuberite-60c29274d38c652d26b5c71955daef7d66114c7b.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Protocol132.cpp | 15 | ||||
-rw-r--r-- | source/Protocol132.h | 21 |
2 files changed, 26 insertions, 10 deletions
diff --git a/source/Protocol132.cpp b/source/Protocol132.cpp index 32fd4b63c..2b8d4c19c 100644 --- a/source/Protocol132.cpp +++ b/source/Protocol132.cpp @@ -53,6 +53,7 @@ enum {
PACKET_KEEP_ALIVE = 0x00,
PACKET_LOGIN = 0x01,
+ PACKET_ENTITY_EQUIPMENT = 0x05,
PACKET_COMPASS = 0x06,
PACKET_PLAYER_SPAWN = 0x14,
PACKET_SPAWN_MOB = 0x18,
@@ -256,6 +257,20 @@ void cProtocol132::SendDestroyEntity(const cEntity & a_Entity) +void cProtocol132::SendEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte (PACKET_ENTITY_EQUIPMENT);
+ WriteInt (a_Entity.GetUniqueID());
+ WriteShort(a_SlotNum);
+ WriteItem (a_Item);
+ Flush();
+}
+
+
+
+
+
void cProtocol132::SendKeepAlive(int a_PingID)
{
cCSLock Lock(m_CSPacket);
diff --git a/source/Protocol132.h b/source/Protocol132.h index 5705ba680..8c70d8774 100644 --- a/source/Protocol132.h +++ b/source/Protocol132.h @@ -32,16 +32,17 @@ public: 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, const cWorld & a_World) override;
- virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
- virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override; // a_Src coords are Block * 8
- virtual void SendSpawnMob (const cMonster & a_Mob) override;
- virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
- virtual void SendWholeInventory(const cWindow & a_Window) override;
+ 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 SendEntityEquipment(const cEntity & a_Entity, short a_SlotNum, const cItem & a_Item) override;
+ virtual void SendLogin (const cPlayer & a_Player, const cWorld & a_World) override;
+ virtual void SendPlayerSpawn (const cPlayer & a_Player) override;
+ virtual void SendSoundEffect (const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) override; // a_Src coords are Block * 8
+ virtual void SendSpawnMob (const cMonster & a_Mob) override;
+ virtual void SendUnloadChunk (int a_ChunkX, int a_ChunkZ) override;
+ virtual void SendWholeInventory (const cWindow & a_Window) override;
virtual AString GetAuthServerID(void) override;
|