From eac9bc68890cff90c9be45fe8ddfd3ea5f4fade2 Mon Sep 17 00:00:00 2001
From: Teravus Ovares
Date: Mon, 10 Dec 2007 19:16:50 +0000
Subject: * More refactoring to prepare for draw distance based agent sim
notification.
---
OpenSim/Region/Environment/Scenes/Scene.cs | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
(limited to 'OpenSim/Region/Environment/Scenes/Scene.cs')
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index 01bcd83..587d940 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -269,7 +269,12 @@ namespace OpenSim.Region.Environment.Scenes
{
// Another region is up.
// We have to tell all our ScenePresences about it..
- //and add it to the neighbor list.
+ // and add it to the neighbor list.
+
+ // We only add it to the neighbor list if it's within 1 region from here.
+ // Agents may have draw distance values that cross two regions though, so
+ // we add it to the notify list regardless of distance.
+ // We'll check the agent's draw distance before notifying them though.
if (RegionInfo.RegionHandle != otherRegion.RegionHandle)
@@ -297,12 +302,11 @@ namespace OpenSim.Region.Environment.Scenes
{
m_neighbours.Add(otherRegion);
}
-
if (!(m_regionRestartNotifyList.Contains(otherRegion)))
{
m_regionRestartNotifyList.Add(otherRegion);
-
- m_restartWaitTimer.Interval= 50000;
+
+ m_restartWaitTimer.Interval = 50000;
m_restartWaitTimer.AutoReset = false;
m_restartWaitTimer.Elapsed += new ElapsedEventHandler(RestartNotifyWaitElapsed);
m_restartWaitTimer.Start();
@@ -312,6 +316,9 @@ namespace OpenSim.Region.Environment.Scenes
{
MainLog.Instance.Verbose("INTERGRID", "Got notice about Region at X:" + otherRegion.RegionLocX.ToString() + " Y:" + otherRegion.RegionLocY.ToString() + " but it was too far away to send to the client");
}
+
+
+
}
return true;
@@ -1250,7 +1257,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void InformClientOfNeighbours(ScenePresence presence)
{
- m_sceneGridService.EnableNeighbourChildAgents(presence);
+ m_sceneGridService.EnableNeighbourChildAgents(presence, m_neighbours);
}
///
@@ -1260,7 +1267,7 @@ namespace OpenSim.Region.Environment.Scenes
///
public void InformClientOfNeighbor(ScenePresence presence, RegionInfo region)
{
- m_sceneGridService.InformNeighborChildAgent(presence, region);
+ m_sceneGridService.InformNeighborChildAgent(presence, region, m_neighbours);
}
///
--
cgit v1.1