From 40fd37f95af68a213b0c3a465858c27fa7c8cfdf Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 10 Dec 2007 15:08:44 +0000 Subject: Refactored animation handling in ScenePresence. Now maintains a list of current animations. * Fixes weirdness when typing and sitting at the same time * Should fix bug #32 (getting stuck in edit appearance pose) * Crouchwalk and possibly jump may need more looking into --- OpenSim/Region/ClientStack/ClientView.cs | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/ClientView.cs b/OpenSim/Region/ClientStack/ClientView.cs index 1a544b8..db25ee6 100644 --- a/OpenSim/Region/ClientStack/ClientView.cs +++ b/OpenSim/Region/ClientStack/ClientView.cs @@ -392,6 +392,7 @@ namespace OpenSim.Region.ClientStack public event AgentSit OnAgentSit; public event AvatarPickerRequest OnAvatarPickerRequest; public event StartAnim OnStartAnim; + public event StopAnim OnStopAnim; public event Action OnRequestAvatarsData; public event LinkObjects OnLinkObjects; public event DelinkObjects OnDelinkObjects; @@ -1265,7 +1266,7 @@ namespace OpenSim.Region.ClientStack OutPacket(avp, ThrottleOutPacketType.Task); } - public void SendAnimation(LLUUID animID, int seq, LLUUID sourceAgentId) + public void SendAnimations(LLUUID[] animations, int[] seqs, LLUUID sourceAgentId) { AvatarAnimationPacket ani = new AvatarAnimationPacket(); ani.AnimationSourceList = new AvatarAnimationPacket.AnimationSourceListBlock[1]; @@ -1273,10 +1274,15 @@ namespace OpenSim.Region.ClientStack ani.AnimationSourceList[0].ObjectID = sourceAgentId; ani.Sender = new AvatarAnimationPacket.SenderBlock(); ani.Sender.ID = sourceAgentId; - ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[1]; - ani.AnimationList[0] = new AvatarAnimationPacket.AnimationListBlock(); - ani.AnimationList[0].AnimID = animID; - ani.AnimationList[0].AnimSequenceID = seq; + ani.AnimationList = new AvatarAnimationPacket.AnimationListBlock[animations.Length]; + + for (int i = 0; i < animations.Length; ++i) + { + ani.AnimationList[i] = new AvatarAnimationPacket.AnimationListBlock(); + ani.AnimationList[i].AnimID = animations[i]; + ani.AnimationList[i].AnimSequenceID = seqs[i]; + } + OutPacket(ani, ThrottleOutPacketType.Task); } @@ -2485,6 +2491,13 @@ namespace OpenSim.Region.ClientStack OnStartAnim(this, AgentAni.AnimationList[i].AnimID, 1); } } + else + { + if (OnStopAnim != null) + { + OnStopAnim(this, AgentAni.AnimationList[i].AnimID); + } + } } break; case PacketType.AgentRequestSit: -- cgit v1.1