From 5c5e4bd8304dbb607a4008ec41ecacf716cfd0db Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 27 Nov 2019 16:44:45 +0000 Subject: a few changes on check targets for lsl --- OpenSim/Region/Framework/Scenes/Scene.cs | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index a0a2882..0c5007a 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -410,7 +410,7 @@ namespace OpenSim.Region.Framework.Scenes private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing private volatile bool m_backingup; private Dictionary m_returns = new Dictionary(); - private Dictionary m_groupsWithTargets = new Dictionary(); + private HashSet m_groupsWithTargets = new HashSet(); private string m_defaultScriptEngine; @@ -837,7 +837,8 @@ namespace OpenSim.Region.Framework.Scenes Random random = new Random(); - m_lastAllocatedLocalId = (uint)(random.NextDouble() * (double)(uint.MaxValue / 2)) + (uint)(uint.MaxValue / 4); + m_lastAllocatedLocalId = (int)(random.NextDouble() * (uint.MaxValue / 4)); + m_lastAllocatedIntId = (int)(random.NextDouble() * (int.MaxValue / 4)); m_authenticateHandler = authen; m_sceneGridService = new SceneCommunicationService(); m_SimulationDataService = simDataService; @@ -1633,7 +1634,7 @@ namespace OpenSim.Region.Framework.Scenes // m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName); - agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0f; + otherMS = agentMS = tempOnRezMS = eventMS = backupMS = terrainMS = landMS = 0f; try { @@ -1713,6 +1714,10 @@ namespace OpenSim.Region.Framework.Scenes if (Frame % m_update_objects == 0) m_sceneGraph.UpdateObjectGroups(); + tmpMS2 = Util.GetTimeStampMS(); + otherMS = (float)(tmpMS2 - tmpMS); + tmpMS = tmpMS2; + // Run through all ScenePresences looking for updates // Presence updates and queued object updates for each presence are sent to clients if (Frame % m_update_presences == 0) @@ -1828,7 +1833,7 @@ namespace OpenSim.Region.Framework.Scenes m_firstHeartbeat = false; Watchdog.UpdateThread(); - otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS; + otherMS += tempOnRezMS + eventMS + backupMS + terrainMS + landMS; tmpMS = Util.GetTimeStampMS(); @@ -1912,7 +1917,7 @@ namespace OpenSim.Region.Framework.Scenes public void AddGroupTarget(SceneObjectGroup grp) { lock (m_groupsWithTargets) - m_groupsWithTargets[grp.UUID] = 0; + m_groupsWithTargets.Add(grp.UUID); } public void RemoveGroupTarget(SceneObjectGroup grp) @@ -1928,13 +1933,14 @@ namespace OpenSim.Region.Framework.Scenes lock (m_groupsWithTargets) { if (m_groupsWithTargets.Count != 0) - objs = new List(m_groupsWithTargets.Keys); + objs = new List(m_groupsWithTargets); } if (objs != null) { - foreach (UUID entry in objs) + for(int i = 0; i< objs.Count; ++i) { + UUID entry = objs[i]; SceneObjectGroup grp = GetSceneObjectGroup(entry); if (grp == null) m_groupsWithTargets.Remove(entry); -- cgit v1.1