work around viewers not suporting large regions on landmark creation. They still may display wrong offset; don't let inventory description be limited by asset description side on a ossl method

melanie
UbitUmarov 2016-11-24 20:53:04 +00:00
parent 5202ae7bb4
commit f9b62b5680
2 changed files with 39 additions and 18 deletions

View File

@ -1801,30 +1801,51 @@ namespace OpenSim.Region.CoreModules.World.Land
{ {
Hashtable hash = new Hashtable(); Hashtable hash = new Hashtable();
hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request)); hash = (Hashtable)LLSD.LLSDDeserialize(Utils.StringToBytes(request));
if (hash.ContainsKey("region_id") && hash.ContainsKey("location")) if (hash.ContainsKey("location"))
{ {
UUID regionID = (UUID)hash["region_id"]; UUID scope = m_scene.RegionInfo.ScopeID;
ArrayList list = (ArrayList)hash["location"]; ArrayList list = (ArrayList)hash["location"];
uint x = (uint)(double)list[0]; uint x = (uint)(double)list[0];
uint y = (uint)(double)list[1]; uint y = (uint)(double)list[1];
if (hash.ContainsKey("region_handle")) if(hash.ContainsKey("region_id"))
{
UUID regionID = (UUID)hash["region_id"];
if (regionID == m_scene.RegionInfo.RegionID)
{
// a parcel request for a local parcel => no need to query the grid
parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y);
}
else
{
// a parcel request for a parcel in another region. Ask the grid about the region
GridRegion info = m_scene.GridService.GetRegionByUUID(scope, regionID);
if (info != null)
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y);
}
}
else if (hash.ContainsKey("region_handle"))
{ {
// if you do a "About Landmark" on a landmark a second time, the viewer sends the // if you do a "About Landmark" on a landmark a second time, the viewer sends the
// region_handle it got earlier via RegionHandleRequest // region_handle it got earlier via RegionHandleRequest
ulong regionHandle = Util.BytesToUInt64Big((byte[])hash["region_handle"]); ulong regionHandle = Util.BytesToUInt64Big((byte[])hash["region_handle"]);
parcelID = Util.BuildFakeParcelID(regionHandle, x, y); if(regionHandle == m_scene.RegionInfo.RegionHandle)
} parcelID = Util.BuildFakeParcelID(regionHandle, x, y);
else if (regionID == m_scene.RegionInfo.RegionID) else
{ {
// a parcel request for a local parcel => no need to query the grid uint wx;
parcelID = Util.BuildFakeParcelID(m_scene.RegionInfo.RegionHandle, x, y); uint wy;
} Util.RegionHandleToWorldLoc(regionHandle, out wx, out wy);
else wx += x;
{ wy += y;
// a parcel request for a parcel in another region. Ask the grid about the region GridRegion info = m_scene.GridService.GetRegionByPosition(scope, (int)wx, (int)wy);
GridRegion info = m_scene.GridService.GetRegionByUUID(UUID.Zero, regionID); if(info != null)
if (info != null) {
parcelID = Util.BuildFakeParcelID(info.RegionHandle, x, y); wx -= (uint)info.RegionLocX;
wy -= (uint)info.RegionLocY;
parcelID = Util.BuildFakeParcelID(info.RegionHandle, wx, wy);
}
}
} }
} }
} }

View File

@ -1938,8 +1938,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
taskItem.ResetIDs(m_host.UUID); taskItem.ResetIDs(m_host.UUID);
taskItem.ParentID = m_host.UUID; taskItem.ParentID = m_host.UUID;
taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch(); taskItem.CreationDate = (uint)Util.UnixTimeSinceEpoch();
taskItem.Name = asset.Name; taskItem.Name = name;
taskItem.Description = asset.Description; taskItem.Description = description;
taskItem.Type = (int)AssetType.Notecard; taskItem.Type = (int)AssetType.Notecard;
taskItem.InvType = (int)InventoryType.Notecard; taskItem.InvType = (int)InventoryType.Notecard;
taskItem.OwnerID = m_host.OwnerID; taskItem.OwnerID = m_host.OwnerID;