summaryrefslogtreecommitdiffstats
path: root/source/Protocol/Protocol142.cpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--source/Protocol/Protocol142.cpp21
1 files changed, 21 insertions, 0 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);