From 4b998cfedc51cb33595608e2e79c08f02737276c Mon Sep 17 00:00:00 2001 From: "luksor111@gmail.com" Date: Wed, 31 Oct 2012 20:47:09 +0000 Subject: Pickups no longer crash clients. Removed some unnecessary includes. git-svn-id: http://mc-server.googlecode.com/svn/trunk@1020 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Protocol/Protocol142.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'source/Protocol/Protocol142.cpp') 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); -- cgit v1.2.3