From 4738fead21f9d02c23702613fd1e1eec1d1a75a1 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 29 Nov 2007 07:25:58 +0000 Subject: * 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. --- OpenSim/Region/Environment/Scenes/Scene.cs | 54 +++++++++++----------- .../Scenes/SceneCommunicationService.cs | 6 ++- 2 files changed, 32 insertions(+), 28 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index a52e636..9ea92b0 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -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 - { - - 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) + if (!(m_regionRestartNotifyList.Contains(otherRegion))) { - // 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(); diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs index 905764d..0923010 100644 --- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs @@ -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 neighbours = m_commsProvider.GridService.RequestNeighbours(m_regionInfo.RegionLocX, m_regionInfo.RegionLocY); + + List neighbours = new List(); + + 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)); } -- cgit v1.1