From ef4122213c440c55d32c097c08e52170f4b4346a Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Mon, 6 Aug 2012 15:35:40 +0100
Subject: enables configurable minimum sizes for physical & non-physical prims
---
OpenSim/Framework/RegionInfo.cs | 42 +++++++++++++++++++++++++++++++++++++++--
1 file changed, 40 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Framework')
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
public UUID lastMapUUID = UUID.Zero;
public string lastMapRefresh = "0";
+ private float m_nonphysPrimMin = 0;
private int m_nonphysPrimMax = 0;
+ private float m_physPrimMin = 0;
private int m_physPrimMax = 0;
private bool m_clampPrimSize = false;
private int m_objectCapacity = 0;
@@ -285,11 +287,21 @@ namespace OpenSim.Framework
set { m_windlight = value; }
}
+ public float NonphysPrimMin
+ {
+ get { return m_nonphysPrimMin; }
+ }
+
public int NonphysPrimMax
{
get { return m_nonphysPrimMax; }
}
+ public float PhysPrimMin
+ {
+ get { return m_physPrimMin; }
+ }
+
public int PhysPrimMax
{
get { return m_physPrimMax; }
@@ -623,16 +635,28 @@ namespace OpenSim.Framework
m_regionType = config.GetString("RegionType", String.Empty);
allKeys.Remove("RegionType");
- // Prim stuff
- //
+ #region Prim stuff
+
+ m_nonphysPrimMin = config.GetFloat("NonphysicalPrimMin", 0);
+ allKeys.Remove("NonphysicalPrimMin");
+
m_nonphysPrimMax = config.GetInt("NonphysicalPrimMax", 0);
allKeys.Remove("NonphysicalPrimMax");
+
+ m_physPrimMin = config.GetFloat("PhysicalPrimMin", 0);
+ allKeys.Remove("PhysicalPrimMin");
+
m_physPrimMax = config.GetInt("PhysicalPrimMax", 0);
allKeys.Remove("PhysicalPrimMax");
+
m_clampPrimSize = config.GetBoolean("ClampPrimSize", false);
allKeys.Remove("ClampPrimSize");
+
m_objectCapacity = config.GetInt("MaxPrims", 15000);
allKeys.Remove("MaxPrims");
+
+ #endregion
+
m_agentCapacity = config.GetInt("MaxAgents", 100);
allKeys.Remove("MaxAgents");
@@ -668,10 +692,18 @@ namespace OpenSim.Framework
config.Set("ExternalHostName", m_externalHostName);
+ if (m_nonphysPrimMin != 0)
+ config.Set("NonphysicalPrimMax", m_nonphysPrimMin);
+
if (m_nonphysPrimMax != 0)
config.Set("NonphysicalPrimMax", m_nonphysPrimMax);
+
+ if (m_physPrimMin != 0)
+ config.Set("PhysicalPrimMax", m_physPrimMin);
+
if (m_physPrimMax != 0)
config.Set("PhysicalPrimMax", m_physPrimMax);
+
config.Set("ClampPrimSize", m_clampPrimSize.ToString());
if (m_objectCapacity != 0)
@@ -754,9 +786,15 @@ namespace OpenSim.Framework
configMember.addConfigurationOption("lastmap_refresh", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY,
"Last Map Refresh", Util.UnixTimeSinceEpoch().ToString(), true);
+ configMember.addConfigurationOption("nonphysical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
+ "Minimum size for nonphysical prims", m_nonphysPrimMin.ToString(), true);
+
configMember.addConfigurationOption("nonphysical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Maximum size for nonphysical prims", m_nonphysPrimMax.ToString(), true);
+ configMember.addConfigurationOption("physical_prim_min", ConfigurationOption.ConfigurationTypes.TYPE_FLOAT,
+ "Minimum size for nonphysical prims", m_physPrimMin.ToString(), true);
+
configMember.addConfigurationOption("physical_prim_max", ConfigurationOption.ConfigurationTypes.TYPE_INT32,
"Maximum size for physical prims", m_physPrimMax.ToString(), true);
--
cgit v1.1
From e9ea911563362c4766d34cd948a2915beac06124 Mon Sep 17 00:00:00 2001
From: SignpostMarv
Date: Fri, 17 Aug 2012 16:53:36 +0100
Subject: adding a clip method to handle Vector3 objects to enable a minor
amount of refactoring
---
OpenSim/Framework/Util.cs | 6 ++++++
1 file changed, 6 insertions(+)
(limited to 'OpenSim/Framework')
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
return Math.Min(Math.Max(x, min), max);
}
+ public static Vector3 Clip(Vector3 vec, float min, float max)
+ {
+ return new Vector3(Clip(vec.X, min, max), Clip(vec.Y, min, max),
+ Clip(vec.Z, min, max));
+ }
+
///
/// Convert an UUID to a raw uuid string. Right now this is a string without hyphens.
///
--
cgit v1.1
From e4e5237086bd34a6649b687d3499a6795317f043 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 18 Aug 2012 00:46:34 +0100
Subject: When reporting a thread timeout, create a copy of the info rather
than passing the original ThreadWatchdogInfo structure.
This is to avoid the possibility of misleading reporting if a watchdog update outraces an alarm.
Should address any remaining issues from http://opensimulator.org/mantis/view.php?id=6012
---
OpenSim/Framework/Monitoring/Watchdog.cs | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Framework')
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
FirstTick = Environment.TickCount & Int32.MaxValue;
LastTick = FirstTick;
}
+
+ public ThreadWatchdogInfo(ThreadWatchdogInfo previousTwi)
+ {
+ Thread = previousTwi.Thread;
+ FirstTick = previousTwi.FirstTick;
+ LastTick = previousTwi.LastTick;
+ Timeout = previousTwi.Timeout;
+ IsTimedOut = previousTwi.IsTimedOut;
+ AlarmIfTimeout = previousTwi.AlarmIfTimeout;
+ AlarmMethod = previousTwi.AlarmMethod;
+ }
}
///
@@ -335,7 +346,9 @@ namespace OpenSim.Framework.Monitoring
if (callbackInfos == null)
callbackInfos = new List();
- callbackInfos.Add(threadInfo);
+ // Send a copy of the watchdog info to prevent race conditions where the watchdog
+ // thread updates the monitoring info after an alarm has been sent out.
+ callbackInfos.Add(new ThreadWatchdogInfo(threadInfo));
}
}
}
--
cgit v1.1