From 4a73cc81dc4e03b2b7c46829cecfc0627c3fddb4 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Fri, 28 Dec 2018 13:52:59 +0000 Subject: now break several things at same time... sog/sop updates, threads options,... --- .../Linden/Caps/ServerReleaseNotesModule.cs | 2 - .../Linden/Caps/SimulatorFeaturesModule.cs | 5 ++ .../Region/ClientStack/Linden/UDP/LLClientView.cs | 84 +++++++++++++++++++++- .../Region/ClientStack/Linden/UDP/LLUDPServer.cs | 14 ---- 4 files changed, 87 insertions(+), 18 deletions(-) (limited to 'OpenSim/Region/ClientStack') diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ServerReleaseNotesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ServerReleaseNotesModule.cs index e172db7..cf79982 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/ServerReleaseNotesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/ServerReleaseNotesModule.cs @@ -126,8 +126,6 @@ namespace OpenSim.Region.ClientStack.LindenCaps Hashtable responsedata = new Hashtable(); responsedata["int_response_code"] = 301; responsedata["str_redirect_location"] = m_ServerReleaseNotesURL; - responsedata["content_type"] = "text/plain"; - return responsedata; } } diff --git a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs index b06e93c..b52f2fd 100644 --- a/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs +++ b/OpenSim/Region/ClientStack/Linden/Caps/SimulatorFeaturesModule.cs @@ -172,6 +172,11 @@ namespace OpenSim.Region.ClientStack.Linden if(m_doScriptSyntax && m_scriptSyntaxID != UUID.Zero) m_features["LSLSyntaxId"] = OSD.FromUUID(m_scriptSyntaxID); + OSDMap meshAnim = new OSDMap(); + meshAnim["AnimatedObjectMaxTris"] = OSD.FromInteger(10000); + meshAnim["MaxAgentAnimatedObjectAttachments"] = OSD.FromInteger(2); + m_features["AnimatedObjects"] = meshAnim; + // Extra information for viewers that want to use it // TODO: Take these out of here into their respective modules, like map-server-url OSDMap extrasMap; 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 public string Name { get { return FirstName + " " + LastName; } } public uint CircuitCode { get { return m_circuitCode; } } + + protected int m_animationSequenceNumber = (int)(Util.GetTimeStampTicks() & 0x5fffafL); public int NextAnimationSequenceNumber { - get { return m_udpServer.NextAnimationSequenceNumber; } + get + { + int ret = Interlocked.Increment(ref m_animationSequenceNumber); + if (ret <= 0) + { + m_animationSequenceNumber = (int)(Util.GetTimeStampTicks() & 0xafff5fL); + ret = Interlocked.Increment(ref m_animationSequenceNumber); + } + return ret; + } + set + { + m_animationSequenceNumber = value; + } } /// @@ -3904,6 +3919,25 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(ani, ThrottleOutPacketType.Task | ThrottleOutPacketType.HighPriority); } + public void SendObjectAnimations(UUID[] animations, int[] seqs, UUID senderId) + { + // m_log.DebugFormat("[LLCLIENTVIEW]: Sending Object animations for {0} to {1}", sourceAgentId, Name); + + ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation); + // TODO: don't create new blocks if recycling an old packet + ani.Sender = new ObjectAnimationPacket.SenderBlock(); + ani.Sender.ID = senderId; + ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[animations.Length]; + + for (int i = 0; i < animations.Length; ++i) + { + ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock(); + ani.AnimationList[i].AnimID = animations[i]; + ani.AnimationList[i].AnimSequenceID = seqs[i]; + } + OutPacket(ani, ThrottleOutPacketType.Task); + } + #endregion #region Avatar Packet/Data Sending Methods @@ -4127,6 +4161,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP OpenSim.Framework.Lazy> compressedUpdates = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> terseUpdates = new OpenSim.Framework.Lazy>(); OpenSim.Framework.Lazy> terseAgentUpdates = new OpenSim.Framework.Lazy>(); + OpenSim.Framework.Lazy> ObjectAnimationUpdates = new OpenSim.Framework.Lazy>(); // Check to see if this is a flush if (maxUpdatesBytes <= 0) @@ -4297,12 +4332,24 @@ namespace OpenSim.Region.ClientStack.LindenUDP bool canUseCompressed = true; bool canUseImproved = true; - // Compressed object updates only make sense for LL primitives if (!(update.Entity is SceneObjectPart)) { canUseCompressed = false; } + else + { + if(updateFlags.HasFlag(PrimUpdateFlags.Animations)) + { + updateFlags &= ~PrimUpdateFlags.Animations; + SceneObjectPart sop = (SceneObjectPart)update.Entity; + if(sop.Animations != null) + { + ObjectAnimationUpdates.Value.Add(sop); + maxUpdatesBytes -= 32 * sop.Animations.Count + 16; + } + } + } if (updateFlags.HasFlag(PrimUpdateFlags.FullUpdate)) { @@ -4443,6 +4490,38 @@ namespace OpenSim.Region.ClientStack.LindenUDP OutPacket(packet, ThrottleOutPacketType.Task, true, delegate(OutgoingPacket oPacket) { ResendPrimUpdates(terseUpdates.Value, oPacket); }); } + foreach (SceneObjectPart sop in ObjectAnimationUpdates.Value) + { + if (sop.Animations == null) + continue; + SceneObjectGroup sog = sop.ParentGroup; + if (sog == null || sog.IsDeleted) + continue; + + SceneObjectPart root = sog.RootPart; + if (root == null || root.Shape == null || !root.Shape.MeshFlagEntry) + continue; + + UUID[] ids = null; + int[] seqs = null; + int count = sop.GetAnimations(out ids, out seqs); + if(count < 0) + continue; + + ObjectAnimationPacket ani = (ObjectAnimationPacket)PacketPool.Instance.GetPacket(PacketType.ObjectAnimation); + ani.Sender = new ObjectAnimationPacket.SenderBlock(); + ani.Sender.ID = sop.UUID; + ani.AnimationList = new ObjectAnimationPacket.AnimationListBlock[sop.Animations.Count]; + + for(int i = 0; i< count; i++) + { + ani.AnimationList[i] = new ObjectAnimationPacket.AnimationListBlock(); + ani.AnimationList[i].AnimID = ids[i]; + ani.AnimationList[i].AnimSequenceID = seqs[i]; + } + OutPacket(ani, ThrottleOutPacketType.Task); + } + #endregion Packet Sending #region Handle deleted objects @@ -4462,6 +4541,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP GroupsInView.Add(grp); } } + #endregion } diff --git a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs index 567bbb5..70cca51 100644 --- a/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs +++ b/OpenSim/Region/ClientStack/Linden/UDP/LLUDPServer.cs @@ -341,19 +341,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP /// Flag to signal when clients should send pings protected bool m_sendPing; - protected int m_animationSequenceNumber; - - public int NextAnimationSequenceNumber - { - get - { - m_animationSequenceNumber++; - if (m_animationSequenceNumber > 2147482624) - m_animationSequenceNumber = 1; - return m_animationSequenceNumber; - } - } - protected ExpiringCache> m_pendingCache = new ExpiringCache>(); protected Pool m_incomingPacketPool; @@ -507,7 +494,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP ThrottleRates = new ThrottleRates(configSource); Random rnd = new Random(Util.EnvironmentTickCount()); - m_animationSequenceNumber = rnd.Next(11474826); // if (usePools) // EnablePools(); -- cgit v1.1