aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs15
-rw-r--r--OpenSim/Framework/RegionInfo.cs42
-rw-r--r--OpenSim/Framework/Util.cs6
3 files changed, 60 insertions, 3 deletions
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index b709baa..eaddb8c 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 4bde7be..fcf1896 100644
--- a/OpenSim/Framework/RegionInfo.cs
+++ b/OpenSim/Framework/RegionInfo.cs
@@ -122,7 +122,9 @@ namespace OpenSim.Framework
122 public UUID lastMapUUID = UUID.Zero; 122 public UUID lastMapUUID = UUID.Zero;
123 public string lastMapRefresh = "0"; 123 public string lastMapRefresh = "0";
124 124
125 private float m_nonphysPrimMin = 0;
125 private int m_nonphysPrimMax = 0; 126 private int m_nonphysPrimMax = 0;
127 private float m_physPrimMin = 0;
126 private int m_physPrimMax = 0; 128 private int m_physPrimMax = 0;
127 private bool m_clampPrimSize = false; 129 private bool m_clampPrimSize = false;
128 private int m_objectCapacity = 0; 130 private int m_objectCapacity = 0;
@@ -287,11 +289,21 @@ namespace OpenSim.Framework
287 set { m_windlight = value; } 289 set { m_windlight = value; }
288 } 290 }
289 291
292 public float NonphysPrimMin
293 {
294 get { return m_nonphysPrimMin; }
295 }
296
290 public int NonphysPrimMax 297 public int NonphysPrimMax
291 { 298 {
292 get { return m_nonphysPrimMax; } 299 get { return m_nonphysPrimMax; }
293 } 300 }
294 301
302 public float PhysPrimMin
303 {
304 get { return m_physPrimMin; }
305 }
306
295 public int PhysPrimMax 307 public int PhysPrimMax
296 { 308 {
297 get { return m_physPrimMax; } 309 get { return m_physPrimMax; }
@@ -625,16 +637,28 @@ namespace OpenSim.Framework
625 m_regionType = config.GetString("RegionType", String.Empty); 637 m_regionType = config.GetString("RegionType", String.Empty);
626 allKeys.Remove("RegionType"); 638 allKeys.Remove("RegionType");
627 639
628 // Prim stuff 640 #region Prim stuff
629 // 641
642 m_nonphysPrimMin = config.GetFloat("NonphysicalPrimMin", 0);
643 allKeys.Remove("NonphysicalPrimMin");
644
630 m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0); 645 m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0);
631 allKeys.Remove("NonphysicalPrimMax"); 646 allKeys.Remove("NonphysicalPrimMax");
647
648 m_physPrimMin = config.GetFloat("PhysicalPrimMin", 0);
649 allKeys.Remove("PhysicalPrimMin");
650
632 m_physPrimMax = config.GetInt("PhysicalPrimMax", 0); 651 m_physPrimMax = config.GetInt("PhysicalPrimMax", 0);
633 allKeys.Remove("PhysicalPrimMax"); 652 allKeys.Remove("PhysicalPrimMax");
653
634 m_clampPrimSize = config.GetBoolean("ClampPrimSize", false); 654 m_clampPrimSize = config.GetBoolean("ClampPrimSize", false);
635 allKeys.Remove("ClampPrimSize"); 655 allKeys.Remove("ClampPrimSize");
656
636 m_objectCapacity = config.GetInt("MaxPrims", 15000); 657 m_objectCapacity = config.GetInt("MaxPrims", 15000);
637 allKeys.Remove("MaxPrims"); 658 allKeys.Remove("MaxPrims");
659
660 #endregion
661
638 m_agentCapacity = config.GetInt("MaxAgents", 100); 662 m_agentCapacity = config.GetInt("MaxAgents", 100);
639 allKeys.Remove("MaxAgents"); 663 allKeys.Remove("MaxAgents");
640 664
@@ -673,10 +697,18 @@ namespace OpenSim.Framework
673 697
674 config.Set("ExternalHostName", m_externalHostName); 698 config.Set("ExternalHostName", m_externalHostName);
675 699
700 if (m_nonphysPrimMin != 0)
701 config.Set("NonphysicalPrimMax", m_nonphysPrimMin);
702
676 if (m_nonphysPrimMax != 0) 703 if (m_nonphysPrimMax != 0)
677 config.Set("NonphysicalPrimMax", m_nonphysPrimMax); 704 config.Set("NonphysicalPrimMax", m_nonphysPrimMax);
705
706 if (m_physPrimMin != 0)
707 config.Set("PhysicalPrimMax", m_physPrimMin);
708
678 if (m_physPrimMax != 0) 709 if (m_physPrimMax != 0)
679 config.Set("PhysicalPrimMax", m_physPrimMax); 710 config.Set("PhysicalPrimMax", m_physPrimMax);
711
680 config.Set("ClampPrimSize", m_clampPrimSize.ToString()); 712 config.Set("ClampPrimSize", m_clampPrimSize.ToString());
681 713
682 if (m_objectCapacity != 0) 714 if (m_objectCapacity != 0)
@@ -759,9 +791,15 @@ namespace OpenSim.Framework
759 configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, 791 configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
760 "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true); 792 "Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
761 793
794 configMember.addConfigurationOption("nonphysical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
795 "Minimum size for nonphysical prims", m_nonphysPrimMin.ToString(), true);
796
762 configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, 797 configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
763 "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true); 798 "Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true);
764 799
800 configMember.addConfigurationOption("physical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
801 "Minimum size for nonphysical prims", m_physPrimMin.ToString(), true);
802
765 configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32, 803 configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
766 "Maximum size for physical prims", m_physPrimMax.ToString(), true); 804 "Maximum size for physical prims", m_physPrimMax.ToString(), true);
767 805
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 384f716..1a383ae 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -862,6 +862,12 @@ namespace OpenSim.Framework
862 return Math.Min(Math.Max(x, min), max); 862 return Math.Min(Math.Max(x, min), max);
863 } 863 }
864 864
865 public static Vector3 Clip(Vector3 vec, float min, float max)
866 {
867 return new Vector3(Clip(vec.X, min, max), Clip(vec.Y, min, max),
868 Clip(vec.Z, min, max));
869 }
870
865 /// <summary> 871 /// <summary>
866 /// Convert an UUID to a raw uuid string. Right now this is a string without hyphens. 872 /// Convert an UUID to a raw uuid string. Right now this is a string without hyphens.
867 /// </summary> 873 /// </summary>