diff options
author | UbitUmarov | 2019-03-19 09:44:13 +0000 |
---|---|---|
committer | UbitUmarov | 2019-03-19 09:44:13 +0000 |
commit | a7927e9d7b6ad4357b3b6701b79ad9f48496888a (patch) | |
tree | ccadf0228f30de0bc9f23a06ced7c70e708c0ea3 /OpenSim | |
parent | lludp SimStats encoding (diff) | |
download | opensim-SC-a7927e9d7b6ad4357b3b6701b79ad9f48496888a.zip opensim-SC-a7927e9d7b6ad4357b3b6701b79ad9f48496888a.tar.gz opensim-SC-a7927e9d7b6ad4357b3b6701b79ad9f48496888a.tar.bz2 opensim-SC-a7927e9d7b6ad4357b3b6701b79ad9f48496888a.tar.xz |
lludp ObjectAnimation encoding
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | 38 |
1 files changed, 29 insertions, 9 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs index 41f40da..dd67e67 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs | |||
@@ -4641,6 +4641,13 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
4641 | 15 // ID (high frequency) | 4641 | 15 // ID (high frequency) |
4642 | }; | 4642 | }; |
4643 | 4643 | ||
4644 | static private readonly byte[] ObjectAnimationHeader = new byte[] { | ||
4645 | Helpers.MSG_RELIABLE, | ||
4646 | 0, 0, 0, 0, // sequence number | ||
4647 | 0, // extra | ||
4648 | 30 // ID (high frequency) | ||
4649 | }; | ||
4650 | |||
4644 | private void ProcessEntityUpdates(int maxUpdatesBytes) | 4651 | private void ProcessEntityUpdates(int maxUpdatesBytes) |
4645 | { | 4652 | { |
4646 | if (!IsActive) | 4653 | if (!IsActive) |
@@ -5084,6 +5091,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5084 | { | 5091 | { |
5085 | if (sop.Animations == null) | 5092 | if (sop.Animations == null) |
5086 | continue; | 5093 | continue; |
5094 | |||
5087 | SceneObjectGroup sog = sop.ParentGroup; | 5095 | SceneObjectGroup sog = sop.ParentGroup; |
5088 | if (sog == null || sog.IsDeleted) | 5096 | if (sog == null || sog.IsDeleted) |
5089 | continue; | 5097 | continue; |
@@ -5096,18 +5104,30 @@ namespace OpenSim.Region.ClientStack.LindenUDP | |||
5096 | int[] seqs = null; | 5104 | int[] seqs = null; |
5097 | int count = sop.GetAnimations(out ids, out seqs); | 5105 | int count = sop.GetAnimations(out ids, out seqs); |
5098 | 5106 | ||
5099 | ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation); | 5107 | UDPPacketBuffer buf = m_udpServer.GetNewUDPBuffer(m_udpClient.RemoteEndPoint); |
5100 | ani.Sender = new ObjectAnimationPacket.SenderBlock(); | 5108 | byte[] data = buf.Data; |
5101 | ani.Sender.ID = sop.UUID; | 5109 | |
5102 | ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[count]; | 5110 | //setup header |
5111 | Buffer.BlockCopy(ObjectAnimationHeader, 0, data , 0, 7); | ||
5112 | |||
5113 | // sender block | ||
5114 | sop.UUID.ToBytes(data, 7); // 23 | ||
5115 | |||
5116 | //animations block | ||
5117 | if (count > 255) | ||
5118 | count = 255; | ||
5119 | |||
5120 | data[23] = (byte)count; | ||
5103 | 5121 | ||
5104 | for(int i = 0; i< count; i++) | 5122 | int pos = 24; |
5123 | for(int i = 0; i < count; i++) | ||
5105 | { | 5124 | { |
5106 | ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock(); | 5125 | ids[i].ToBytes(data, pos); pos += 16; |
5107 | ani.AnimationList[i].AnimID = ids[i]; | 5126 | Utils.IntToBytesSafepos(seqs[i], data, pos); pos += 4; |
5108 | ani.AnimationList[i].AnimSequenceID = seqs[i]; | ||
5109 | } | 5127 | } |
5110 | OutPacket(ani, ThrottleOutPacketType.Task, true); | 5128 | |
5129 | buf.DataLength = pos; | ||
5130 | m_udpServer.SendUDPPacket(m_udpClient, buf, ThrottleOutPacketType.Task); | ||
5111 | } | 5131 | } |
5112 | } | 5132 | } |
5113 | 5133 | ||