mantis 8583: osGetRegionMapTexture(); now returns prim region map textureID, without any requests to grid

0.9.1.0-post-fixes
UbitUmarov 2019-08-27 21:16:22 +01:00
parent ab92dff5be
commit 718c6d1e4d
3 changed files with 11 additions and 6 deletions

View File

@ -3563,7 +3563,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
/// </summary> /// </summary>
/// <param name="regionName"></param> /// <param name="regionName"></param>
/// <returns></returns> /// <returns></returns>
public LSL_Key osGetRegionMapTexture(string regionName) public LSL_Key osGetRegionMapTexture(string regionNameOrID)
{ {
CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture"); CheckThreatLevel(ThreatLevel.High, "osGetRegionMapTexture");
@ -3571,11 +3571,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
UUID key = UUID.Zero; UUID key = UUID.Zero;
GridRegion region; GridRegion region;
if(string.IsNullOrWhiteSpace(regionNameOrID))
{
return scene.RegionInfo.RegionSettings.TerrainImageID.ToString();
}
//If string is a key, use it. Otherwise, try to locate region by name. //If string is a key, use it. Otherwise, try to locate region by name.
if (UUID.TryParse(regionName, out key)) if (UUID.TryParse(regionNameOrID, out key))
region = scene.GridService.GetRegionByUUID(UUID.Zero, key); region = scene.GridService.GetRegionByUUID(UUID.Zero, key);
else else
region = scene.GridService.GetRegionByName(UUID.Zero, regionName); region = scene.GridService.GetRegionByName(UUID.Zero, regionNameOrID);
// If region was found, return the regions map texture key. // If region was found, return the regions map texture key.
if (region != null) if (region != null)

View File

@ -375,7 +375,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
key osGetGender(LSL_Key rawAvatarId); key osGetGender(LSL_Key rawAvatarId);
key osGetMapTexture(); key osGetMapTexture();
key osGetRegionMapTexture(string regionName); key osGetRegionMapTexture(string regionNameOrID);
LSL_List osGetRegionStats(); LSL_List osGetRegionStats();
vector osGetRegionSize(); vector osGetRegionSize();

View File

@ -945,9 +945,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
return m_OSSL_Functions.osGetMapTexture(); return m_OSSL_Functions.osGetMapTexture();
} }
public key osGetRegionMapTexture(string regionName) public key osGetRegionMapTexture(string regionNameOrID)
{ {
return m_OSSL_Functions.osGetRegionMapTexture(regionName); return m_OSSL_Functions.osGetRegionMapTexture(regionNameOrID);
} }
public LSL_List osGetRegionStats() public LSL_List osGetRegionStats()