From 47252214354cb768ecddb50062d650d22f7d1c4f Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Feb 2011 20:54:00 +0000
Subject: Stop the avatar sometimes pausing for more than a second on the
border when region crossing.
This restores a RemoveFromPhysicalScene() call in ScenePresence.CheckForBorderCrossing() when the agent has been placed in transit.
If we don't remove the agent from the physical scene, then the method continues to be called via ScenePresence.Update()
until the handover of the client between regions is completed. Since this handover can take more than 1000ms (due to the 1000ms
event queue polling response from the server), this results in the avatar pausing on the border for the entire handover period.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 7 +++++++
1 file changed, 7 insertions(+)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index cd70de8..4150f4a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2776,6 +2776,13 @@ namespace OpenSim.Region.Framework.Scenes
}
else
{
+ // We must remove the agent from the physical scene if it has been placed in transit. If we don't,
+ // then this method continues to be called from ScenePresence.Update() until the handover of the client between
+ // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms
+ // event queue polling response from the server), this results in the avatar pausing on the border
+ // for the handover period.
+ RemoveFromPhysicalScene();
+
// This constant has been inferred from experimentation
// I'm not sure what this value should be, so I tried a few values.
timeStep = 0.04f;
--
cgit v1.1
From e774679f62dc0de54c1926b1b4a611ca317d2bd7 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Feb 2011 21:19:16 +0000
Subject: minor: add method doc to a few ScenePresence methods
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 4150f4a..b47ec3c 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2652,8 +2652,11 @@ namespace OpenSim.Region.Framework.Scenes
#region Border Crossing Methods
///
- /// Checks to see if the avatar is in range of a border and calls CrossToNewRegion
+ /// Starts the process of moving an avatar into another region if they are crossing the border.
///
+ ///
+ /// Also removes the avatar from the physical scene if transit has started.
+ ///
protected void CheckForBorderCrossing()
{
if (IsChildAgent)
@@ -2721,7 +2724,6 @@ namespace OpenSim.Region.Framework.Scenes
neighbor = HaveNeighbor(Cardinals.N, ref fix);
}
-
// Makes sure avatar does not end up outside region
if (neighbor <= 0)
{
@@ -2794,6 +2796,15 @@ namespace OpenSim.Region.Framework.Scenes
}
}
+ ///
+ /// Checks whether this region has a neighbour in the given direction.
+ ///
+ ///
+ ///
+ ///
+ /// An integer which represents a compass point. N == 1, going clockwise until we reach NW == 8.
+ /// Returns a positive integer if there is a region in that direction, a negative integer if not.
+ ///
protected int HaveNeighbor(Cardinals car, ref int[] fix)
{
uint neighbourx = m_regionInfo.RegionLocX;
--
cgit v1.1
From dd9efc183812a66b1654aaeb419945cf57650b08 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 18 Feb 2011 23:05:56 +0000
Subject: extend TestChildAgentEstablished() test slightly to put in
EntityTransferModule. Not yet enabled.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b47ec3c..51b8dcc 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1161,7 +1161,9 @@ namespace OpenSim.Region.Framework.Scenes
if (m_agentTransfer != null)
m_agentTransfer.EnableChildAgents(this);
else
- m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active");
+ m_log.DebugFormat(
+ "[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active for region {0}",
+ m_scene.RegionInfo.RegionName);
IFriendsModule friendsModule = m_scene.RequestModuleInterface();
if (friendsModule != null)
--
cgit v1.1
From 5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d Mon Sep 17 00:00:00 2001
From: Mic Bowman
Date: Tue, 22 Feb 2011 13:23:54 -0800
Subject: Parameterizes the view distance used to compute and manage child
agents in neighbor regions. This means you can extend the view on a simulator
beyond the default 3x3 regions.
This uses a region default draw distance and should be
replaced at some point by the avatar specified draw distance.
That will require more careful, dynamic recomputation of child
agents every time the draw distance changes.
WARNING: this is experimental and has known instabilities. specifically
all regions "within site" should be running the same default draw distance
or agents will not be closed correctly.
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 51b8dcc..9e9481e 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -626,7 +626,7 @@ namespace OpenSim.Region.Framework.Scenes
Utils.LongToUInts(handle, out x, out y);
x = x / Constants.RegionSize;
y = y / Constants.RegionSize;
- if (Util.IsOutsideView(x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY))
+ if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY))
{
old.Add(handle);
}
@@ -700,6 +700,7 @@ namespace OpenSim.Region.Framework.Scenes
private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this()
{
+ m_DrawDistance = world.DefaultDrawDistance;
m_rootRegionHandle = reginfo.RegionHandle;
m_controllingClient = client;
m_firstname = m_controllingClient.FirstName;
@@ -1279,7 +1280,11 @@ namespace OpenSim.Region.Framework.Scenes
m_CameraUpAxis = agentData.CameraUpAxis;
// The Agent's Draw distance setting
- m_DrawDistance = agentData.Far;
+ // When we get to the point of re-computing neighbors everytime this
+ // changes, then start using the agent's drawdistance rather than the
+ // region's draw distance.
+ // m_DrawDistance = agentData.Far;
+ m_DrawDistance = Scene.DefaultDrawDistance;
// Check if Client has camera in 'follow cam' or 'build' mode.
Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation);
@@ -2913,7 +2918,7 @@ namespace OpenSim.Region.Framework.Scenes
//m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX)));
//m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY)));
- if (Util.IsOutsideView(x, newRegionX, y, newRegionY))
+ if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY))
{
byebyeRegions.Add(handle);
}
@@ -2989,7 +2994,12 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 offset = new Vector3(shiftx, shifty, 0f);
- m_DrawDistance = cAgentData.Far;
+ // When we get to the point of re-computing neighbors everytime this
+ // changes, then start using the agent's drawdistance rather than the
+ // region's draw distance.
+ // m_DrawDistance = cAgentData.Far;
+ m_DrawDistance = Scene.DefaultDrawDistance;
+
if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!!
m_pos = cAgentData.Position + offset;
@@ -3139,7 +3149,11 @@ namespace OpenSim.Region.Framework.Scenes
m_CameraLeftAxis = cAgent.LeftAxis;
m_CameraUpAxis = cAgent.UpAxis;
- m_DrawDistance = cAgent.Far;
+ // When we get to the point of re-computing neighbors everytime this
+ // changes, then start using the agent's drawdistance rather than the
+ // region's draw distance.
+ // m_DrawDistance = cAgent.Far;
+ m_DrawDistance = Scene.DefaultDrawDistance;
if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
ControllingClient.SetChildAgentThrottle(cAgent.Throttles);
--
cgit v1.1
From 2b04cab1ee4b7c89bdfbe93622f421f031879943 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Fri, 25 Feb 2011 02:15:06 +0000
Subject: change some log messages from info to debug
---
OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
(limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 9e9481e..00a1487 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -2442,7 +2442,7 @@ namespace OpenSim.Region.Framework.Scenes
// If we are using the the cached appearance then send it out to everyone
if (cachedappearance)
{
- m_log.InfoFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
+ m_log.DebugFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
// If the avatars baked textures are all in the cache, then we have a
// complete appearance... send it out, if not, then we'll send it when
--
cgit v1.1