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 viable0.7.1-dev
parent
5c92f62941
commit
8249d77991
|
@ -201,15 +201,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||||
public void TestChildAgentEstablished()
|
public void TestChildAgentEstablished()
|
||||||
{
|
{
|
||||||
TestHelper.InMethod();
|
TestHelper.InMethod();
|
||||||
log4net.Config.XmlConfigurator.Configure();
|
// log4net.Config.XmlConfigurator.Configure();
|
||||||
|
|
||||||
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
UUID agent1Id = UUID.Parse("00000000-0000-0000-0000-000000000001");
|
||||||
|
|
||||||
TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
TestScene myScene1 = SceneSetupHelpers.SetupScene("Neighbour y", UUID.Random(), 1000, 1000);
|
||||||
TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
TestScene myScene2 = SceneSetupHelpers.SetupScene("Neighbour y + 1", UUID.Random(), 1001, 1000);
|
||||||
|
|
||||||
|
IConfigSource configSource = new IniConfigSource();
|
||||||
|
configSource.AddConfig("Modules").Set("EntityTransferModule", "BasicEntityTransferModule");
|
||||||
EntityTransferModule etm = new EntityTransferModule();
|
EntityTransferModule etm = new EntityTransferModule();
|
||||||
SceneSetupHelpers.SetupSceneModules(myScene1, etm);
|
|
||||||
|
SceneSetupHelpers.SetupSceneModules(myScene1, configSource, etm);
|
||||||
|
|
||||||
SceneSetupHelpers.AddRootAgent(myScene1, agent1Id);
|
SceneSetupHelpers.AddRootAgent(myScene1, agent1Id);
|
||||||
ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
ScenePresence childPresence = myScene2.GetScenePresence(agent1);
|
||||||
|
|
|
@ -271,6 +271,7 @@ namespace OpenSim.Services.GridService
|
||||||
{
|
{
|
||||||
List<GridRegion> rinfos = new List<GridRegion>();
|
List<GridRegion> rinfos = new List<GridRegion>();
|
||||||
RegionData region = m_Database.Get(regionID, scopeID);
|
RegionData region = m_Database.Get(regionID, scopeID);
|
||||||
|
|
||||||
if (region != null)
|
if (region != null)
|
||||||
{
|
{
|
||||||
// Not really? Maybe?
|
// Not really? Maybe?
|
||||||
|
@ -278,15 +279,24 @@ namespace OpenSim.Services.GridService
|
||||||
region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
|
region.posX + (int)Constants.RegionSize + 1, region.posY + (int)Constants.RegionSize + 1, scopeID);
|
||||||
|
|
||||||
foreach (RegionData rdata in rdatas)
|
foreach (RegionData rdata in rdatas)
|
||||||
|
{
|
||||||
if (rdata.RegionID != regionID)
|
if (rdata.RegionID != regionID)
|
||||||
{
|
{
|
||||||
int flags = Convert.ToInt32(rdata.Data["flags"]);
|
int flags = Convert.ToInt32(rdata.Data["flags"]);
|
||||||
if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
|
if ((flags & (int)Data.RegionFlags.Hyperlink) == 0) // no hyperlinks as neighbours
|
||||||
rinfos.Add(RegionData2RegionInfo(rdata));
|
rinfos.Add(RegionData2RegionInfo(rdata));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count);
|
m_log.DebugFormat("[GRID SERVICE]: region {0} has {1} neighbours", region.RegionName, rinfos.Count);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_log.WarnFormat(
|
||||||
|
"[GRID SERVICE]: GetNeighbours() called for scope {0}, region {1} but no such region found",
|
||||||
|
scopeID, regionID);
|
||||||
|
}
|
||||||
|
|
||||||
return rinfos;
|
return rinfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue