mirror of
https://github.com/opensim/opensim.git
synced 2026-08-11 11:57:03 +08:00
Implement Scope ID lookup on GetLandData. Stacked regions were not handled
properly
This commit is contained in:
@@ -1535,40 +1535,40 @@ namespace OpenSim.Region.CoreModules.World.Land
|
||||
if (parcelID == UUID.Zero)
|
||||
return;
|
||||
|
||||
ExtendedLandData data =
|
||||
(ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(),
|
||||
delegate(string id)
|
||||
{
|
||||
UUID parcel = UUID.Zero;
|
||||
UUID.TryParse(id, out parcel);
|
||||
// assume we've got the parcelID we just computed in RemoteParcelRequest
|
||||
ExtendedLandData extLandData = new ExtendedLandData();
|
||||
Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle,
|
||||
out extLandData.X, out extLandData.Y);
|
||||
m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}",
|
||||
extLandData.RegionHandle, extLandData.X, extLandData.Y);
|
||||
ExtendedLandData data = (ExtendedLandData)parcelInfoCache.Get(parcelID.ToString(),
|
||||
delegate(string id)
|
||||
{
|
||||
UUID parcel = UUID.Zero;
|
||||
UUID.TryParse(id, out parcel);
|
||||
// assume we've got the parcelID we just computed in RemoteParcelRequest
|
||||
ExtendedLandData extLandData = new ExtendedLandData();
|
||||
Util.ParseFakeParcelID(parcel, out extLandData.RegionHandle,
|
||||
out extLandData.X, out extLandData.Y);
|
||||
m_log.DebugFormat("[LAND] got parcelinfo request for regionHandle {0}, x/y {1}/{2}",
|
||||
extLandData.RegionHandle, extLandData.X, extLandData.Y);
|
||||
|
||||
// for this region or for somewhere else?
|
||||
if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle)
|
||||
{
|
||||
extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData;
|
||||
extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
ILandService landService = m_scene.RequestModuleInterface<ILandService>();
|
||||
extLandData.LandData = landService.GetLandData(extLandData.RegionHandle,
|
||||
extLandData.X,
|
||||
extLandData.Y,
|
||||
out extLandData.RegionAccess);
|
||||
if (extLandData.LandData == null)
|
||||
{
|
||||
// we didn't find the region/land => don't cache
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return extLandData;
|
||||
});
|
||||
// for this region or for somewhere else?
|
||||
if (extLandData.RegionHandle == m_scene.RegionInfo.RegionHandle)
|
||||
{
|
||||
extLandData.LandData = this.GetLandObject(extLandData.X, extLandData.Y).LandData;
|
||||
extLandData.RegionAccess = m_scene.RegionInfo.AccessLevel;
|
||||
}
|
||||
else
|
||||
{
|
||||
ILandService landService = m_scene.RequestModuleInterface<ILandService>();
|
||||
extLandData.LandData = landService.GetLandData(m_scene.RegionInfo.ScopeID,
|
||||
extLandData.RegionHandle,
|
||||
extLandData.X,
|
||||
extLandData.Y,
|
||||
out extLandData.RegionAccess);
|
||||
if (extLandData.LandData == null)
|
||||
{
|
||||
// we didn't find the region/land => don't cache
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return extLandData;
|
||||
});
|
||||
|
||||
if (data != null) // if we found some data, send it
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user