diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 22 |
2 files changed, 32 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 23006f2..e3bc8c7 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -282,7 +282,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
282 | private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing | 282 | private readonly Timer m_restartTimer = new Timer(15000); // Wait before firing |
283 | private volatile bool m_backingup; | 283 | private volatile bool m_backingup; |
284 | private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>(); | 284 | private Dictionary<UUID, ReturnInfo> m_returns = new Dictionary<UUID, ReturnInfo>(); |
285 | private Dictionary<UUID, SceneObjectGroup> m_groupsWithTargets = new Dictionary<UUID, SceneObjectGroup>(); | 285 | private Dictionary<UUID, int> m_groupsWithTargets = new Dictionary<UUID, int>(); |
286 | 286 | ||
287 | private bool m_physics_enabled = true; | 287 | private bool m_physics_enabled = true; |
288 | private bool m_scripts_enabled = true; | 288 | private bool m_scripts_enabled = true; |
@@ -1736,7 +1736,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1736 | public void AddGroupTarget(SceneObjectGroup grp) | 1736 | public void AddGroupTarget(SceneObjectGroup grp) |
1737 | { | 1737 | { |
1738 | lock (m_groupsWithTargets) | 1738 | lock (m_groupsWithTargets) |
1739 | m_groupsWithTargets[grp.UUID] = grp; | 1739 | m_groupsWithTargets[grp.UUID] = 0; |
1740 | } | 1740 | } |
1741 | 1741 | ||
1742 | public void RemoveGroupTarget(SceneObjectGroup grp) | 1742 | public void RemoveGroupTarget(SceneObjectGroup grp) |
@@ -1747,18 +1747,24 @@ namespace OpenSim.Region.Framework.Scenes | |||
1747 | 1747 | ||
1748 | private void CheckAtTargets() | 1748 | private void CheckAtTargets() |
1749 | { | 1749 | { |
1750 | List<SceneObjectGroup> objs = null; | 1750 | List<UUID> objs = null; |
1751 | 1751 | ||
1752 | lock (m_groupsWithTargets) | 1752 | lock (m_groupsWithTargets) |
1753 | { | 1753 | { |
1754 | if (m_groupsWithTargets.Count != 0) | 1754 | if (m_groupsWithTargets.Count != 0) |
1755 | objs = new List<SceneObjectGroup>(m_groupsWithTargets.Values); | 1755 | objs = new List<UUID>(m_groupsWithTargets.Keys); |
1756 | } | 1756 | } |
1757 | 1757 | ||
1758 | if (objs != null) | 1758 | if (objs != null) |
1759 | { | 1759 | { |
1760 | foreach (SceneObjectGroup entry in objs) | 1760 | foreach (UUID entry in objs) |
1761 | entry.checkAtTargets(); | 1761 | { |
1762 | SceneObjectGroup grp = GetSceneObjectGroup(entry); | ||
1763 | if (grp == null) | ||
1764 | m_groupsWithTargets.Remove(entry); | ||
1765 | else | ||
1766 | grp.checkAtTargets(); | ||
1767 | } | ||
1762 | } | 1768 | } |
1763 | } | 1769 | } |
1764 | 1770 | ||
@@ -2059,11 +2065,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
2059 | EventManager.TriggerPrimsLoaded(this); | 2065 | EventManager.TriggerPrimsLoaded(this); |
2060 | } | 2066 | } |
2061 | 2067 | ||
2062 | public bool SuportsRayCastFiltered() | 2068 | public bool SupportsRayCastFiltered() |
2063 | { | 2069 | { |
2064 | if (PhysicsScene == null) | 2070 | if (PhysicsScene == null) |
2065 | return false; | 2071 | return false; |
2066 | return PhysicsScene.SuportsRaycastWorldFiltered(); | 2072 | return PhysicsScene.SupportsRaycastWorldFiltered(); |
2067 | } | 2073 | } |
2068 | 2074 | ||
2069 | public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) | 2075 | public object RayCastFiltered(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index b474979..ed1bbd8 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -79,14 +79,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
79 | object_rez = 4194304 | 79 | object_rez = 4194304 |
80 | } | 80 | } |
81 | 81 | ||
82 | struct scriptPosTarget | 82 | public struct scriptPosTarget |
83 | { | 83 | { |
84 | public Vector3 targetPos; | 84 | public Vector3 targetPos; |
85 | public float tolerance; | 85 | public float tolerance; |
86 | public uint handle; | 86 | public uint handle; |
87 | } | 87 | } |
88 | 88 | ||
89 | struct scriptRotTarget | 89 | public struct scriptRotTarget |
90 | { | 90 | { |
91 | public Quaternion targetRot; | 91 | public Quaternion targetRot; |
92 | public float tolerance; | 92 | public float tolerance; |
@@ -320,8 +320,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
320 | protected SceneObjectPart m_rootPart; | 320 | protected SceneObjectPart m_rootPart; |
321 | // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); | 321 | // private Dictionary<UUID, scriptEvents> m_scriptEvents = new Dictionary<UUID, scriptEvents>(); |
322 | 322 | ||
323 | private Dictionary<uint, scriptPosTarget> m_targets = new Dictionary<uint, scriptPosTarget>(); | 323 | private SortedDictionary<uint, scriptPosTarget> m_targets = new SortedDictionary<uint, scriptPosTarget>(); |
324 | private Dictionary<uint, scriptRotTarget> m_rotTargets = new Dictionary<uint, scriptRotTarget>(); | 324 | private SortedDictionary<uint, scriptRotTarget> m_rotTargets = new SortedDictionary<uint, scriptRotTarget>(); |
325 | |||
326 | public SortedDictionary<uint, scriptPosTarget> AtTargets | ||
327 | { | ||
328 | get { return m_targets; } | ||
329 | } | ||
330 | |||
331 | public SortedDictionary<uint, scriptRotTarget> RotTargets | ||
332 | { | ||
333 | get { return m_rotTargets; } | ||
334 | } | ||
325 | 335 | ||
326 | private bool m_scriptListens_atTarget; | 336 | private bool m_scriptListens_atTarget; |
327 | private bool m_scriptListens_notAtTarget; | 337 | private bool m_scriptListens_notAtTarget; |
@@ -4112,6 +4122,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4112 | waypoint.handle = handle; | 4122 | waypoint.handle = handle; |
4113 | lock (m_rotTargets) | 4123 | lock (m_rotTargets) |
4114 | { | 4124 | { |
4125 | if (m_rotTargets.Count >= 8) | ||
4126 | m_rotTargets.Remove(m_rotTargets.ElementAt(0).Key); | ||
4115 | m_rotTargets.Add(handle, waypoint); | 4127 | m_rotTargets.Add(handle, waypoint); |
4116 | } | 4128 | } |
4117 | m_scene.AddGroupTarget(this); | 4129 | m_scene.AddGroupTarget(this); |
@@ -4137,6 +4149,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
4137 | waypoint.handle = handle; | 4149 | waypoint.handle = handle; |
4138 | lock (m_targets) | 4150 | lock (m_targets) |
4139 | { | 4151 | { |
4152 | if (m_targets.Count >= 8) | ||
4153 | m_targets.Remove(m_targets.ElementAt(0).Key); | ||
4140 | m_targets.Add(handle, waypoint); | 4154 | m_targets.Add(handle, waypoint); |
4141 | } | 4155 | } |
4142 | m_scene.AddGroupTarget(this); | 4156 | m_scene.AddGroupTarget(this); |