aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-12-28 13:52:59 +0000
committerUbitUmarov2018-12-28 13:52:59 +0000
commit4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4 (patch)
tree6e8200b3b7a3c0465853e42bbd790a59ccd4e312 /OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
parentupdate pbs (diff)
downloadopensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.zip
opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.gz
opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.bz2
opensim-SC-4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4.tar.xz
now break several things at same time... sog/sop updates, threads options,...
Diffstat (limited to 'OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs')
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs84
1 files changed, 82 insertions, 2 deletions
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
index c42446c..882f22f 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs
@@ -454,9 +454,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
454 public string Name { get { return FirstName + " " + LastName; } } 454 public string Name { get { return FirstName + " " + LastName; } }
455 455
456 public uint CircuitCode { get { return m_circuitCode; } } 456 public uint CircuitCode { get { return m_circuitCode; } }
457
458 protected int m_animationSequenceNumber = (int)(Util.GetTimeStampTicks() & 0x5fffafL);
457 public int NextAnimationSequenceNumber 459 public int NextAnimationSequenceNumber
458 { 460 {
459 get { return m_udpServer.NextAnimationSequenceNumber; } 461 get
462 {
463 int ret = Interlocked.Increment(ref m_animationSequenceNumber);
464 if (ret <= 0)
465 {
466 m_animationSequenceNumber = (int)(Util.GetTimeStampTicks() & 0xafff5fL);
467 ret = Interlocked.Increment(ref m_animationSequenceNumber);
468 }
469 return ret;
470 }
471 set
472 {
473 m_animationSequenceNumber = value;
474 }
460 } 475 }
461 476
462 /// <summary> 477 /// <summary>
@@ -3904,6 +3919,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP
3904 OutPacket(ani, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); 3919 OutPacket(ani, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority);
3905 } 3920 }
3906 3921
3922 public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId)
3923 {
3924 // m_log.DebugFormat("[LLCLIENTVIEW]: Sending Object animations for {0} to {1}", sourceAgentId, Name);
3925
3926 ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation);
3927 // TODO: don't create new blocks if recycling an old packet
3928 ani.Sender = new ObjectAnimationPacket.SenderBlock();
3929 ani.Sender.ID = senderId;
3930 ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[animations.Length];
3931
3932 for (int i = 0; i < animations.Length; ++i)
3933 {
3934 ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock();
3935 ani.AnimationList[i].AnimID = animations[i];
3936 ani.AnimationList[i].AnimSequenceID = seqs[i];
3937 }
3938 OutPacket(ani, ThrottleOutPacketType.Task);
3939 }
3940
3907 #endregion 3941 #endregion
3908 3942
3909 #region Avatar Packet/Data Sending Methods 3943 #region Avatar Packet/Data Sending Methods
@@ -4127,6 +4161,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4127 OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); 4161 OpenSim.Framework.Lazy<List<EntityUpdate>> compressedUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4128 OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); 4162 OpenSim.Framework.Lazy<List<EntityUpdate>> terseUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4129 OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>(); 4163 OpenSim.Framework.Lazy<List<EntityUpdate>> terseAgentUpdates = new OpenSim.Framework.Lazy<List<EntityUpdate>>();
4164 OpenSim.Framework.Lazy<List<SceneObjectPart>> ObjectAnimationUpdates = new OpenSim.Framework.Lazy<List<SceneObjectPart>>();
4130 4165
4131 // Check to see if this is a flush 4166 // Check to see if this is a flush
4132 if (maxUpdatesBytes <= 0) 4167 if (maxUpdatesBytes <= 0)
@@ -4297,12 +4332,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4297 bool canUseCompressed = true; 4332 bool canUseCompressed = true;
4298 bool canUseImproved = true; 4333 bool canUseImproved = true;
4299 4334
4300
4301 // Compressed object updates only make sense for LL primitives 4335 // Compressed object updates only make sense for LL primitives
4302 if (!(update.Entity is SceneObjectPart)) 4336 if (!(update.Entity is SceneObjectPart))
4303 { 4337 {
4304 canUseCompressed = false; 4338 canUseCompressed = false;
4305 } 4339 }
4340 else
4341 {
4342 if(updateFlags.HasFlag(PrimUpdateFlags.Animations))
4343 {
4344 updateFlags &= ~PrimUpdateFlags.Animations;
4345 SceneObjectPart sop = (SceneObjectPart)update.Entity;
4346 if(sop.Animations != null)
4347 {
4348 ObjectAnimationUpdates.Value.Add(sop);
4349 maxUpdatesBytes -= 32 * sop.Animations.Count + 16;
4350 }
4351 }
4352 }
4306 4353
4307 if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) 4354 if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate))
4308 { 4355 {
@@ -4443,6 +4490,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4443 OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); 4490 OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); });
4444 } 4491 }
4445 4492
4493 foreach (SceneObjectPart sop in ObjectAnimationUpdates.Value)
4494 {
4495 if (sop.Animations == null)
4496 continue;
4497 SceneObjectGroup sog = sop.ParentGroup;
4498 if (sog == null || sog.IsDeleted)
4499 continue;
4500
4501 SceneObjectPart root = sog.RootPart;
4502 if (root == null || root.Shape == null || !root.Shape.MeshFlagEntry)
4503 continue;
4504
4505 UUID[] ids = null;
4506 int[] seqs = null;
4507 int count = sop.GetAnimations(out ids, out seqs);
4508 if(count < 0)
4509 continue;
4510
4511 ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation);
4512 ani.Sender = new ObjectAnimationPacket.SenderBlock();
4513 ani.Sender.ID = sop.UUID;
4514 ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[sop.Animations.Count];
4515
4516 for(int i = 0; i< count; i++)
4517 {
4518 ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock();
4519 ani.AnimationList[i].AnimID = ids[i];
4520 ani.AnimationList[i].AnimSequenceID = seqs[i];
4521 }
4522 OutPacket(ani, ThrottleOutPacketType.Task);
4523 }
4524
4446 #endregion Packet Sending 4525 #endregion Packet Sending
4447 4526
4448 #region Handle deleted objects 4527 #region Handle deleted objects
@@ -4462,6 +4541,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP
4462 GroupsInView.Add(grp); 4541 GroupsInView.Add(grp);
4463 } 4542 }
4464 } 4543 }
4544
4465 #endregion 4545 #endregion
4466 } 4546 }
4467 4547