From 90ea00a1098c918d5eb5a2be2793b109c6622a35 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 23 Feb 2012 22:56:42 +0000
Subject: Try to resolve some problems with viewers crashing after hitting
parcel banlines or freezing on the banline.
This involves
1) On forcible teleport, call m_scene.RequestTeleportLocation() rather than ScenePresence.Teleport() - only EntityTransferModule now should call SP.Teleport()
2) When avatar is being forcibly moved due to banlines, use a 'stop movement' tolerance of 0.2 to requested position rather than 1
This prevents the avatar sometimes being stuck to banlines until they teleport somewhere else.
This aims to fix some problems in http://opensimulator.org/mantis/view.php?id=5822
---
OpenSim/Region/Framework/Scenes/Scene.cs | 17 ++++++++++++-----
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 13 ++++++++-----
2 files changed, 20 insertions(+), 10 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6187803..cf6e6af 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4699,7 +4699,10 @@ namespace OpenSim.Region.Framework.Scenes
Vector3? nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
if (nearestPoint != null)
{
- Debug.WriteLine("Found a sane previous position based on velocity, sending them to: " + nearestPoint.ToString());
+// m_log.DebugFormat(
+// "[SCENE]: Found a sane previous position based on velocity for {0}, sending them to {1} in {2}",
+// avatar.Name, nearestPoint, nearestParcel.LandData.Name);
+
return nearestPoint.Value;
}
@@ -4709,12 +4712,16 @@ namespace OpenSim.Region.Framework.Scenes
nearestPoint = GetNearestPointInParcelAlongDirectionFromPoint(avatar.AbsolutePosition, dir, nearestParcel);
if (nearestPoint != null)
{
- Debug.WriteLine("They had a zero velocity, sending them to: " + nearestPoint.ToString());
+// m_log.DebugFormat(
+// "[SCENE]: {0} had a zero velocity, sending them to {1}", avatar.Name, nearestPoint);
+
return nearestPoint.Value;
}
- //Ultimate backup if we have no idea where they are
- Debug.WriteLine("Have no idea where they are, sending them to: " + avatar.lastKnownAllowedPosition.ToString());
+ //Ultimate backup if we have no idea where they are
+// m_log.DebugFormat(
+// "[SCENE]: No idea where {0} is, sending them to {1}", avatar.Name, avatar.lastKnownAllowedPosition);
+
return avatar.lastKnownAllowedPosition;
}
@@ -5120,7 +5127,7 @@ namespace OpenSim.Region.Framework.Scenes
// presence.Name, presence.AbsolutePosition, presence.MoveToPositionTarget);
Vector3 agent_control_v3 = new Vector3();
- presence.HandleMoveToTargetUpdate(ref agent_control_v3);
+ presence.HandleMoveToTargetUpdate(1, ref agent_control_v3);
presence.AddNewMovement(agent_control_v3);
}
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9cfdf9f..40c8d06 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1048,7 +1048,7 @@ namespace OpenSim.Region.Framework.Scenes
}
///
- ///
+ /// Do not call this directly. Call Scene.RequestTeleportLocation() instead.
///
///
public void Teleport(Vector3 pos)
@@ -1522,7 +1522,10 @@ namespace OpenSim.Region.Framework.Scenes
}
else if (bAllowUpdateMoveToPosition)
{
- if (HandleMoveToTargetUpdate(ref agent_control_v3))
+ // The UseClientAgentPosition is set if parcel ban is forcing the avatar to move to a
+ // certain position. It's only check for tolerance on returning to that position is 0.2
+ // rather than 1, at which point it removes its force target.
+ if (HandleMoveToTargetUpdate(agentData.UseClientAgentPosition ? 0.2 : 1, ref agent_control_v3))
update_movementflag = true;
}
}
@@ -1584,7 +1587,7 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Cumulative agent movement that this method will update.
/// True if movement has been updated in some way. False otherwise.
- public bool HandleMoveToTargetUpdate(ref Vector3 agent_control_v3)
+ public bool HandleMoveToTargetUpdate(double tolerance, ref Vector3 agent_control_v3)
{
// m_log.DebugFormat("[SCENE PRESENCE]: Called HandleMoveToTargetUpdate() for {0}", Name);
@@ -1601,7 +1604,7 @@ namespace OpenSim.Region.Framework.Scenes
// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
// Check the error term of the current position in relation to the target position
- if (distanceToTarget <= 1)
+ if (distanceToTarget <= tolerance)
{
// We are close enough to the target
AbsolutePosition = MoveToPositionTarget;
@@ -1777,7 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes
// m_log.DebugFormat("[SCENE PRESENCE]: Body rot for {0} set to {1}", Name, Rotation);
Vector3 agent_control_v3 = new Vector3();
- HandleMoveToTargetUpdate(ref agent_control_v3);
+ HandleMoveToTargetUpdate(1, ref agent_control_v3);
AddNewMovement(agent_control_v3);
}
--
cgit v1.1
From f67f37074f3f7e0602b66aa66a044dd9fd107f6a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 24 Feb 2012 05:02:33 +0000
Subject: Stop spurious scene loop startup timeout alarms for scenes with many
prims.
On the first frame, all startup scene objects are added to the physics scene.
This can cause a considerable delay, so we don't start raising the alarm on scene loop timeouts until the second frame.
This commit also slightly changes the behaviour of timeout reporting.
Previously, a report was made for the very first timed out thread, ignoring all others until the next watchdog check.
Instead, we now report every timed out thread, though we still only do this once no matter how long the timeout.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index cf6e6af..19d4bad 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1140,7 +1140,7 @@ namespace OpenSim.Region.Framework.Scenes
HeartbeatThread
= Watchdog.StartThread(
- Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false);
+ Heartbeat, string.Format("Heartbeat ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, false);
}
///
@@ -1178,6 +1178,13 @@ namespace OpenSim.Region.Framework.Scenes
try
{
m_eventManager.TriggerOnRegionStarted(this);
+
+ // The first frame can take a very long time due to physics actors being added on startup. Therefore,
+ // don't turn on the watchdog alarm for this thread until the second frame, in order to prevent false
+ // alarms for scenes with many objects.
+ Update();
+ Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
+
while (!shuttingdown)
Update();
@@ -1206,7 +1213,7 @@ namespace OpenSim.Region.Framework.Scenes
++Frame;
-// m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame);
+// m_log.DebugFormat("[SCENE]: Processing frame {0} in {1}", Frame, RegionInfo.RegionName);
try
{
@@ -1418,7 +1425,6 @@ namespace OpenSim.Region.Framework.Scenes
entry.checkAtTargets();
}
-
///
/// Send out simstats data to all clients
///
--
cgit v1.1
From 84735b644cbd8902dd749fadb4056d26044fd564 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 24 Feb 2012 05:12:56 +0000
Subject: Get rid of some of the identical exception catching in
Scene.Update().
---
OpenSim/Region/Framework/Scenes/Scene.cs | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 19d4bad..9bca654 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1368,26 +1368,10 @@ namespace OpenSim.Region.Framework.Scenes
{
throw;
}
- catch (AccessViolationException e)
- {
- m_log.ErrorFormat(
- "[REGION]: Failed on region {0} with exception {1}{2}",
- RegionInfo.RegionName, e.Message, e.StackTrace);
- }
- //catch (NullReferenceException e)
- //{
- // m_log.Error("[REGION]: Failed with exception " + e.ToString() + " On Region: " + RegionInfo.RegionName);
- //}
- catch (InvalidOperationException e)
- {
- m_log.ErrorFormat(
- "[REGION]: Failed on region {0} with exception {1}{2}",
- RegionInfo.RegionName, e.Message, e.StackTrace);
- }
catch (Exception e)
{
m_log.ErrorFormat(
- "[REGION]: Failed on region {0} with exception {1}{2}",
+ "[SCENE]: Failed on region {0} with exception {1}{2}",
RegionInfo.RegionName, e.Message, e.StackTrace);
}
--
cgit v1.1
From bafef292f4d41df14a1edeafc7ba5f9d623d7822 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 24 Feb 2012 05:25:18 +0000
Subject: Take watchdog alarm calling back outside the m_threads lock.
This is how it was originally. This stops a very long running alarm callback from causing a problem.
---
OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 19c9745..4d98f00 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -156,8 +156,8 @@ namespace OpenSim.Region.Framework.Scenes
// that the region position is cached or performance will degrade
Utils.LongToUInts(regionHandle, out x, out y);
GridRegion dest = m_scene.GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y);
- bool v = true;
- if (! simulatorList.Contains(dest.ServerURI))
+// bool v = true;
+ if (!simulatorList.Contains(dest.ServerURI))
{
// we havent seen this simulator before, add it to the list
// and send it an update
--
cgit v1.1
From e8779cd9e54416349e67d9e5c48b35bab43b69e9 Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Thu, 1 Mar 2012 19:22:05 -0800
Subject: In ScenePresence, removed several private variables used to store
public parameters. They were only used by the get/set and make code harder to
refactor.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 152 +++++++----------------
1 file changed, 44 insertions(+), 108 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 40c8d06..e982bfe 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -341,15 +341,9 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Position of agent's camera in world (region cordinates)
///
- protected Vector3 m_lastCameraPosition;
-
- protected Vector3 m_CameraPosition;
-
- public Vector3 CameraPosition
- {
- get { return m_CameraPosition; }
- private set { m_CameraPosition = value; }
- }
+ protected Vector3 m_lastCameraPosition;
+
+ public Vector3 CameraPosition { get; set; }
public Quaternion CameraRotation
{
@@ -358,29 +352,10 @@ namespace OpenSim.Region.Framework.Scenes
// Use these three vectors to figure out what the agent is looking at
// Convert it to a Matrix and/or Quaternion
- //
- protected Vector3 m_CameraAtAxis;
- protected Vector3 m_CameraLeftAxis;
- protected Vector3 m_CameraUpAxis;
-
- public Vector3 CameraAtAxis
- {
- get { return m_CameraAtAxis; }
- private set { m_CameraAtAxis = value; }
- }
-
-
- public Vector3 CameraLeftAxis
- {
- get { return m_CameraLeftAxis; }
- private set { m_CameraLeftAxis = value; }
- }
-
- public Vector3 CameraUpAxis
- {
- get { return m_CameraUpAxis; }
- private set { m_CameraUpAxis = value; }
- }
+ //
+ public Vector3 CameraAtAxis { get; set; }
+ public Vector3 CameraLeftAxis { get; set; }
+ public Vector3 CameraUpAxis { get; set; }
public Vector3 Lookat
{
@@ -396,33 +371,15 @@ namespace OpenSim.Region.Framework.Scenes
}
#endregion
- public readonly string Firstname;
- public readonly string Lastname;
-
- private string m_grouptitle;
-
- public string Grouptitle
- {
- get { return m_grouptitle; }
- set { m_grouptitle = value; }
- }
-
- // Agent's Draw distance.
- protected float m_DrawDistance;
-
- public float DrawDistance
- {
- get { return m_DrawDistance; }
- private set { m_DrawDistance = value; }
- }
-
- protected bool m_allowMovement = true;
+ public string Firstname { get; private set; }
+ public string Lastname { get; private set; }
+
+ public string Grouptitle { get; set; }
- public bool AllowMovement
- {
- get { return m_allowMovement; }
- set { m_allowMovement = value; }
- }
+ // Agent's Draw distance.
+ public float DrawDistance { get; set; }
+
+ public bool AllowMovement { get; set; }
private bool m_setAlwaysRun;
@@ -447,15 +404,9 @@ namespace OpenSim.Region.Framework.Scenes
PhysicsActor.SetAlwaysRun = value;
}
}
- }
-
- private byte m_state;
-
- public byte State
- {
- get { return m_state; }
- set { m_state = value; }
- }
+ }
+
+ public byte State { get; set; }
private AgentManager.ControlFlags m_AgentControlFlags;
@@ -463,31 +414,16 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return (uint)m_AgentControlFlags; }
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
- }
-
- ///
- /// This works out to be the ClientView object associated with this avatar, or it's client connection manager
- ///
- private IClientAPI m_controllingClient;
-
- public IClientAPI ControllingClient
- {
- get { return m_controllingClient; }
- private set { m_controllingClient = value; }
- }
+ }
+
+ public IClientAPI ControllingClient { get; set; }
public IClientCore ClientView
- {
- get { return (IClientCore) m_controllingClient; }
- }
-
- protected Vector3 m_parentPosition;
-
- public Vector3 ParentPosition
- {
- get { return m_parentPosition; }
- set { m_parentPosition = value; }
- }
+ {
+ get { return (IClientCore)ControllingClient; }
+ }
+
+ public Vector3 ParentPosition { get; set; }
///
/// Position of this avatar relative to the region the avatar is in
@@ -825,18 +761,18 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3[] GetWalkDirectionVectors()
{
- Vector3[] vector = new Vector3[11];
- vector[0] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD
- vector[1] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK
+ Vector3[] vector = new Vector3[11];
+ vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
+ vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
vector[2] = Vector3.UnitY; //LEFT
- vector[3] = -Vector3.UnitY; //RIGHT
- vector[4] = new Vector3(m_CameraAtAxis.Z, 0f, m_CameraUpAxis.Z); //UP
- vector[5] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN
- vector[6] = new Vector3(m_CameraUpAxis.Z, 0f, -m_CameraAtAxis.Z); //FORWARD_NUDGE
- vector[7] = new Vector3(-m_CameraUpAxis.Z, 0f, m_CameraAtAxis.Z); //BACK_NUDGE
+ vector[3] = -Vector3.UnitY; //RIGHT
+ vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
+ vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
+ vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
+ vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
vector[8] = Vector3.UnitY; //LEFT_NUDGE
- vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
- vector[10] = new Vector3(-m_CameraAtAxis.Z, 0f, -m_CameraUpAxis.Z); //DOWN_NUDGE
+ vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
+ vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE
return vector;
}
@@ -1333,7 +1269,7 @@ namespace OpenSim.Region.Framework.Scenes
// Convert it to a Matrix and/or Quaternion
CameraAtAxis = agentData.CameraAtAxis;
CameraLeftAxis = agentData.CameraLeftAxis;
- m_CameraUpAxis = agentData.CameraUpAxis;
+ CameraUpAxis = agentData.CameraUpAxis;
// The Agent's Draw distance setting
// When we get to the point of re-computing neighbors everytime this
@@ -1343,9 +1279,9 @@ namespace OpenSim.Region.Framework.Scenes
DrawDistance = Scene.DefaultDrawDistance;
// Check if Client has camera in 'follow cam' or 'build' mode.
- Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
-
- m_followCamAuto = ((m_CameraUpAxis.Z > 0.959f && m_CameraUpAxis.Z < 0.98f)
+ Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
+
+ m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f)
&& (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false;
m_mouseLook = (flags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) != 0;
@@ -3077,8 +3013,8 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Velocity = m_velocity;
cAgent.Center = CameraPosition;
cAgent.AtAxis = CameraAtAxis;
- cAgent.LeftAxis = CameraLeftAxis;
- cAgent.UpAxis = m_CameraUpAxis;
+ cAgent.LeftAxis = CameraLeftAxis;
+ cAgent.UpAxis = CameraUpAxis;
cAgent.Far = DrawDistance;
@@ -3163,8 +3099,8 @@ namespace OpenSim.Region.Framework.Scenes
m_velocity = cAgent.Velocity;
CameraPosition = cAgent.Center;
CameraAtAxis = cAgent.AtAxis;
- CameraLeftAxis = cAgent.LeftAxis;
- m_CameraUpAxis = cAgent.UpAxis;
+ CameraLeftAxis = cAgent.LeftAxis;
+ CameraUpAxis = cAgent.UpAxis;
// When we get to the point of re-computing neighbors everytime this
// changes, then start using the agent's drawdistance rather than the
--
cgit v1.1
From 6e3523e25e8d5538ed63984241093c1cfb6f2388 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 2 Mar 2012 04:08:07 +0000
Subject: minor: remove mono compiler warning
---
OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
index e4b607d..e16903c 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/TaskInventoryTests.cs
@@ -65,8 +65,7 @@ namespace OpenSim.Region.Framework.Tests
// Create an object embedded inside the first
UUID taskSceneObjectItemId = UUID.Parse("00000000-0000-0000-0000-100000000000");
- TaskInventoryItem taskSceneObjectItem
- = TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
+ TaskInventoryHelpers.AddSceneObject(scene, sop1, "tso", taskSceneObjectItemId, user1.PrincipalID);
TaskInventoryItem addedItem = sop1.Inventory.GetInventoryItem(taskSceneObjectItemId);
Assert.That(addedItem.ItemID, Is.EqualTo(taskSceneObjectItemId));
--
cgit v1.1
From 8d249f8456f6bf70f4d81098007a02b1ede5587e Mon Sep 17 00:00:00 2001
From: Dan Lake
Date: Fri, 2 Mar 2012 09:19:13 -0800
Subject: ScenePresence line endings and fix AllowMovement default to true.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 60 ++++++++++++------------
1 file changed, 30 insertions(+), 30 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index e982bfe..ec6bb89 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -341,8 +341,8 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Position of agent's camera in world (region cordinates)
///
- protected Vector3 m_lastCameraPosition;
-
+ protected Vector3 m_lastCameraPosition;
+
public Vector3 CameraPosition { get; set; }
public Quaternion CameraRotation
@@ -352,9 +352,9 @@ namespace OpenSim.Region.Framework.Scenes
// Use these three vectors to figure out what the agent is looking at
// Convert it to a Matrix and/or Quaternion
- //
- public Vector3 CameraAtAxis { get; set; }
- public Vector3 CameraLeftAxis { get; set; }
+ //
+ public Vector3 CameraAtAxis { get; set; }
+ public Vector3 CameraLeftAxis { get; set; }
public Vector3 CameraUpAxis { get; set; }
public Vector3 Lookat
@@ -371,14 +371,14 @@ namespace OpenSim.Region.Framework.Scenes
}
#endregion
- public string Firstname { get; private set; }
- public string Lastname { get; private set; }
-
+ public string Firstname { get; private set; }
+ public string Lastname { get; private set; }
+
public string Grouptitle { get; set; }
- // Agent's Draw distance.
- public float DrawDistance { get; set; }
-
+ // Agent's Draw distance.
+ public float DrawDistance { get; set; }
+
public bool AllowMovement { get; set; }
private bool m_setAlwaysRun;
@@ -404,8 +404,8 @@ namespace OpenSim.Region.Framework.Scenes
PhysicsActor.SetAlwaysRun = value;
}
}
- }
-
+ }
+
public byte State { get; set; }
private AgentManager.ControlFlags m_AgentControlFlags;
@@ -414,15 +414,15 @@ namespace OpenSim.Region.Framework.Scenes
{
get { return (uint)m_AgentControlFlags; }
set { m_AgentControlFlags = (AgentManager.ControlFlags)value; }
- }
-
+ }
+
public IClientAPI ControllingClient { get; set; }
public IClientCore ClientView
- {
+ {
get { return (IClientCore)ControllingClient; }
- }
-
+ }
+
public Vector3 ParentPosition { get; set; }
///
@@ -683,7 +683,7 @@ namespace OpenSim.Region.Framework.Scenes
IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
{
AttachmentsSyncLock = new Object();
-
+ AllowMovement = true;
IsChildAgent = true;
m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
Animator = new ScenePresenceAnimator(this);
@@ -761,17 +761,17 @@ namespace OpenSim.Region.Framework.Scenes
private Vector3[] GetWalkDirectionVectors()
{
- Vector3[] vector = new Vector3[11];
- vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
+ Vector3[] vector = new Vector3[11];
+ vector[0] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD
vector[1] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK
vector[2] = Vector3.UnitY; //LEFT
- vector[3] = -Vector3.UnitY; //RIGHT
- vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
- vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
- vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
+ vector[3] = -Vector3.UnitY; //RIGHT
+ vector[4] = new Vector3(CameraAtAxis.Z, 0f, CameraUpAxis.Z); //UP
+ vector[5] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN
+ vector[6] = new Vector3(CameraUpAxis.Z, 0f, -CameraAtAxis.Z); //FORWARD_NUDGE
vector[7] = new Vector3(-CameraUpAxis.Z, 0f, CameraAtAxis.Z); //BACK_NUDGE
vector[8] = Vector3.UnitY; //LEFT_NUDGE
- vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
+ vector[9] = -Vector3.UnitY; //RIGHT_NUDGE
vector[10] = new Vector3(-CameraAtAxis.Z, 0f, -CameraUpAxis.Z); //DOWN_NUDGE
return vector;
}
@@ -1279,8 +1279,8 @@ namespace OpenSim.Region.Framework.Scenes
DrawDistance = Scene.DefaultDrawDistance;
// Check if Client has camera in 'follow cam' or 'build' mode.
- Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
-
+ Vector3 camdif = (Vector3.One * Rotation - Vector3.One * CameraRotation);
+
m_followCamAuto = ((CameraUpAxis.Z > 0.959f && CameraUpAxis.Z < 0.98f)
&& (Math.Abs(camdif.X) < 0.4f && Math.Abs(camdif.Y) < 0.4f)) ? true : false;
@@ -3013,7 +3013,7 @@ namespace OpenSim.Region.Framework.Scenes
cAgent.Velocity = m_velocity;
cAgent.Center = CameraPosition;
cAgent.AtAxis = CameraAtAxis;
- cAgent.LeftAxis = CameraLeftAxis;
+ cAgent.LeftAxis = CameraLeftAxis;
cAgent.UpAxis = CameraUpAxis;
cAgent.Far = DrawDistance;
@@ -3099,7 +3099,7 @@ namespace OpenSim.Region.Framework.Scenes
m_velocity = cAgent.Velocity;
CameraPosition = cAgent.Center;
CameraAtAxis = cAgent.AtAxis;
- CameraLeftAxis = cAgent.LeftAxis;
+ CameraLeftAxis = cAgent.LeftAxis;
CameraUpAxis = cAgent.UpAxis;
// When we get to the point of re-computing neighbors everytime this
--
cgit v1.1
From 089fd61a3b27faa2479f6b56c6d0dc1cf14774a2 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 2 Mar 2012 22:43:24 +0000
Subject: Allow a script to receive events if its root prim is in an area where
it's allowed to run rather than checking its own prim.
This allows scripts to run in child prims that are outside region boundaries.
This is an interim patch applied from http://opensimulator.org/mantis/view.php?id=5899 though it does not resolve that bug
Thanks tglion!
---
OpenSim/Region/Framework/Scenes/Scene.cs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 9bca654..f45a08c 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4162,10 +4162,7 @@ namespace OpenSim.Region.Framework.Scenes
// their scripts will actually run.
// -- Leaf, Tue Aug 12 14:17:05 EDT 2008
SceneObjectPart parent = part.ParentGroup.RootPart;
- if (part.ParentGroup.IsAttachment)
- return ScriptDanger(parent, parent.GetWorldPosition());
- else
- return ScriptDanger(part, part.GetWorldPosition());
+ return ScriptDanger(parent, parent.GetWorldPosition());
}
else
{
--
cgit v1.1
From c2c102d33e46d0ed651198e0e9b7459423516660 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 2 Mar 2012 22:52:26 +0000
Subject: Remove outdated comment about checking attachment prims in
Scene.PipeEventsForScript()
---
OpenSim/Region/Framework/Scenes/Scene.cs | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index f45a08c..a01b851 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -4156,11 +4156,9 @@ namespace OpenSim.Region.Framework.Scenes
public bool PipeEventsForScript(uint localID)
{
SceneObjectPart part = GetSceneObjectPart(localID);
+
if (part != null)
{
- // Changed so that child prims of attachments return ScriptDanger for their parent, so that
- // their scripts will actually run.
- // -- Leaf, Tue Aug 12 14:17:05 EDT 2008
SceneObjectPart parent = part.ParentGroup.RootPart;
return ScriptDanger(parent, parent.GetWorldPosition());
}
--
cgit v1.1
From 0f4cdc0c5bb750ec4ab7b100dc82d3ff08c9e427 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Mar 2012 19:05:32 +0000
Subject: Explictly close down the StatsReporter so that we can shutdown its
timer
This is another step necessary for the scene to be garbage collected between performance tests
---
OpenSim/Region/Framework/Scenes/Scene.cs | 2 ++
OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 6 ++++++
2 files changed, 8 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a01b851..6b28581 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1076,6 +1076,8 @@ namespace OpenSim.Region.Framework.Scenes
{
m_log.InfoFormat("[SCENE]: Closing down the single simulator: {0}", RegionInfo.RegionName);
+ StatsReporter.Close();
+
m_restartTimer.Stop();
m_restartTimer.Close();
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 35cd025..210f48d 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -185,6 +185,12 @@ namespace OpenSim.Region.Framework.Scenes
OnSendStatsResult += StatsManager.SimExtraStats.ReceiveClassicSimStatsPacket;
}
+ public void Close()
+ {
+ m_report.Elapsed -= statsHeartBeat;
+ m_report.Close();
+ }
+
public void SetUpdateMS(int ms)
{
statsUpdatesEveryMS = ms;
--
cgit v1.1
From e9d8eb5a270645ece83c864dbd3c84bf226a57f7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Mar 2012 22:31:25 +0000
Subject: Remove unnecessary explicit ElapsedEventHandler in SimReporter
---
OpenSim/Region/Framework/Scenes/SimStatsReporter.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
index 210f48d..5c56264 100644
--- a/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
+++ b/OpenSim/Region/Framework/Scenes/SimStatsReporter.cs
@@ -178,7 +178,7 @@ namespace OpenSim.Region.Framework.Scenes
m_objectCapacity = scene.RegionInfo.ObjectCapacity;
m_report.AutoReset = true;
m_report.Interval = statsUpdatesEveryMS;
- m_report.Elapsed += new ElapsedEventHandler(statsHeartBeat);
+ m_report.Elapsed += statsHeartBeat;
m_report.Enabled = true;
if (StatsManager.SimExtraStats != null)
--
cgit v1.1
From 98251cdab364baf20537a1b5a6260c68e6630ccf Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Tue, 6 Mar 2012 23:21:17 +0000
Subject: Add sensor, dataserver requests, timer and listener counts to
"xengine status" command.
This is for diagnostic purposes.
---
OpenSim/Region/Framework/Interfaces/IWorldComm.cs | 5 +++++
1 file changed, 5 insertions(+)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs
index dafbf30..e8e375e 100644
--- a/OpenSim/Region/Framework/Interfaces/IWorldComm.cs
+++ b/OpenSim/Region/Framework/Interfaces/IWorldComm.cs
@@ -50,6 +50,11 @@ namespace OpenSim.Region.Framework.Interfaces
public interface IWorldComm
{
///
+ /// Total number of listeners
+ ///
+ int ListenerCount { get; }
+
+ ///
/// Create a listen event callback with the specified filters.
/// The parameters localID,itemID are needed to uniquely identify
/// the script during 'peek' time. Parameter hostID is needed to
--
cgit v1.1
From 23aba007dd0c6e8983feef6fc078b3d5b674ed3a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 7 Mar 2012 00:04:24 +0000
Subject: Add documentation to make more explicit the difference between
OnRezScript and OnNewScript in the event manager
OnNewScript fires when a script is added to a scene
OnRezScript fires when the script actually runs (i.e. after permission checks, state retrieval, etc.)
---
OpenSim/Region/Framework/Scenes/EventManager.cs | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/EventManager.cs b/OpenSim/Region/Framework/Scenes/EventManager.cs
index 569c235..6ff2a6f 100644
--- a/OpenSim/Region/Framework/Scenes/EventManager.cs
+++ b/OpenSim/Region/Framework/Scenes/EventManager.cs
@@ -138,8 +138,11 @@ namespace OpenSim.Region.Framework.Scenes
public event OnPermissionErrorDelegate OnPermissionError;
///
- /// Fired when a new script is created.
+ /// Fired when a script is run.
///
+ ///
+ /// Occurs after OnNewScript.
+ ///
public event NewRezScript OnRezScript;
public delegate void NewRezScript(uint localID, UUID itemID, string script, int startParam, bool postOnRez, string engine, int stateSource);
@@ -187,10 +190,16 @@ namespace OpenSim.Region.Framework.Scenes
public event ClientClosed OnClientClosed;
- // Fired when a script is created
- // The indication that a new script exists in this region.
public delegate void NewScript(UUID clientID, SceneObjectPart part, UUID itemID);
+
+ ///
+ /// Fired when a script is created.
+ ///
+ ///
+ /// Occurs before OnRezScript
+ ///
public event NewScript OnNewScript;
+
public virtual void TriggerNewScript(UUID clientID, SceneObjectPart part, UUID itemID)
{
NewScript handlerNewScript = OnNewScript;
@@ -212,10 +221,16 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- //TriggerUpdateScript: triggered after Scene receives client's upload of updated script and stores it as asset
- // An indication that the script has changed.
public delegate void UpdateScript(UUID clientID, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID);
+
+ ///
+ /// An indication that the script has changed.
+ ///
+ ///
+ /// Triggered after the scene receives a client's upload of an updated script and has stored it in an asset.
+ ///
public event UpdateScript OnUpdateScript;
+
public virtual void TriggerUpdateScript(UUID clientId, UUID itemId, UUID primId, bool isScriptRunning, UUID newAssetID)
{
UpdateScript handlerUpdateScript = OnUpdateScript;
--
cgit v1.1
From f3678d217f7b1d69faf4aaeb0097348f3d7f91b6 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Wed, 7 Mar 2012 00:31:18 +0000
Subject: Stop individually deleting objects at the end of each
ObjectTortureTest.
We can now do this since the entire scene and all objects within it are now successfully gc'd at the end of these tests.
This greatly improves the time taken to run each test (by reducing teardown time, not the time to actually do the test work that we're interested in).
Slightly simplifies config read in Scene constructor to help facilitate this.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 49 ++++++++++++++------------------
1 file changed, 21 insertions(+), 28 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 6b28581..11e5ce3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -628,10 +628,10 @@ namespace OpenSim.Region.Framework.Scenes
#region Region Config
- try
+ // Region config overrides global config
+ //
+ if (m_config.Configs["Startup"] != null)
{
- // Region config overrides global config
- //
IConfig startupConfig = m_config.Configs["Startup"];
m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
@@ -721,46 +721,39 @@ namespace OpenSim.Region.Framework.Scenes
m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
}
- catch
- {
- m_log.Warn("[SCENE]: Failed to load StartupConfig");
- }
#endregion Region Config
#region Interest Management
- if (m_config != null)
+ IConfig interestConfig = m_config.Configs["InterestManagement"];
+ if (interestConfig != null)
{
- IConfig interestConfig = m_config.Configs["InterestManagement"];
- if (interestConfig != null)
- {
- string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
-
- try
- {
- m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
- }
- catch (Exception)
- {
- m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
- m_priorityScheme = UpdatePrioritizationSchemes.Time;
- }
+ string update_prioritization_scheme = interestConfig.GetString("UpdatePrioritizationScheme", "Time").Trim().ToLower();
- m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
- m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
- m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
- m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
+ try
+ {
+ m_priorityScheme = (UpdatePrioritizationSchemes)Enum.Parse(typeof(UpdatePrioritizationSchemes), update_prioritization_scheme, true);
}
+ catch (Exception)
+ {
+ m_log.Warn("[PRIORITIZER]: UpdatePrioritizationScheme was not recognized, setting to default prioritizer Time");
+ m_priorityScheme = UpdatePrioritizationSchemes.Time;
+ }
+
+ m_reprioritizationEnabled = interestConfig.GetBoolean("ReprioritizationEnabled", true);
+ m_reprioritizationInterval = interestConfig.GetDouble("ReprioritizationInterval", 5000.0);
+ m_rootReprioritizationDistance = interestConfig.GetDouble("RootReprioritizationDistance", 10.0);
+ m_childReprioritizationDistance = interestConfig.GetDouble("ChildReprioritizationDistance", 20.0);
}
- m_log.InfoFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
+ m_log.DebugFormat("[SCENE]: Using the {0} prioritization scheme", m_priorityScheme);
#endregion Interest Management
StatsReporter = new SimStatsReporter(this);
StatsReporter.OnSendStatsResult += SendSimStatsPackets;
- StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
+ StatsReporter.OnStatsIncorrect += m_sceneGraph.RecalculateStats;
}
///
--
cgit v1.1
From 5884d080623fddb3ee50b8215d896bdee3fa31a4 Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 7 Mar 2012 00:58:01 +0000
Subject: Fix merge issue
---
OpenSim/Region/Framework/Scenes/Scene.cs | 155 ++++++++++++++++---------------
1 file changed, 79 insertions(+), 76 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fc72946..d016887 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -653,99 +653,102 @@ namespace OpenSim.Region.Framework.Scenes
// Region config overrides global config
//
- if (m_config.Configs["Startup"] != null)
+ try
{
- IConfig startupConfig = m_config.Configs["Startup"];
+ if (m_config.Configs["Startup"] != null)
+ {
+ IConfig startupConfig = m_config.Configs["Startup"];
- m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
- m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup);
- if (!m_useBackup)
- m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
-
- //Animation states
- m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
+ m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance",m_defaultDrawDistance);
+ m_useBackup = startupConfig.GetBoolean("UseSceneBackup", m_useBackup);
+ if (!m_useBackup)
+ m_log.InfoFormat("[SCENE]: Backup has been disabled for {0}", RegionInfo.RegionName);
+
+ //Animation states
+ m_useFlySlow = startupConfig.GetBoolean("enableflyslow", false);
- PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
- CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
+ PhysicalPrims = startupConfig.GetBoolean("physical_prim", true);
+ CollidablePrims = startupConfig.GetBoolean("collidable_prim", true);
- m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys);
- if (RegionInfo.NonphysPrimMax > 0)
- {
- m_maxNonphys = RegionInfo.NonphysPrimMax;
- }
+ m_maxNonphys = startupConfig.GetFloat("NonphysicalPrimMax", m_maxNonphys);
+ if (RegionInfo.NonphysPrimMax > 0)
+ {
+ m_maxNonphys = RegionInfo.NonphysPrimMax;
+ }
- m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys);
+ m_maxPhys = startupConfig.GetFloat("PhysicalPrimMax", m_maxPhys);
- if (RegionInfo.PhysPrimMax > 0)
- {
- m_maxPhys = RegionInfo.PhysPrimMax;
- }
+ if (RegionInfo.PhysPrimMax > 0)
+ {
+ m_maxPhys = RegionInfo.PhysPrimMax;
+ }
- // Here, if clamping is requested in either global or
- // local config, it will be used
- //
- m_clampPrimSize = startupConfig.GetBoolean("ClampPrimSize", m_clampPrimSize);
- if (RegionInfo.ClampPrimSize)
- {
- m_clampPrimSize = true;
- }
+ // Here, if clamping is requested in either global or
+ // local config, it will be used
+ //
+ m_clampPrimSize = startupConfig.GetBoolean("ClampPrimSize", m_clampPrimSize);
+ if (RegionInfo.ClampPrimSize)
+ {
+ m_clampPrimSize = true;
+ }
- m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
- m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
- m_dontPersistBefore =
- startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
- m_dontPersistBefore *= 10000000;
- m_persistAfter =
- startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
- m_persistAfter *= 10000000;
+ m_trustBinaries = startupConfig.GetBoolean("TrustBinaries", m_trustBinaries);
+ m_allowScriptCrossings = startupConfig.GetBoolean("AllowScriptCrossing", m_allowScriptCrossings);
+ m_dontPersistBefore =
+ startupConfig.GetLong("MinimumTimeBeforePersistenceConsidered", DEFAULT_MIN_TIME_FOR_PERSISTENCE);
+ m_dontPersistBefore *= 10000000;
+ m_persistAfter =
+ startupConfig.GetLong("MaximumTimeBeforePersistenceConsidered", DEFAULT_MAX_TIME_FOR_PERSISTENCE);
+ m_persistAfter *= 10000000;
- m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
- m_log.InfoFormat("[SCENE]: Default script engine {0}", m_defaultScriptEngine);
+ m_defaultScriptEngine = startupConfig.GetString("DefaultScriptEngine", "XEngine");
+ m_log.InfoFormat("[SCENE]: Default script engine {0}", m_defaultScriptEngine);
- IConfig packetConfig = m_config.Configs["PacketPool"];
- if (packetConfig != null)
- {
- PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
- PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
- }
+ IConfig packetConfig = m_config.Configs["PacketPool"];
+ if (packetConfig != null)
+ {
+ PacketPool.Instance.RecyclePackets = packetConfig.GetBoolean("RecyclePackets", true);
+ PacketPool.Instance.RecycleDataBlocks = packetConfig.GetBoolean("RecycleDataBlocks", true);
+ }
- m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
- m_seeIntoBannedRegion = startupConfig.GetBoolean("SeeIntoBannedRegion", m_seeIntoBannedRegion);
- CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
+ m_strictAccessControl = startupConfig.GetBoolean("StrictAccessControl", m_strictAccessControl);
+ m_seeIntoBannedRegion = startupConfig.GetBoolean("SeeIntoBannedRegion", m_seeIntoBannedRegion);
+ CombineRegions = startupConfig.GetBoolean("CombineContiguousRegions", false);
- m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
- if (m_generateMaptiles)
- {
- int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
- if (maptileRefresh != 0)
+ m_generateMaptiles = startupConfig.GetBoolean("GenerateMaptiles", true);
+ if (m_generateMaptiles)
{
- m_mapGenerationTimer.Interval = maptileRefresh * 1000;
- m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
- m_mapGenerationTimer.AutoReset = true;
- m_mapGenerationTimer.Start();
+ int maptileRefresh = startupConfig.GetInt("MaptileRefresh", 0);
+ if (maptileRefresh != 0)
+ {
+ m_mapGenerationTimer.Interval = maptileRefresh * 1000;
+ m_mapGenerationTimer.Elapsed += RegenerateMaptileAndReregister;
+ m_mapGenerationTimer.AutoReset = true;
+ m_mapGenerationTimer.Start();
+ }
}
- }
- else
- {
- string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
- UUID tileID;
-
- if (UUID.TryParse(tile, out tileID))
+ else
{
- RegionInfo.RegionSettings.TerrainImageID = tileID;
+ string tile = startupConfig.GetString("MaptileStaticUUID", UUID.Zero.ToString());
+ UUID tileID;
+
+ if (UUID.TryParse(tile, out tileID))
+ {
+ RegionInfo.RegionSettings.TerrainImageID = tileID;
+ }
}
- }
- MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime);
- m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup);
- m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations);
- m_update_entitymovement = startupConfig.GetInt( "UpdateEntityMovementEveryNFrames", m_update_entitymovement);
- m_update_events = startupConfig.GetInt( "UpdateEventsEveryNFrames", m_update_events);
- m_update_objects = startupConfig.GetInt( "UpdateObjectsEveryNFrames", m_update_objects);
- m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics);
- m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
- m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
- m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
+ MinFrameTime = startupConfig.GetFloat( "MinFrameTime", MinFrameTime);
+ m_update_backup = startupConfig.GetInt( "UpdateStorageEveryNFrames", m_update_backup);
+ m_update_coarse_locations = startupConfig.GetInt( "UpdateCoarseLocationsEveryNFrames", m_update_coarse_locations);
+ m_update_entitymovement = startupConfig.GetInt( "UpdateEntityMovementEveryNFrames", m_update_entitymovement);
+ m_update_events = startupConfig.GetInt( "UpdateEventsEveryNFrames", m_update_events);
+ m_update_objects = startupConfig.GetInt( "UpdateObjectsEveryNFrames", m_update_objects);
+ m_update_physics = startupConfig.GetInt( "UpdatePhysicsEveryNFrames", m_update_physics);
+ m_update_presences = startupConfig.GetInt( "UpdateAgentsEveryNFrames", m_update_presences);
+ m_update_terrain = startupConfig.GetInt( "UpdateTerrainEveryNFrames", m_update_terrain);
+ m_update_temp_cleaning = startupConfig.GetInt( "UpdateTempCleaningEveryNFrames", m_update_temp_cleaning);
+ }
}
catch (Exception e)
{
--
cgit v1.1
From 776936268705940bfb13d10d6b6824ef20eb99cb Mon Sep 17 00:00:00 2001
From: Melanie
Date: Wed, 7 Mar 2012 01:03:26 +0000
Subject: Always zero the PhysActor on dupes to prevent side effects on the
orignal prim
---
OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 65905a0..439b718 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1546,10 +1546,7 @@ namespace OpenSim.Region.Framework.Scenes
if (userExposed)
dupe.UUID = UUID.Random();
- //memberwiseclone means it also clones the physics actor reference
- // This will make physical prim 'bounce' if not set to null.
- if (!userExposed)
- dupe.PhysActor = null;
+ dupe.PhysActor = null;
dupe.OwnerID = AgentID;
dupe.GroupID = GroupID;
--
cgit v1.1
From 749c3fef8ad2d3af97fcd9ab9c72740675e46715 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 8 Mar 2012 01:51:37 +0000
Subject: Change "help" to display categories/module list then "help
" to display commands in a category.
This is to deal with the hundred lines of command splurge when one previously typed "help"
Modelled somewhat on the mysql console
One can still type help to get per command help at any point.
Categories capitalized to avoid conflict with the all-lowercase commands (except for commander system, as of yet).
Does not affect command parsing or any other aspects of the console apart from the help system.
Backwards compatible with existing modules.
---
OpenSim/Region/Framework/Scenes/Scene.cs | 2 +-
OpenSim/Region/Framework/Scenes/SceneBase.cs | 71 +++++++++++++++++++++++++---
2 files changed, 65 insertions(+), 8 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 11e5ce3..ecadd24 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -596,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Region Settings
- MainConsole.Instance.Commands.AddCommand("region", false, "reload estate",
+ MainConsole.Instance.Commands.AddCommand("estate", false, "reload estate",
"reload estate",
"Reload the estate data", HandleReloadEstate);
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 712e094..495cede 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -472,6 +472,63 @@ namespace OpenSim.Region.Framework.Scenes
///
/// Call this from a region module to add a command to the OpenSim console.
///
+ ///
+ /// The use of IRegionModuleBase is a cheap trick to get a different method signature,
+ /// though all new modules should be using interfaces descended from IRegionModuleBase anyway.
+ ///
+ ///
+ /// Category of the command. This is the section under which it will appear when the user asks for help
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void AddCommand(
+ string category, object mod, string command, string shorthelp, string longhelp, CommandDelegate callback)
+ {
+ AddCommand(category, mod, command, shorthelp, longhelp, string.Empty, callback);
+ }
+
+ ///
+ /// Call this from a region module to add a command to the OpenSim console.
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public void AddCommand(object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
+ {
+ string moduleName = "";
+
+ if (mod != null)
+ {
+ if (mod is IRegionModule)
+ {
+ IRegionModule module = (IRegionModule)mod;
+ moduleName = module.Name;
+ }
+ else if (mod is IRegionModuleBase)
+ {
+ IRegionModuleBase module = (IRegionModuleBase)mod;
+ moduleName = module.Name;
+ }
+ else
+ {
+ throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
+ }
+ }
+
+ AddCommand(moduleName, mod, command, shorthelp, longhelp, descriptivehelp, callback);
+ }
+
+ ///
+ /// Call this from a region module to add a command to the OpenSim console.
+ ///
+ ///
+ /// Category of the command. This is the section under which it will appear when the user asks for help
+ ///
///
///
///
@@ -479,12 +536,12 @@ namespace OpenSim.Region.Framework.Scenes
///
///
public void AddCommand(
- object mod, string command, string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
+ string category, object mod, string command,
+ string shorthelp, string longhelp, string descriptivehelp, CommandDelegate callback)
{
if (MainConsole.Instance == null)
return;
- string modulename = String.Empty;
bool shared = false;
if (mod != null)
@@ -492,20 +549,20 @@ namespace OpenSim.Region.Framework.Scenes
if (mod is IRegionModule)
{
IRegionModule module = (IRegionModule)mod;
- modulename = module.Name;
shared = module.IsSharedModule;
}
else if (mod is IRegionModuleBase)
{
- IRegionModuleBase module = (IRegionModuleBase)mod;
- modulename = module.Name;
shared = mod is ISharedRegionModule;
}
- else throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
+ else
+ {
+ throw new Exception("AddCommand module parameter must be IRegionModule or IRegionModuleBase");
+ }
}
MainConsole.Instance.Commands.AddCommand(
- modulename, shared, command, shorthelp, longhelp, descriptivehelp, callback);
+ category, shared, command, shorthelp, longhelp, descriptivehelp, callback);
}
public virtual ISceneObject DeserializeObject(string representation)
--
cgit v1.1
From 650d761c06149b59148e57e90cb47dcfa8d65f6a Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Thu, 8 Mar 2012 02:17:45 +0000
Subject: Display help commander topics in capitalized form - the commands
themselves are still lowercase.
Also convert the estate commands to simply AddCommand() calls so that commands from two different modules can be placed in the same category
---
OpenSim/Region/Framework/Scenes/Scene.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index ecadd24..9e59d50 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -596,7 +596,7 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Region Settings
- MainConsole.Instance.Commands.AddCommand("estate", false, "reload estate",
+ MainConsole.Instance.Commands.AddCommand("Estates", false, "reload estate",
"reload estate",
"Reload the estate data", HandleReloadEstate);
--
cgit v1.1
From 675d40357c2ba0bf2d268cc35874dabe7dbb724d Mon Sep 17 00:00:00 2001
From: Melanie
Date: Thu, 8 Mar 2012 18:31:58 +0100
Subject: Hold a ref to the prim we're sat on rather than querying scene each
time the check for significant is carried out. Prevents a deadlock condition.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 56 ++++++++++++------------
1 file changed, 29 insertions(+), 27 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ec6bb89..9d5cdfa 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -457,15 +457,8 @@ namespace OpenSim.Region.Framework.Scenes
// without the parent rotation applied.
if (ParentID != 0)
{
- SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID);
- if (part != null)
- {
- return part.AbsolutePosition + (m_pos * part.GetWorldRotation());
- }
- else
- {
- return ParentPosition + m_pos;
- }
+ SceneObjectPart part = ParentPart;
+ return part.AbsolutePosition + (m_pos * part.GetWorldRotation());
}
}
return m_pos;
@@ -576,6 +569,13 @@ namespace OpenSim.Region.Framework.Scenes
}
private uint m_parentID;
+ public SceneObjectPart ParentPart
+ {
+ get { return m_parentPart; }
+ set { m_parentPart = value; }
+ }
+ private SceneObjectPart m_parentPart = null;
+
public float Health
{
get { return m_health; }
@@ -1751,36 +1751,34 @@ namespace OpenSim.Region.Framework.Scenes
if (ParentID != 0)
{
- SceneObjectPart part = m_scene.GetSceneObjectPart(ParentID);
- if (part != null)
+ SceneObjectPart part = ParentPart;
+ TaskInventoryDictionary taskIDict = part.TaskInventory;
+ if (taskIDict != null)
{
- TaskInventoryDictionary taskIDict = part.TaskInventory;
- if (taskIDict != null)
+ lock (taskIDict)
{
- lock (taskIDict)
+ foreach (UUID taskID in taskIDict.Keys)
{
- foreach (UUID taskID in taskIDict.Keys)
- {
- UnRegisterControlEventsToScript(LocalId, taskID);
- taskIDict[taskID].PermsMask &= ~(
- 2048 | //PERMISSION_CONTROL_CAMERA
- 4); // PERMISSION_TAKE_CONTROLS
- }
+ UnRegisterControlEventsToScript(LocalId, taskID);
+ taskIDict[taskID].PermsMask &= ~(
+ 2048 | //PERMISSION_CONTROL_CAMERA
+ 4); // PERMISSION_TAKE_CONTROLS
}
}
+ }
- // Reset sit target.
- if (part.SitTargetAvatar == UUID)
- part.SitTargetAvatar = UUID.Zero;
+ // Reset sit target.
+ if (part.SitTargetAvatar == UUID)
+ part.SitTargetAvatar = UUID.Zero;
- ParentPosition = part.GetWorldPosition();
- ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
- }
+ ParentPosition = part.GetWorldPosition();
+ ControllingClient.SendClearFollowCamProperties(part.ParentUUID);
m_pos += ParentPosition + new Vector3(0.0f, 0.0f, 2.0f * m_sitAvatarHeight);
ParentPosition = Vector3.Zero;
ParentID = 0;
+ ParentPart = null;
SendAvatarDataToAllAgents();
m_requestedSitTargetID = 0;
@@ -2212,6 +2210,10 @@ namespace OpenSim.Region.Framework.Scenes
return;
}
+ ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
+ if (ParentPart == null)
+ return;
+
ParentID = m_requestedSitTargetID;
Velocity = Vector3.Zero;
--
cgit v1.1
From 73c47f720583da40496d5c8fe94f35ed0aec640f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Mar 2012 02:22:22 +0000
Subject: Remove a race condition from SP.Set_AbsolutePosition where we assume
the ParentPart is still not null if the ParentID != 0
Another thread could come in and stand the avatar between those two instructions.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9d5cdfa..be56fe1 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -455,12 +455,12 @@ namespace OpenSim.Region.Framework.Scenes
// in the sim unless the avatar is on a sit target. While
// on a sit target, m_pos will contain the desired offset
// without the parent rotation applied.
- if (ParentID != 0)
- {
- SceneObjectPart part = ParentPart;
- return part.AbsolutePosition + (m_pos * part.GetWorldRotation());
- }
+ SceneObjectPart sitPart = ParentPart;
+
+ if (sitPart != null)
+ return sitPart.AbsolutePosition + (m_pos * sitPart.GetWorldRotation());
}
+
return m_pos;
}
set
--
cgit v1.1
From b454326273a03420addf4d73d308f0ca773558ad Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Mar 2012 02:33:48 +0000
Subject: refactor: cleanup SP.HandleAgentSit so that everything is done within
one if (part != null), rather than having unnecessary multiple checks
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 23 ++++++++---------------
1 file changed, 8 insertions(+), 15 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index be56fe1..c9dc7fd 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2204,23 +2204,16 @@ namespace OpenSim.Region.Framework.Scenes
// "[SCENE PRESENCE]: Sitting {0} at position {1} ({2} + {3}) on part {4} {5} without sit target",
// Name, part.AbsolutePosition, m_pos, ParentPosition, part.Name, part.LocalId);
}
- }
- else
- {
- return;
- }
-
- ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
- if (ParentPart == null)
- return;
- ParentID = m_requestedSitTargetID;
+ ParentPart = m_scene.GetSceneObjectPart(m_requestedSitTargetID);
+ ParentID = m_requestedSitTargetID;
- Velocity = Vector3.Zero;
- RemoveFromPhysicalScene();
-
- Animator.TrySetMovementAnimation(sitAnimation);
- SendAvatarDataToAllAgents();
+ Velocity = Vector3.Zero;
+ RemoveFromPhysicalScene();
+
+ Animator.TrySetMovementAnimation(sitAnimation);
+ SendAvatarDataToAllAgents();
+ }
}
public void HandleAgentSitOnGround()
--
cgit v1.1
From 94e58ff6b9368975925cea4697077a8e59162bc0 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Mar 2012 02:38:11 +0000
Subject: Use SP.ParentPart instead of ParentID in places where it's more
efficient (saving extra null checks, etc.)
However, it looks like we should retain SP.ParentID since it's much easier to use that in places where another thread could change ParentPart to null.
Otherwise one has to clumsily put ParentPart in a reference, etc. to avoid a race.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 24 +++++-----------------
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 26 ++++++++++++------------
2 files changed, 18 insertions(+), 32 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 66fb493..dd0ca43 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -215,27 +215,13 @@ namespace OpenSim.Region.Framework.Scenes
if (sp.IsChildAgent)
continue;
- if (sp.ParentID != 0)
- {
- // sitting avatar
- SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
- if (sop != null)
- {
- coarseLocations.Add(sop.AbsolutePosition + sp.OffsetPosition);
- avatarUUIDs.Add(sp.UUID);
- }
- else
- {
- // we can't find the parent.. ! arg!
- coarseLocations.Add(sp.AbsolutePosition);
- avatarUUIDs.Add(sp.UUID);
- }
- }
+ SceneObjectPart sitPart = sp.ParentPart;
+ if (sitPart != null)
+ coarseLocations.Add(sitPart.AbsolutePosition + sp.OffsetPosition);
else
- {
coarseLocations.Add(sp.AbsolutePosition);
- avatarUUIDs.Add(sp.UUID);
- }
+
+ avatarUUIDs.Add(sp.UUID);
}
}
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index c9dc7fd..aab0bf0 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
- if (PhysicsActor != null && m_parentID == 0)
+ if (PhysicsActor != null && ParentID == 0)
{
m_pos = PhysicsActor.Position;
@@ -504,6 +504,7 @@ namespace OpenSim.Region.Framework.Scenes
// There is no offset position when not seated
if (ParentID == 0)
return;
+
m_pos = value;
}
}
@@ -562,19 +563,18 @@ namespace OpenSim.Region.Framework.Scenes
public bool IsChildAgent { get; set; }
- public uint ParentID
- {
- get { return m_parentID; }
- set { m_parentID = value; }
- }
- private uint m_parentID;
+ ///
+ /// If the avatar is sitting, the local ID of the prim that it's sitting on. If not sitting then zero.
+ ///
+ public uint ParentID { get; set; }
- public SceneObjectPart ParentPart
- {
- get { return m_parentPart; }
- set { m_parentPart = value; }
- }
- private SceneObjectPart m_parentPart = null;
+ ///
+ /// If the avatar is sitting, the prim that it's sitting on. If not sitting then null.
+ ///
+ ///
+ /// If you use this property then you must take a reference since another thread could set it to null.
+ ///
+ public SceneObjectPart ParentPart { get; set; }
public float Health
{
--
cgit v1.1
From 205c36d3a4bb6fe0aca5027e8e7e36fc57c6de1c Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Mar 2012 02:44:08 +0000
Subject: Get rid of unnecessary ParentID == 0 check on SP.Get_AbsolutePosition
since this is handled by the necessary ParentPart check
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index aab0bf0..b84660a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -432,7 +432,7 @@ namespace OpenSim.Region.Framework.Scenes
{
get
{
- if (PhysicsActor != null && ParentID == 0)
+ if (PhysicsActor != null)
{
m_pos = PhysicsActor.Position;
@@ -477,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes
}
}
- // Don't update while sitting
+ // Don't update while sitting. The PhysicsActor above is null whilst sitting.
if (ParentID == 0)
{
m_pos = value;
--
cgit v1.1
From 06dda14505743bde237362b0e469d16548922f33 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 9 Mar 2012 02:50:57 +0000
Subject: Simplify minimap coarse location code by just reference
SP.AbsolutePosition
This is rather than checking whether the avatar is sitting and doing its own calculation.
---
OpenSim/Region/Framework/Scenes/SceneGraph.cs | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework')
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index dd0ca43..bc3400a 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -215,11 +215,7 @@ namespace OpenSim.Region.Framework.Scenes
if (sp.IsChildAgent)
continue;
- SceneObjectPart sitPart = sp.ParentPart;
- if (sitPart != null)
- coarseLocations.Add(sitPart.AbsolutePosition + sp.OffsetPosition);
- else
- coarseLocations.Add(sp.AbsolutePosition);
+ coarseLocations.Add(sp.AbsolutePosition);
avatarUUIDs.Add(sp.UUID);
}
--
cgit v1.1