diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Prioritizer.cs | 20 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneBase.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 51 |
3 files changed, 54 insertions, 29 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Prioritizer.cs b/OpenSim/Region/Framework/Scenes/Prioritizer.cs index 19d2689..c0405ad 100644 --- a/OpenSim/Region/Framework/Scenes/Prioritizer.cs +++ b/OpenSim/Region/Framework/Scenes/Prioritizer.cs | |||
@@ -175,7 +175,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
175 | { | 175 | { |
176 | // Attachments are high priority, | 176 | // Attachments are high priority, |
177 | if (((SceneObjectPart)entity).ParentGroup.IsAttachment) | 177 | if (((SceneObjectPart)entity).ParentGroup.IsAttachment) |
178 | return 1; | 178 | return 2; |
179 | 179 | ||
180 | pqueue = ComputeDistancePriority(client, entity, false); | 180 | pqueue = ComputeDistancePriority(client, entity, false); |
181 | 181 | ||
@@ -233,16 +233,28 @@ namespace OpenSim.Region.Framework.Scenes | |||
233 | 233 | ||
234 | // And convert the distance to a priority queue, this computation gives queues | 234 | // And convert the distance to a priority queue, this computation gives queues |
235 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m | 235 | // at 10, 20, 40, 80, 160, 320, 640, and 1280m |
236 | uint pqueue = PriorityQueue.NumberOfImmediateQueues; | 236 | uint pqueue = PriorityQueue.NumberOfImmediateQueues + 1; // reserve attachments queue |
237 | uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; | 237 | uint queues = PriorityQueue.NumberOfQueues - PriorityQueue.NumberOfImmediateQueues; |
238 | 238 | /* | |
239 | for (int i = 0; i < queues - 1; i++) | 239 | for (int i = 0; i < queues - 1; i++) |
240 | { | 240 | { |
241 | if (distance < 30 * Math.Pow(2.0,i)) | 241 | if (distance < 30 * Math.Pow(2.0,i)) |
242 | break; | 242 | break; |
243 | pqueue++; | 243 | pqueue++; |
244 | } | 244 | } |
245 | 245 | */ | |
246 | if (distance > 10f) | ||
247 | { | ||
248 | float tmp = (float)Math.Log((double)distance) * 1.4426950408889634073599246810019f - 3.3219280948873623478703194294894f; | ||
249 | // for a map identical to original: | ||
250 | // now | ||
251 | // 1st constant is 1/(log(2)) (natural log) so we get log2(distance) | ||
252 | // 2st constant makes it be log2(distance/10) | ||
253 | pqueue += (uint)tmp; | ||
254 | if (pqueue > queues - 1) | ||
255 | pqueue = queues - 1; | ||
256 | } | ||
257 | |||
246 | // If this is a root agent, then determine front & back | 258 | // If this is a root agent, then determine front & back |
247 | // Bump up the priority queue (drop the priority) for any objects behind the avatar | 259 | // Bump up the priority queue (drop the priority) for any objects behind the avatar |
248 | if (useFrontBack && ! presence.IsChildAgent) | 260 | if (useFrontBack && ! presence.IsChildAgent) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs index dd0c828..f5be7a7 100644 --- a/OpenSim/Region/Framework/Scenes/SceneBase.cs +++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs | |||
@@ -295,6 +295,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
295 | 295 | ||
296 | return myID; | 296 | return myID; |
297 | } | 297 | } |
298 | |||
299 | public uint AllocatePresenceLocalId() | ||
300 | { | ||
301 | uint myID; | ||
302 | |||
303 | _primAllocateMutex.WaitOne(); | ||
304 | myID = ++m_lastAllocatedLocalId; | ||
305 | ++m_lastAllocatedLocalId; | ||
306 | _primAllocateMutex.ReleaseMutex(); | ||
307 | |||
308 | return myID; | ||
309 | } | ||
298 | 310 | ||
299 | #region Module Methods | 311 | #region Module Methods |
300 | 312 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index a0c3ba9..73283ed 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -969,7 +969,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
969 | m_name = String.Format("{0} {1}", Firstname, Lastname); | 969 | m_name = String.Format("{0} {1}", Firstname, Lastname); |
970 | m_scene = world; | 970 | m_scene = world; |
971 | m_uuid = client.AgentId; | 971 | m_uuid = client.AgentId; |
972 | LocalId = m_scene.AllocateLocalId(); | 972 | LocalId = m_scene.AllocatePresenceLocalId(); |
973 | 973 | ||
974 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); | 974 | UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid); |
975 | if (account != null) | 975 | if (account != null) |
@@ -1878,7 +1878,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1878 | if (!IsChildAgent) | 1878 | if (!IsChildAgent) |
1879 | { | 1879 | { |
1880 | 1880 | ||
1881 | |||
1882 | ValidateAndSendAppearanceAndAgentData(); | 1881 | ValidateAndSendAppearanceAndAgentData(); |
1883 | 1882 | ||
1884 | m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); | 1883 | m_log.DebugFormat("[CompleteMovement] ValidateAndSendAppearanceAndAgentData: {0}ms", Util.EnvironmentTickCountSubtract(ts)); |
@@ -1900,35 +1899,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
1900 | m_log.DebugFormat( | 1899 | m_log.DebugFormat( |
1901 | "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); | 1900 | "[SCENE PRESENCE]: Restarting scripts in attachments for {0} in {1}", Name, Scene.Name); |
1902 | 1901 | ||
1903 | List<uint> kk = new List<uint>(); | ||
1904 | |||
1905 | // Resume scripts this possible should also be moved down after sending the avatar to viewer ? | 1902 | // Resume scripts this possible should also be moved down after sending the avatar to viewer ? |
1906 | foreach (SceneObjectGroup sog in m_attachments) | 1903 | foreach (SceneObjectGroup sog in m_attachments) |
1907 | { | 1904 | { |
1908 | foreach (SceneObjectPart part in sog.Parts) | ||
1909 | kk.Add(part.LocalId); | ||
1910 | |||
1911 | sog.SendFullUpdateToClient(ControllingClient); | 1905 | sog.SendFullUpdateToClient(ControllingClient); |
1912 | SendFullUpdateToClient(ControllingClient); | 1906 | SendFullUpdateToClient(ControllingClient); |
1913 | 1907 | ||
1914 | // sog.ScheduleGroupForFullUpdate(); | 1908 | if (!sog.HasPrivateAttachmentPoint) |
1915 | m_scene.ForEachScenePresence(delegate(ScenePresence p) | ||
1916 | { | 1909 | { |
1917 | if (p == this) | 1910 | // sog.ScheduleGroupForFullUpdate(); |
1918 | return; | 1911 | m_scene.ForEachScenePresence(delegate(ScenePresence p) |
1919 | if (sog.HasPrivateAttachmentPoint) | 1912 | { |
1920 | return; | 1913 | if (p == this) |
1921 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) | 1914 | return; |
1922 | return; | 1915 | |
1923 | 1916 | if (ParcelHideThisAvatar && currentParcelUUID != p.currentParcelUUID && p.GodLevel < 200) | |
1924 | p.ControllingClient.SendKillObject(kk); | 1917 | return; |
1925 | sog.SendFullUpdateToClient(p.ControllingClient); | 1918 | |
1926 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path | 1919 | p.ControllingClient.SendPartFullUpdate(sog.RootPart,LocalId + 1); |
1927 | }); | 1920 | sog.SendFullUpdateToClient(p.ControllingClient); |
1928 | 1921 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path | |
1922 | }); | ||
1923 | } | ||
1924 | |||
1929 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); | 1925 | sog.RootPart.ParentGroup.CreateScriptInstances(0, false, m_scene.DefaultScriptEngine, GetStateSource()); |
1930 | sog.ResumeScripts(); | 1926 | sog.ResumeScripts(); |
1931 | kk.Clear(); | ||
1932 | } | 1927 | } |
1933 | } | 1928 | } |
1934 | } | 1929 | } |
@@ -4752,12 +4747,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
4752 | foreach (SceneObjectGroup sog in m_attachments) | 4747 | foreach (SceneObjectGroup sog in m_attachments) |
4753 | { | 4748 | { |
4754 | if (p == this || !sog.HasPrivateAttachmentPoint) | 4749 | if (p == this || !sog.HasPrivateAttachmentPoint) |
4750 | { | ||
4751 | p.ControllingClient.SendPartFullUpdate(sog.RootPart, LocalId + 1); | ||
4755 | sog.SendFullUpdateToClient(p.ControllingClient); | 4752 | sog.SendFullUpdateToClient(p.ControllingClient); |
4753 | } | ||
4756 | } | 4754 | } |
4757 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path | 4755 | SendFullUpdateToClient(p.ControllingClient); // resend our data by updates path |
4758 | } | 4756 | } |
4759 | } | 4757 | } |
4760 | 4758 | ||
4759 | // send attachments to a client without filters except for huds | ||
4760 | // for now they are checked in several places down the line... | ||
4761 | // kills all parts before sending | ||
4761 | public void SendAttachmentsToAgentNFPK(ScenePresence p) | 4762 | public void SendAttachmentsToAgentNFPK(ScenePresence p) |
4762 | { | 4763 | { |
4763 | lock (m_attachments) | 4764 | lock (m_attachments) |
@@ -5680,7 +5681,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5680 | p.SendAppearanceToAgent(this); | 5681 | p.SendAppearanceToAgent(this); |
5681 | if (p.Animator != null) | 5682 | if (p.Animator != null) |
5682 | p.Animator.SendAnimPackToClient(ControllingClient); | 5683 | p.Animator.SendAnimPackToClient(ControllingClient); |
5683 | p.SendAttachmentsToAgentNFPK(this); | 5684 | p.SendAttachmentsToAgentNF(this); |
5684 | } | 5685 | } |
5685 | } | 5686 | } |
5686 | } | 5687 | } |
@@ -5995,7 +5996,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
5995 | SendAppearanceToAgent(p); | 5996 | SendAppearanceToAgent(p); |
5996 | if (Animator != null) | 5997 | if (Animator != null) |
5997 | Animator.SendAnimPackToClient(p.ControllingClient); | 5998 | Animator.SendAnimPackToClient(p.ControllingClient); |
5998 | SendAttachmentsToAgentNFPK(p); | 5999 | SendAttachmentsToAgentNF(p); |
5999 | } | 6000 | } |
6000 | } | 6001 | } |
6001 | 6002 | ||
@@ -6011,7 +6012,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
6011 | p.SendAppearanceToAgent(this); | 6012 | p.SendAppearanceToAgent(this); |
6012 | if (p.Animator != null) | 6013 | if (p.Animator != null) |
6013 | p.Animator.SendAnimPackToClient(ControllingClient); | 6014 | p.Animator.SendAnimPackToClient(ControllingClient); |
6014 | p.SendAttachmentsToAgentNFPK(this); | 6015 | p.SendAttachmentsToAgentNF(this); |
6015 | } | 6016 | } |
6016 | } | 6017 | } |
6017 | } | 6018 | } |