diff options
author | Justin Clark-Casey (justincc) | 2011-02-18 23:25:59 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-02-18 23:25:59 +0000 |
commit | 8249d77991352697b4972f7109c014db0ebd5f68 (patch) | |
tree | 1ca71e15f18db4a2bc7e1a2204ae002e961b8306 | |
parent | minor: remove mono compiler warning (diff) | |
download | opensim-SC-8249d77991352697b4972f7109c014db0ebd5f68.zip opensim-SC-8249d77991352697b4972f7109c014db0ebd5f68.tar.gz opensim-SC-8249d77991352697b4972f7109c014db0ebd5f68.tar.bz2 opensim-SC-8249d77991352697b4972f7109c014db0ebd5f68.tar.xz |
If GridService.GetNeighbours() could not find the region then log a warning rather than causing a null reference on the normal log line
This also extends the TestChildAgentEstablished() test to actually activate the EntityTransferModule, though the test is not yet viable
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | 7 | ||||
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 12 |
2 files changed, 16 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs index 60bc86c..5e1ff79 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceTests.cs | |||
@@ -201,15 +201,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
201 | public void TestChildAgentEstablished() | 201 | public void TestChildAgentEstablished() |
202 | { | 202 | { |
203 | TestHelper.InMethod(); | 203 | TestHelper.InMethod(); |
204 | log4net.Config.XmlConfigurator.Configure(); | 204 | // log4net.Config.XmlConfigurator.Configure(); |
205 | 205 | ||
206 | UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); | 206 | UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001"); |
207 | 207 | ||
208 | TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); | 208 | TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000); |
209 | TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); | 209 | TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000); |
210 | 210 | ||
211 | IConfigSource configSource = new IniConfigSource(); | ||
212 | configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule"); | ||
211 | EntityTransferModule etm = new EntityTransferModule(); | 213 | EntityTransferModule etm = new EntityTransferModule(); |
212 | SceneSetupHelpers.SetupSceneModules(myScene1, etm); | 214 | |
215 | SceneSetupHelpers.SetupSceneModules(myScene1, configSource, etm); | ||
213 | 216 | ||
214 | SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); | 217 | SceneSetupHelpers.AddRootAgent(myScene1, agent1Id); |
215 | ScenePresence childPresence = myScene2.GetScenePresence(agent1); | 218 | ScenePresence childPresence = myScene2.GetScenePresence(agent1); |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index aeff9b5..985d77b 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -271,6 +271,7 @@ namespace OpenSim.Services.GridService | |||
271 | { | 271 | { |
272 | List<GridRegion> rinfos = new List<GridRegion>(); | 272 | List<GridRegion> rinfos = new List<GridRegion>(); |
273 | RegionData region = m_Database.Get(regionID, scopeID); | 273 | RegionData region = m_Database.Get(regionID, scopeID); |
274 | |||
274 | if (region != null) | 275 | if (region != null) |
275 | { | 276 | { |
276 | // Not really? Maybe? | 277 | // Not really? Maybe? |
@@ -278,15 +279,24 @@ namespace OpenSim.Services.GridService | |||
278 | region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID); | 279 | region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID); |
279 | 280 | ||
280 | foreach (RegionData rdata in rdatas) | 281 | foreach (RegionData rdata in rdatas) |
282 | { | ||
281 | if (rdata.RegionID != regionID) | 283 | if (rdata.RegionID != regionID) |
282 | { | 284 | { |
283 | int flags = Convert.ToInt32(rdata.Data["flags"]); | 285 | int flags = Convert.ToInt32(rdata.Data["flags"]); |
284 | if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours | 286 | if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours |
285 | rinfos.Add(RegionData2RegionInfo(rdata)); | 287 | rinfos.Add(RegionData2RegionInfo(rdata)); |
286 | } | 288 | } |
289 | } | ||
287 | 290 | ||
291 | m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count); | ||
288 | } | 292 | } |
289 | m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count); | 293 | else |
294 | { | ||
295 | m_log.WarnFormat( | ||
296 | "[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found", | ||
297 | scopeID, regionID); | ||
298 | } | ||
299 | |||
290 | return rinfos; | 300 | return rinfos; |
291 | } | 301 | } |
292 | 302 | ||