void cProtocol125::SendEntityLook(const cEntity & a_Entity) { ASSERT(a_Entity.GetUniqueID() != m_Client->GetPlayer()->GetUniqueID()); // Must not send for self cCSLock Lock(m_CSPacket); WriteByte(PACKET_ENT_LOOK); WriteInt (a_Entity.GetUniqueID()); WriteChar((char)((a_Entity.GetYaw() / 360.f) * 256)); WriteChar((char)((a_Entity.GetPitch() / 360.f) * 256)); Flush(); }
void cProtocol125::SendTeleportEntity(const cEntity & a_Entity) { cCSLock Lock(m_CSPacket); WriteByte (PACKET_ENT_TELEPORT); WriteInt (a_Entity.GetUniqueID()); WriteInt ((int)(floor(a_Entity.GetPosX() * 32))); WriteInt ((int)(floor(a_Entity.GetPosY() * 32))); WriteInt ((int)(floor(a_Entity.GetPosZ() * 32))); WriteChar ((char)((a_Entity.GetYaw() / 360.f) * 256)); WriteChar ((char)((a_Entity.GetPitch() / 360.f) * 256)); Flush(); }
void cProtocol125::SendEntityRelMoveLook(const cEntity & a_Entity, char a_RelX, char a_RelY, char a_RelZ) { ASSERT(a_Entity.GetUniqueID() != m_Client->GetPlayer()->GetUniqueID()); // Must not send for self cCSLock Lock(m_CSPacket); WriteByte(PACKET_ENT_REL_MOVE_LOOK); WriteInt (a_Entity.GetUniqueID()); WriteByte(a_RelX); WriteByte(a_RelY); WriteByte(a_RelZ); WriteByte((char)((a_Entity.GetRotation() / 360.f) * 256)); WriteByte((char)((a_Entity.GetPitch() / 360.f) * 256)); Flush(); }
void cProtocol125::SendSpawnVehicle(const cEntity & a_Vehicle, char a_VehicleType) { cCSLock Lock(m_CSPacket); WriteByte (PACKET_SPAWN_OBJECT); WriteInt (a_Vehicle.GetUniqueID()); WriteByte (a_VehicleType); WriteInt ((int)(a_Vehicle.GetPosX() * 32)); WriteInt ((int)(a_Vehicle.GetPosY() * 32)); WriteInt ((int)(a_Vehicle.GetPosZ() * 32)); WriteByte ((Byte)((a_Vehicle.GetPitch() / 360.f) * 256)); WriteByte ((Byte)((a_Vehicle.GetRotation() / 360.f) * 256)); WriteInt (1); WriteShort((short)(a_Vehicle.GetSpeedX() * 400)); WriteShort((short)(a_Vehicle.GetSpeedY() * 400)); WriteShort((short)(a_Vehicle.GetSpeedZ() * 400)); Flush(); }