add GetRegionByHandle methods

This commit is contained in:
UbitUmarov
2020-08-25 15:01:55 +01:00
parent b6d26c89e6
commit 39ab8902da
5 changed files with 42 additions and 4 deletions

View File

@@ -212,13 +212,26 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
public GridRegion GetRegionByUUID(UUID scopeID, UUID regionID)
{
bool inCache = false;
GridRegion rinfo = m_RegionInfoCache.Get(scopeID,regionID,out inCache);
GridRegion rinfo = m_RegionInfoCache.Get(scopeID, regionID, out inCache);
if (inCache)
return rinfo;
rinfo = m_GridService.GetRegionByUUID(scopeID, regionID);
if(rinfo != null)
m_RegionInfoCache.Cache(scopeID, rinfo);
if (rinfo != null)
m_RegionInfoCache.Cache(scopeID, rinfo);
return rinfo;
}
public GridRegion GetRegionByHandle(UUID scopeID, ulong regionhandle)
{
bool inCache = false;
GridRegion rinfo = m_RegionInfoCache.Get(scopeID, regionhandle, out inCache);
if (inCache)
return rinfo;
rinfo = m_GridService.GetRegionByHandle(scopeID, regionhandle);
if (rinfo != null)
m_RegionInfoCache.Cache(scopeID, rinfo);
return rinfo;
}

View File

@@ -218,6 +218,17 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
return rinfo;
}
public GridRegion GetRegionByHandle(UUID scopeID, ulong regionhandle)
{
GridRegion rinfo = m_LocalGridService.GetRegionByHandle(scopeID, regionhandle);
if (rinfo != null)
return rinfo;
rinfo = m_RemoteGridService.GetRegionByHandle(scopeID, regionhandle);
m_RegionInfoCache.Cache(scopeID, rinfo);
return rinfo;
}
// Get a region given its base world coordinates (in meters).
// NOTE: this is NOT 'get a region by some point in the region'. The coordinate MUST
// be the base coordinate of the region.