diff options
Diffstat (limited to 'OpenSim/Framework')
-rw-r--r-- | OpenSim/Framework/Monitoring/Watchdog.cs | 15 | ||||
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 42 | ||||
-rw-r--r-- | OpenSim/Framework/Util.cs | 6 |
3 files changed, 60 insertions, 3 deletions
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs index 02f11fa..7964f28 100644 --- a/OpenSim/Framework/Monitoring/Watchdog.cs +++ b/OpenSim/Framework/Monitoring/Watchdog.cs | |||
@@ -89,6 +89,17 @@ namespace OpenSim.Framework.Monitoring | |||
89 | FirstTick = Environment.TickCount & Int32.MaxValue; | 89 | FirstTick = Environment.TickCount & Int32.MaxValue; |
90 | LastTick = FirstTick; | 90 | LastTick = FirstTick; |
91 | } | 91 | } |
92 | |||
93 | public ThreadWatchdogInfo(ThreadWatchdogInfo previousTwi) | ||
94 | { | ||
95 | Thread = previousTwi.Thread; | ||
96 | FirstTick = previousTwi.FirstTick; | ||
97 | LastTick = previousTwi.LastTick; | ||
98 | Timeout = previousTwi.Timeout; | ||
99 | IsTimedOut = previousTwi.IsTimedOut; | ||
100 | AlarmIfTimeout = previousTwi.AlarmIfTimeout; | ||
101 | AlarmMethod = previousTwi.AlarmMethod; | ||
102 | } | ||
92 | } | 103 | } |
93 | 104 | ||
94 | /// <summary> | 105 | /// <summary> |
@@ -335,7 +346,9 @@ namespace OpenSim.Framework.Monitoring | |||
335 | if (callbackInfos == null) | 346 | if (callbackInfos == null) |
336 | callbackInfos = new List<ThreadWatchdogInfo>(); | 347 | callbackInfos = new List<ThreadWatchdogInfo>(); |
337 | 348 | ||
338 | callbackInfos.Add(threadInfo); | 349 | // Send a copy of the watchdog info to prevent race conditions where the watchdog |
350 | // thread updates the monitoring info after an alarm has been sent out. | ||
351 | callbackInfos.Add(new ThreadWatchdogInfo(threadInfo)); | ||
339 | } | 352 | } |
340 | } | 353 | } |
341 | } | 354 | } |
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 2080a16..8131089 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -120,7 +120,9 @@ namespace OpenSim.Framework | |||
120 | public UUID lastMapUUID = UUID.Zero; | 120 | public UUID lastMapUUID = UUID.Zero; |
121 | public string lastMapRefresh = "0"; | 121 | public string lastMapRefresh = "0"; |
122 | 122 | ||
123 | private float m_nonphysPrimMin = 0; | ||
123 | private int m_nonphysPrimMax = 0; | 124 | private int m_nonphysPrimMax = 0; |
125 | private float m_physPrimMin = 0; | ||
124 | private int m_physPrimMax = 0; | 126 | private int m_physPrimMax = 0; |
125 | private bool m_clampPrimSize = false; | 127 | private bool m_clampPrimSize = false; |
126 | private int m_objectCapacity = 0; | 128 | private int m_objectCapacity = 0; |
@@ -285,11 +287,21 @@ namespace OpenSim.Framework | |||
285 | set { m_windlight = value; } | 287 | set { m_windlight = value; } |
286 | } | 288 | } |
287 | 289 | ||
290 | public float NonphysPrimMin | ||
291 | { | ||
292 | get { return m_nonphysPrimMin; } | ||
293 | } | ||
294 | |||
288 | public int NonphysPrimMax | 295 | public int NonphysPrimMax |
289 | { | 296 | { |
290 | get { return m_nonphysPrimMax; } | 297 | get { return m_nonphysPrimMax; } |
291 | } | 298 | } |
292 | 299 | ||
300 | public float PhysPrimMin | ||
301 | { | ||
302 | get { return m_physPrimMin; } | ||
303 | } | ||
304 | |||
293 | public int PhysPrimMax | 305 | public int PhysPrimMax |
294 | { | 306 | { |
295 | get { return m_physPrimMax; } | 307 | get { return m_physPrimMax; } |
@@ -623,16 +635,28 @@ namespace OpenSim.Framework | |||
623 | m_regionType = config.GetString("RegionType", String.Empty); | 635 | m_regionType = config.GetString("RegionType", String.Empty); |
624 | allKeys.Remove("RegionType"); | 636 | allKeys.Remove("RegionType"); |
625 | 637 | ||
626 | // Prim stuff | 638 | #region Prim stuff |
627 | // | 639 | |
640 | m_nonphysPrimMin = config.GetFloat("NonphysicalPrimMin", 0); | ||
641 | allKeys.Remove("NonphysicalPrimMin"); | ||
642 | |||
628 | m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0); | 643 | m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0); |
629 | allKeys.Remove("NonphysicalPrimMax"); | 644 | allKeys.Remove("NonphysicalPrimMax"); |
645 | |||
646 | m_physPrimMin = config.GetFloat("PhysicalPrimMin", 0); | ||
647 | allKeys.Remove("PhysicalPrimMin"); | ||
648 | |||
630 | m_physPrimMax = config.GetInt("PhysicalPrimMax", 0); | 649 | m_physPrimMax = config.GetInt("PhysicalPrimMax", 0); |
631 | allKeys.Remove("PhysicalPrimMax"); | 650 | allKeys.Remove("PhysicalPrimMax"); |
651 | |||
632 | m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); | 652 | m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); |
633 | allKeys.Remove("ClampPrimSize"); | 653 | allKeys.Remove("ClampPrimSize"); |
654 | |||
634 | m_objectCapacity = config.GetInt("MaxPrims", 15000); | 655 | m_objectCapacity = config.GetInt("MaxPrims", 15000); |
635 | allKeys.Remove("MaxPrims"); | 656 | allKeys.Remove("MaxPrims"); |
657 | |||
658 | #endregion | ||
659 | |||
636 | m_agentCapacity = config.GetInt("MaxAgents", 100); | 660 | m_agentCapacity = config.GetInt("MaxAgents", 100); |
637 | allKeys.Remove("MaxAgents"); | 661 | allKeys.Remove("MaxAgents"); |
638 | 662 | ||
@@ -668,10 +692,18 @@ namespace OpenSim.Framework | |||
668 | 692 | ||
669 | config.Set("ExternalHostName", m_externalHostName); | 693 | config.Set("ExternalHostName", m_externalHostName); |
670 | 694 | ||
695 | if (m_nonphysPrimMin != 0) | ||
696 | config.Set("NonphysicalPrimMax", m_nonphysPrimMin); | ||
697 | |||
671 | if (m_nonphysPrimMax != 0) | 698 | if (m_nonphysPrimMax != 0) |
672 | config.Set("NonphysicalPrimMax", m_nonphysPrimMax); | 699 | config.Set("NonphysicalPrimMax", m_nonphysPrimMax); |
700 | |||
701 | if (m_physPrimMin != 0) | ||
702 | config.Set("PhysicalPrimMax", m_physPrimMin); | ||
703 | |||
673 | if (m_physPrimMax != 0) | 704 | if (m_physPrimMax != 0) |
674 | config.Set("PhysicalPrimMax", m_physPrimMax); | 705 | config.Set("PhysicalPrimMax", m_physPrimMax); |
706 | |||
675 | config.Set("ClampPrimSize", m_clampPrimSize.ToString()); | 707 | config.Set("ClampPrimSize", m_clampPrimSize.ToString()); |
676 | 708 | ||
677 | if (m_objectCapacity != 0) | 709 | if (m_objectCapacity != 0) |
@@ -754,9 +786,15 @@ namespace OpenSim.Framework | |||
754 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, | 786 | configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, |
755 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); | 787 | "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); |
756 | 788 | ||
789 | configMember.addConfigurationOption("nonphysical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, | ||
790 | "Minimum size for nonphysical prims", m_nonphysPrimMin.ToString(), true); | ||
791 | |||
757 | configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | 792 | configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, |
758 | "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); | 793 | "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); |
759 | 794 | ||
795 | configMember.addConfigurationOption("physical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT, | ||
796 | "Minimum size for nonphysical prims", m_physPrimMin.ToString(), true); | ||
797 | |||
760 | configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, | 798 | configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, |
761 | "Maximum size for physical prims", m_physPrimMax.ToString(), true); | 799 | "Maximum size for physical prims", m_physPrimMax.ToString(), true); |
762 | 800 | ||
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 8cc29ee..38cb3a6 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -850,6 +850,12 @@ namespace OpenSim.Framework | |||
850 | return Math.Min(Math.Max(x, min), max); | 850 | return Math.Min(Math.Max(x, min), max); |
851 | } | 851 | } |
852 | 852 | ||
853 | public static Vector3 Clip(Vector3 vec, float min, float max) | ||
854 | { | ||
855 | return new Vector3(Clip(vec.X, min, max), Clip(vec.Y, min, max), | ||
856 | Clip(vec.Z, min, max)); | ||
857 | } | ||
858 | |||
853 | /// <summary> | 859 | /// <summary> |
854 | /// Convert an UUID to a raw uuid string. Right now this is a string without hyphens. | 860 | /// Convert an UUID to a raw uuid string. Right now this is a string without hyphens. |
855 | /// </summary> | 861 | /// </summary> |