diff options
author | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-31 21:47:09 +0100 |
---|---|---|
committer | luksor111@gmail.com <luksor111@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-10-31 21:47:09 +0100 |
commit | 4b998cfedc51cb33595608e2e79c08f02737276c (patch) | |
tree | 84551c085f5aaaf5562ebbead8734fe530ddfa92 /source | |
parent | Initial 1.4.2 support. (diff) | |
download | cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.tar cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.tar.gz cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.tar.bz2 cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.tar.lz cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.tar.xz cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.tar.zst cuberite-4b998cfedc51cb33595608e2e79c08f02737276c.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Protocol/Protocol142.cpp | 21 | ||||
-rw-r--r-- | source/Protocol/Protocol142.h | 3 |
2 files changed, 22 insertions, 2 deletions
diff --git a/source/Protocol/Protocol142.cpp b/source/Protocol/Protocol142.cpp index 6784a8ea4..b4b2b66c1 100644 --- a/source/Protocol/Protocol142.cpp +++ b/source/Protocol/Protocol142.cpp @@ -42,6 +42,7 @@ typedef unsigned char Byte; enum
{
PACKET_UPDATE_TIME = 0x04,
+ PACKET_PICKUP_SPAWN = 0x15,
PACKET_SOUND_PARTICLE_EFFECT = 0x3d
} ;
@@ -85,6 +86,26 @@ int cProtocol142::ParseLogin(void) +void cProtocol142::SendPickupSpawn(const cPickup & a_Pickup)
+{
+ cCSLock Lock(m_CSPacket);
+ WriteByte (PACKET_PICKUP_SPAWN);
+ WriteInt (a_Pickup.GetUniqueID());
+ WriteShort (a_Pickup.GetItem()->m_ItemType);
+ WriteByte (a_Pickup.GetItem()->m_ItemCount);
+ WriteShort (a_Pickup.GetItem()->m_ItemDamage);
+ WriteShort (-1); //TODO: Implement item metadata
+ WriteVectorI((Vector3i)(a_Pickup.GetPosition() * 32));
+ WriteByte ((char)(a_Pickup.GetSpeed().x * 8));
+ WriteByte ((char)(a_Pickup.GetSpeed().y * 8));
+ WriteByte ((char)(a_Pickup.GetSpeed().z * 8));
+ Flush();
+}
+
+
+
+
+
void cProtocol142::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data)
{
cCSLock Lock(m_CSPacket);
diff --git a/source/Protocol/Protocol142.h b/source/Protocol/Protocol142.h index e84cab72c..8b2205e44 100644 --- a/source/Protocol/Protocol142.h +++ b/source/Protocol/Protocol142.h @@ -10,8 +10,6 @@ #pragma once
#include "Protocol132.h"
-#include "../../CryptoPP/modes.h"
-#include "../../CryptoPP/aes.h"
@@ -27,6 +25,7 @@ public: virtual ~cProtocol142();
// Sending commands (alphabetically sorted):
+ virtual void SendPickupSpawn (const cPickup & a_Pickup) override;
virtual void SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_SrcY, int a_SrcZ, int a_Data) override;
virtual void SendTimeUpdate (Int64 a_WorldTime) override;
|