1
0

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
This commit is contained in:
luksor111@gmail.com 2012-10-31 20:47:09 +00:00
parent 9012e834d7
commit 4b998cfedc
2 changed files with 22 additions and 2 deletions

View File

@ -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);

View File

@ -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;