aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs74
1 files changed, 74 insertions, 0 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index 6ec87ab..5d42ecd 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -3827,6 +3827,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3827 OutPacket(avp, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); 3827 OutPacket(avp, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
3828 } 3828 }
3829 3829
3830/*
3830 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs) 3831 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
3831 { 3832 {
3832// m_log.DebugFormat("[LLCLIENTVIEW]: Sending animations for {0} to {1}", sourceAgentId, Name); 3833// m_log.DebugFormat("[LLCLIENTVIEW]: Sending animations for {0} to {1}", sourceAgentId, Name);
@@ -3883,6 +3884,79 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3883 3884
3884 OutPacket(ani, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); 3885 OutPacket(ani, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
3885 } 3886 }
3887*/
3888
3889 static private readonly byte[] AvatarAnimationHeader = new byte[] {
3890 Helpers.MSG_RELIABLE | Helpers.MSG_ZEROCODED, // zero code is not as spec
3891 0, 0, 0, 0, // sequence number
3892 0, // extra
3893 20 // ID (high frequency)
3894 };
3895
3896 public void SendAnimations(UUID[] animations, int[] seqs, UUID sourceAgentId, UUID[] objectIDs)
3897 {
3898 // m_log.DebugFormat("[LLCLIENTVIEW]: Sending animations for {0} to {1}", sourceAgentId, Name);
3899
3900 UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint);
3901 byte[] data = buf.Data;
3902 //setup header
3903 Buffer.BlockCopy(AvatarAnimationHeader, 0, data, 0, 7);
3904 //agent block
3905 sourceAgentId.ToBytes(data, 7);
3906
3907 // animations count
3908 data[23] = (byte)animations.Length;
3909
3910 int pos = 24;
3911
3912 //self animations
3913 if (sourceAgentId == AgentId)
3914 {
3915 List<int> withobjects = new List<int>(animations.Length);
3916 List<int> noobjects = new List<int>(animations.Length);
3917 for (int i = 0; i < animations.Length; ++i)
3918 {
3919 if (objectIDs[i] == sourceAgentId || objectIDs[i] == UUID.Zero)
3920 noobjects.Add(i);
3921 else
3922 withobjects.Add(i);
3923 }
3924
3925 // first the ones with corresponding objects
3926 foreach (int i in withobjects)
3927 {
3928 animations[i].ToBytes(data, pos); pos += 16;
3929 Utils.IntToBytesSafepos(seqs[i], data, pos); pos += 4;
3930 }
3931 // then the rest
3932 foreach (int i in noobjects)
3933 {
3934 animations[i].ToBytes(data, pos); pos += 16;
3935 Utils.IntToBytesSafepos(seqs[i], data, pos); pos += 4;
3936 }
3937 // object ids block
3938 data[pos++] = (byte)withobjects.Count;
3939 foreach (int i in withobjects)
3940 {
3941 objectIDs[i].ToBytes(data, pos); pos += 16;
3942 }
3943 }
3944 else
3945 {
3946 for(int i = 0; i < animations.Length; ++i)
3947 {
3948 animations[i].ToBytes(data, pos); pos += 16;
3949 Utils.IntToBytesSafepos(seqs[i], data, pos); pos += 4;
3950 }
3951 data[pos++] = 0; // no object ids
3952 }
3953
3954 data[pos++] = 0; // no physical avatar events
3955
3956 buf.DataLength = pos;
3957 m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority,
3958 null, false, false);
3959 }
3886 3960
3887 public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId) 3961 public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId)
3888 { 3962 {