1
0

Added support for the packet #28 (0x1C): ENTITY_VELOCITY

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1283 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
keyboard.osh@gmail.com
2013-03-18 02:51:55 +00:00
parent 1ed3b3aed2
commit 8557ed8359
13 changed files with 84 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ enum
PACKET_COLLECT_PICKUP = 0x16,
PACKET_SPAWN_OBJECT = 0x17,
PACKET_SPAWN_MOB = 0x18,
PACKET_ENTITY_VELOCITY = 0x1c,
PACKET_DESTROY_ENTITY = 0x1d,
PACKET_ENTITY = 0x1e,
PACKET_ENT_REL_MOVE = 0x1f,
@@ -276,6 +277,21 @@ void cProtocol125::SendDisconnect(const AString & a_Reason)
void cProtocol125::SendEntVelocity(const cEntity & a_Entity)
{
ASSERT(a_Entity.GetUniqueID() != m_Client->GetPlayer()->GetUniqueID()); // Must not send for self
cCSLock Lock(m_CSPacket);
WriteByte(PACKET_ENTITY_VELOCITY);
WriteInt (a_Entity.GetUniqueID());
WriteShort((short) (a_Entity.GetSpeedX() * 400)); //400 = 8000 / 20
WriteShort((short) (a_Entity.GetSpeedY() * 400));
WriteShort((short) (a_Entity.GetSpeedZ() * 400));
Flush();
}
void cProtocol125::SendEntHeadLook(const cEntity & a_Entity)
{