mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 00:46:02 +08:00
add GetRegionByHandle methods
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -273,6 +273,13 @@ namespace OpenSim.Services.Connectors
|
||||
return rinfo;
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByHandle(UUID scopeID, ulong regionhandle)
|
||||
{
|
||||
//still not on protocol
|
||||
Util.RegionHandleToWorldLoc(regionhandle, out uint x, out uint y);
|
||||
return GetRegionByPosition(scopeID, (int)x, (int)y);
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
|
||||
{
|
||||
GridRegion rinfo = null;
|
||||
|
||||
@@ -446,6 +446,13 @@ namespace OpenSim.Services.GridService
|
||||
return null;
|
||||
}
|
||||
|
||||
public GridRegion GetRegionByHandle(UUID scopeID, ulong regionhandle)
|
||||
{
|
||||
int x = (int)(regionhandle >> 32);
|
||||
int y = (int)(regionhandle & 0xfffffffful);
|
||||
return GetRegionByPosition(scopeID, x, y);
|
||||
}
|
||||
|
||||
// Get a region given its base coordinates.
|
||||
// NOTE: this is NOT 'get a region by some point in the region'. The coordinate MUST
|
||||
// be the base coordinate of the region.
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace OpenSim.Services.Interfaces
|
||||
List<GridRegion> GetNeighbours(UUID scopeID, UUID regionID);
|
||||
|
||||
GridRegion GetRegionByUUID(UUID scopeID, UUID regionID);
|
||||
|
||||
GridRegion GetRegionByHandle(UUID scopeID, ulong regionhandle);
|
||||
/// <summary>
|
||||
/// Get the region at the given position (in meters)
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user