* Added a 50 second restart notify timer that gets reset when new regions come up to give servers that host a lot of sims a long time to start listening.

afrisby
Teravus Ovares 2007-11-29 07:25:58 +00:00
parent 6d7ce67db1
commit 4738fead21
2 changed files with 32 additions and 28 deletions

View File

@ -279,39 +279,21 @@ namespace OpenSim.Region.Environment.Scenes
{
if (Math.Abs(otherRegion.RegionLocX - RegionInfo.RegionLocX) <= 1 || Math.Abs(otherRegion.RegionLocY - RegionInfo.RegionLocY) <= 1)
{
try
if (!(m_regionRestartNotifyList.Contains(otherRegion)))
{
ForEachScenePresence(delegate(ScenePresence agent)
{
if (!(agent.IsChildAgent))
{
//agent.ControllingClient.new
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
InformClientOfNeighbor(agent, otherRegion);
}
}
);
}
catch (System.NullReferenceException)
{
// This means that we're not booted up completely yet.
m_regionRestartNotifyList.Add(otherRegion);
m_restartWaitTimer.Interval= 50000;
m_restartWaitTimer.AutoReset = false;
m_restartWaitTimer.Elapsed += new ElapsedEventHandler(restart_Notify_Wait_Elapsed);
m_restartWaitTimer.Start();
}
}
else
{
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");
}
//if (!(m_regionRestartNotifyList.Contains(otherRegion)))
//{
//m_regionRestartNotifyList.Add(otherRegion);
//m_restartWaitTimer = new Timer(20000);
//m_restartWaitTimer.AutoReset = false;
// m_restartWaitTimer.Elapsed += new ElapsedEventHandler(restart_Notify_Wait_Elapsed);
//m_restartWaitTimer.Start();
//}
}
return true;
}
@ -368,7 +350,25 @@ namespace OpenSim.Region.Environment.Scenes
m_restartWaitTimer.Stop();
foreach (RegionInfo region in m_regionRestartNotifyList)
{
try
{
ForEachScenePresence(delegate(ScenePresence agent)
{
if (!(agent.IsChildAgent))
{
//agent.ControllingClient.new
//this.CommsManager.InterRegion.InformRegionOfChildAgent(otherRegion.RegionHandle, agent.ControllingClient.RequestClientInfo());
InformClientOfNeighbor(agent, region);
}
}
);
}
catch (System.NullReferenceException)
{
// This means that we're not booted up completely yet.
}
}
// Reset list to nothing.
m_regionRestartNotifyList = new List<RegionInfo>();

View File

@ -251,7 +251,10 @@ namespace OpenSim.Region.Environment.Scenes
{
//MainLog.Instance.Verbose("INTER", debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
List<SimpleRegionInfo> neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
List<SimpleRegionInfo> neighbours = new List<SimpleRegionInfo>();
neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY);
if (neighbours != null)
{
for (int i = 0; i < neighbours.Count; i++)
@ -264,6 +267,7 @@ namespace OpenSim.Region.Environment.Scenes
d);
}
}
//bool val = m_commsProvider.InterRegion.RegionUp(new SearializableRegionInfo(region));
}