From 9eed83c33ae8c2bbb1781a01f05326dba667f4e3 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Tue, 11 Sep 2012 12:01:34 +0000 Subject: Merged in a patch for sounds by l0udPL http://forum.mc-server.org/showthread.php?tid=434&pid=4564#pid4564 git-svn-id: http://mc-server.googlecode.com/svn/trunk@858 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/Protocol132.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'source/Protocol132.cpp') diff --git a/source/Protocol132.cpp b/source/Protocol132.cpp index e291c0c69..37343e443 100644 --- a/source/Protocol132.cpp +++ b/source/Protocol132.cpp @@ -59,6 +59,7 @@ enum PACKET_CHUNK_DATA = 0x33, PACKET_BLOCK_CHANGE = 0x35, PACKET_BLOCK_ACTION = 0x36, + PACKET_SOUND_EFFECT = 0x3e } ; @@ -310,6 +311,23 @@ void cProtocol132::SendPlayerSpawn(const cPlayer & a_Player) +void cProtocol132::SendSoundEffect(const AString & a_SoundName, int a_SrcX, int a_SrcY, int a_SrcZ, float a_Volume, float a_Pitch) +{ + cCSLock Lock(m_CSPacket); + WriteByte (PACKET_SOUND_EFFECT); + WriteString (a_SoundName); + WriteInt (a_SrcX); + WriteInt (a_SrcY); + WriteInt (a_SrcZ); + WriteFloat (a_Volume); + WriteByte ((char)(a_Pitch * 63.0f)); + Flush(); +} + + + + + void cProtocol132::SendSpawnMob(const cMonster & a_Mob) { cCSLock Lock(m_CSPacket); -- cgit v1.2.3