aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authordiva2009-06-14 15:35:09 +0000
committerdiva2009-06-14 15:35:09 +0000
commit7a9c85526cb99495bdd436150679941ef021b782 (patch)
tree888b5bdf86f8327d2df0c1ca8f1cd3dd999d125d /OpenSim/Region/Framework
parent* Temporarily resolve another problem in http://opensimulator.org/mantis/view... (diff)
downloadopensim-SC_OLD-7a9c85526cb99495bdd436150679941ef021b782.zip
opensim-SC_OLD-7a9c85526cb99495bdd436150679941ef021b782.tar.gz
opensim-SC_OLD-7a9c85526cb99495bdd436150679941ef021b782.tar.bz2
opensim-SC_OLD-7a9c85526cb99495bdd436150679941ef021b782.tar.xz
Pulled out HelloNeighbour into its own service, INeighbourService, which may get more functions as we go along. It's a very simple service and service connectors, and it served primarily to establish the design of services that dependent on Scenes and that must always have a local connector. More refactoring coming, as this showed how to do it right.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IInterregionComms.cs5
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs16
3 files changed, 12 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs
index d239ef4..8f4d3d5 100644
--- a/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs
+++ b/OpenSim/Region/Framework/Interfaces/IInterregionComms.cs
@@ -100,11 +100,6 @@ namespace OpenSim.Region.Framework.Interfaces
100 100
101 #endregion Objects 101 #endregion Objects
102 102
103 #region Regions
104
105 bool SendHelloNeighbour(ulong regionHandle, RegionInfo thisRegion);
106
107 #endregion Regions
108 } 103 }
109 104
110 // This may not be needed, but having it here for now. 105 // This may not be needed, but having it here for now.
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 5349d87..d3437b9 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1198,7 +1198,7 @@ namespace OpenSim.Region.Framework.Scenes
1198 1198
1199 // These two 'commands' *must be* next to each other or sim rebooting fails. 1199 // These two 'commands' *must be* next to each other or sim rebooting fails.
1200 m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo); 1200 m_sceneGridService.RegisterRegion(m_interregionCommsOut, RegionInfo);
1201 m_sceneGridService.InformNeighborsThatRegionisUp(RegionInfo); 1201 m_sceneGridService.InformNeighborsThatRegionisUp(RequestModuleInterface<INeighbourService>(), RegionInfo);
1202 1202
1203 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings(); 1203 Dictionary<string, string> dGridSettings = m_sceneGridService.GetGridSettings();
1204 1204
diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
index 8cc5cd8..833f804 100644
--- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
@@ -39,6 +39,7 @@ using OpenSim.Framework.Communications;
39using OpenSim.Framework.Communications.Cache; 39using OpenSim.Framework.Communications.Cache;
40using OpenSim.Framework.Communications.Capabilities; 40using OpenSim.Framework.Communications.Capabilities;
41using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Services.Interfaces;
42using OSD = OpenMetaverse.StructuredData.OSD; 43using OSD = OpenMetaverse.StructuredData.OSD;
43 44
44namespace OpenSim.Region.Framework.Scenes 45namespace OpenSim.Region.Framework.Scenes
@@ -485,7 +486,7 @@ namespace OpenSim.Region.Framework.Scenes
485 486
486 #endregion 487 #endregion
487 488
488 public delegate void InformNeighbourThatRegionUpDelegate(RegionInfo region, ulong regionhandle); 489 public delegate void InformNeighbourThatRegionUpDelegate(INeighbourService nService, RegionInfo region, ulong regionhandle);
489 490
490 private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar) 491 private void InformNeighborsThatRegionisUpCompleted(IAsyncResult iar)
491 { 492 {
@@ -498,7 +499,7 @@ namespace OpenSim.Region.Framework.Scenes
498 /// </summary> 499 /// </summary>
499 /// <param name="region"></param> 500 /// <param name="region"></param>
500 /// <param name="regionhandle"></param> 501 /// <param name="regionhandle"></param>
501 private void InformNeighboursThatRegionIsUpAsync(RegionInfo region, ulong regionhandle) 502 private void InformNeighboursThatRegionIsUpAsync(INeighbourService neighbourService, RegionInfo region, ulong regionhandle)
502 { 503 {
503 m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here"); 504 m_log.Info("[INTERGRID]: Starting to inform neighbors that I'm here");
504 //RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port); 505 //RegionUpData regiondata = new RegionUpData(region.RegionLocX, region.RegionLocY, region.ExternalHostName, region.InternalEndPoint.Port);
@@ -506,7 +507,12 @@ namespace OpenSim.Region.Framework.Scenes
506 //bool regionAccepted = 507 //bool regionAccepted =
507 // m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region), regionhandle); 508 // m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region), regionhandle);
508 509
509 bool regionAccepted = m_interregionCommsOut.SendHelloNeighbour(regionhandle, region); 510 //bool regionAccepted = m_interregionCommsOut.SendHelloNeighbour(regionhandle, region);
511 bool regionAccepted = false;
512 if (neighbourService != null)
513 regionAccepted = neighbourService.HelloNeighbour(regionhandle, region);
514 else
515 m_log.DebugFormat("[SCS]: No neighbour service provided for informing neigbhours of this region");
510 516
511 if (regionAccepted) 517 if (regionAccepted)
512 { 518 {
@@ -527,7 +533,7 @@ namespace OpenSim.Region.Framework.Scenes
527 /// Called by scene when region is initialized (not always when it's listening for agents) 533 /// Called by scene when region is initialized (not always when it's listening for agents)
528 /// This is an inter-region message that informs the surrounding neighbors that the sim is up. 534 /// This is an inter-region message that informs the surrounding neighbors that the sim is up.
529 /// </summary> 535 /// </summary>
530 public void InformNeighborsThatRegionisUp(RegionInfo region) 536 public void InformNeighborsThatRegionisUp(INeighbourService neighbourService, RegionInfo region)
531 { 537 {
532 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName); 538 //m_log.Info("[INTER]: " + debugRegionName + ": SceneCommunicationService: Sending InterRegion Notification that region is up " + region.RegionName);
533 539
@@ -541,7 +547,7 @@ namespace OpenSim.Region.Framework.Scenes
541 { 547 {
542 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync; 548 InformNeighbourThatRegionUpDelegate d = InformNeighboursThatRegionIsUpAsync;
543 549
544 d.BeginInvoke(region, neighbours[i].RegionHandle, 550 d.BeginInvoke(neighbourService, region, neighbours[i].RegionHandle,
545 InformNeighborsThatRegionisUpCompleted, 551 InformNeighborsThatRegionisUpCompleted,
546 d); 552 d);
547 } 553 }