Explicit tests for local regions.

0.6.5-rc1
diva 2009-03-22 06:31:32 +00:00
parent 9489ad57f9
commit 047d753cd0
2 changed files with 50 additions and 26 deletions

View File

@ -260,6 +260,15 @@ namespace OpenSim.Region.CoreModules.Communications.Local
// ? weird. should not happen
return m_sceneList[0].RegionInfo.RegionID;
}
public bool IsLocalRegion(ulong regionhandle)
{
foreach (Scene s in m_sceneList)
if (s.RegionInfo.RegionHandle == regionhandle)
return true;
return false;
}
#endregion
}
}

View File

@ -136,15 +136,18 @@ namespace OpenSim.Region.CoreModules.Communications.REST
return true;
// else do the remote thing
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
if (!m_localBackend.IsLocalRegion(regionHandle))
{
SendUserInformation(regInfo, aCircuit);
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
SendUserInformation(regInfo, aCircuit);
return DoCreateChildAgentCall(regInfo, aCircuit);
return DoCreateChildAgentCall(regInfo, aCircuit);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
return false;
}
@ -155,13 +158,16 @@ namespace OpenSim.Region.CoreModules.Communications.REST
return true;
// else do the remote thing
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
if (!m_localBackend.IsLocalRegion(regionHandle))
{
return DoChildAgentUpdateCall(regInfo, cAgentData);
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
return DoChildAgentUpdateCall(regInfo, cAgentData);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
return false;
}
@ -173,13 +179,16 @@ namespace OpenSim.Region.CoreModules.Communications.REST
return true;
// else do the remote thing
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
if (!m_localBackend.IsLocalRegion(regionHandle))
{
return DoChildAgentUpdateCall(regInfo, cAgentData);
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
return DoChildAgentUpdateCall(regInfo, cAgentData);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
return false;
}
@ -201,13 +210,16 @@ namespace OpenSim.Region.CoreModules.Communications.REST
return true;
// else do the remote thing
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
if (!m_localBackend.IsLocalRegion(regionHandle))
{
return DoCloseAgentCall(regInfo, id);
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
return DoCloseAgentCall(regInfo, id);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
return false;
}
@ -225,13 +237,16 @@ namespace OpenSim.Region.CoreModules.Communications.REST
}
// else do the remote thing
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
if (!m_localBackend.IsLocalRegion(regionHandle))
{
return DoCreateObjectCall(regInfo, sog);
RegionInfo regInfo = m_commsManager.GridService.RequestNeighbourInfo(regionHandle);
if (regInfo != null)
{
return DoCreateObjectCall(regInfo, sog);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
}
//else
// m_log.Warn("[REST COMMS]: Region not found " + regionHandle);
return false;
}