aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorDiva Canto2009-09-28 17:33:34 -0700
committerDiva Canto2009-09-28 17:33:34 -0700
commit4eca59ec13bb48309120fea24890341c65157c65 (patch)
tree339df84cb98625c274fe03ef17bb4a5e808e379b /OpenSim/Region/CoreModules
parentReorder prebuild stuff to make panda eat bamboo in peace (diff)
downloadopensim-SC_OLD-4eca59ec13bb48309120fea24890341c65157c65.zip
opensim-SC_OLD-4eca59ec13bb48309120fea24890341c65157c65.tar.gz
opensim-SC_OLD-4eca59ec13bb48309120fea24890341c65157c65.tar.bz2
opensim-SC_OLD-4eca59ec13bb48309120fea24890341c65157c65.tar.xz
Improved the Local grid connector to fetch data from the DB when it doesn't find it in the cache.
Commented out the Standalone teleport test because it's failing, and the scene setup is very confusing. I suspect it may be wrong -- the connectors-as-ISharedRegionModules are being instantiated several times when there are several scenes.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs7
-rw-r--r--OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs10
2 files changed, 15 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
index 6c2928a..3ca4882 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs
@@ -149,7 +149,6 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
149 m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!"); 149 m_log.ErrorFormat("[LOCAL GRID CONNECTOR]: simulator seems to have more than one region with the same UUID. Please correct this!");
150 else 150 else
151 m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene)); 151 m_LocalCache.Add(scene.RegionInfo.RegionID, new RegionCache(scene));
152
153 } 152 }
154 } 153 }
155 154
@@ -184,7 +183,11 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
184 { 183 {
185 if (m_LocalCache.ContainsKey(regionID)) 184 if (m_LocalCache.ContainsKey(regionID))
186 { 185 {
187 return m_LocalCache[regionID].GetNeighbours(); 186 List<GridRegion> neighbours = m_LocalCache[regionID].GetNeighbours();
187 if (neighbours.Count == 0)
188 // try the DB
189 neighbours = m_GridService.GetNeighbours(scopeID, regionID);
190 return neighbours;
188 } 191 }
189 else 192 else
190 { 193 {
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
index be32d6b..2ca90f8 100644
--- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
+++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/Tests/GridConnectorsTests.cs
@@ -78,6 +78,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
78 r1.ExternalHostName = "127.0.0.1"; 78 r1.ExternalHostName = "127.0.0.1";
79 r1.HttpPort = 9001; 79 r1.HttpPort = 9001;
80 r1.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); 80 r1.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
81 Scene s = new Scene(new RegionInfo());
82 s.RegionInfo.RegionID = r1.RegionID;
83 m_LocalConnector.AddRegion(s);
84
81 85
82 GridRegion r2 = new GridRegion(); 86 GridRegion r2 = new GridRegion();
83 r2.RegionName = "Test Region 2"; 87 r2.RegionName = "Test Region 2";
@@ -87,6 +91,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
87 r2.ExternalHostName = "127.0.0.1"; 91 r2.ExternalHostName = "127.0.0.1";
88 r2.HttpPort = 9002; 92 r2.HttpPort = 9002;
89 r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); 93 r2.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
94 s = new Scene(new RegionInfo());
95 s.RegionInfo.RegionID = r1.RegionID;
96 m_LocalConnector.AddRegion(s);
90 97
91 GridRegion r3 = new GridRegion(); 98 GridRegion r3 = new GridRegion();
92 r3.RegionName = "Test Region 3"; 99 r3.RegionName = "Test Region 3";
@@ -96,6 +103,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
96 r3.ExternalHostName = "127.0.0.1"; 103 r3.ExternalHostName = "127.0.0.1";
97 r3.HttpPort = 9003; 104 r3.HttpPort = 9003;
98 r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0); 105 r3.InternalEndPoint = new System.Net.IPEndPoint(System.Net.IPAddress.Parse("0.0.0.0"), 0);
106 s = new Scene(new RegionInfo());
107 s.RegionInfo.RegionID = r1.RegionID;
108 m_LocalConnector.AddRegion(s);
99 109
100 m_LocalConnector.RegisterRegion(UUID.Zero, r1); 110 m_LocalConnector.RegisterRegion(UUID.Zero, r1);
101 GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test"); 111 GridRegion result = m_LocalConnector.GetRegionByName(UUID.Zero, "Test");