diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 7620df3..cf801ba 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -56,6 +56,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; | |||
56 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; | 56 | using PresenceInfo = OpenSim.Services.Interfaces.PresenceInfo; |
57 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; | 57 | using PrimType = OpenSim.Region.Framework.Scenes.PrimType; |
58 | using AssetLandmark = OpenSim.Framework.AssetLandmark; | 58 | using AssetLandmark = OpenSim.Framework.AssetLandmark; |
59 | using RegionFlags = OpenSim.Framework.RegionFlags; | ||
59 | 60 | ||
60 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; | 61 | using LSL_Float = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLFloat; |
61 | using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; | 62 | using LSL_Integer = OpenSim.Region.ScriptEngine.Shared.LSL_Types.LSLInteger; |
@@ -3772,6 +3773,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3772 | } | 3773 | } |
3773 | 3774 | ||
3774 | /// <summary> | 3775 | /// <summary> |
3776 | /// Returns the name of the child prim or seated avatar matching the | ||
3777 | /// specified link number. | ||
3778 | /// </summary> | ||
3779 | /// <param name="linknum"> | ||
3780 | /// The number of a link in the linkset or a link-related constant. | ||
3781 | /// </param> | ||
3782 | /// <returns> | ||
3783 | /// The name determined to match the specified link number. | ||
3784 | /// </returns> | ||
3785 | /// <remarks> | ||
3775 | /// The rules governing the returned name are not simple. The only | 3786 | /// The rules governing the returned name are not simple. The only |
3776 | /// time a blank name is returned is if the target prim has a blank | 3787 | /// time a blank name is returned is if the target prim has a blank |
3777 | /// name. If no prim with the given link number can be found then | 3788 | /// name. If no prim with the given link number can be found then |
@@ -3799,10 +3810,14 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3799 | /// Mentions NULL_KEY being returned | 3810 | /// Mentions NULL_KEY being returned |
3800 | /// http://wiki.secondlife.com/wiki/LlGetLinkName | 3811 | /// http://wiki.secondlife.com/wiki/LlGetLinkName |
3801 | /// Mentions using the LINK_* constants, some of which are negative | 3812 | /// Mentions using the LINK_* constants, some of which are negative |
3802 | /// </summary> | 3813 | /// </remarks> |
3803 | public LSL_String llGetLinkName(int linknum) | 3814 | public LSL_String llGetLinkName(int linknum) |
3804 | { | 3815 | { |
3805 | m_host.AddScriptLPS(1); | 3816 | m_host.AddScriptLPS(1); |
3817 | // simplest case, this prims link number | ||
3818 | if (linknum == m_host.LinkNum || linknum == ScriptBaseClass.LINK_THIS) | ||
3819 | return m_host.Name; | ||
3820 | |||
3806 | // parse for sitting avatare-names | 3821 | // parse for sitting avatare-names |
3807 | List<String> nametable = new List<String>(); | 3822 | List<String> nametable = new List<String>(); |
3808 | World.ForEachRootScenePresence(delegate(ScenePresence presence) | 3823 | World.ForEachRootScenePresence(delegate(ScenePresence presence) |
@@ -3826,10 +3841,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3826 | return nametable[totalprims - linknum]; | 3841 | return nametable[totalprims - linknum]; |
3827 | } | 3842 | } |
3828 | 3843 | ||
3829 | // simplest case, this prims link number | ||
3830 | if (m_host.LinkNum == linknum) | ||
3831 | return m_host.Name; | ||
3832 | |||
3833 | // Single prim | 3844 | // Single prim |
3834 | if (m_host.LinkNum == 0) | 3845 | if (m_host.LinkNum == 0) |
3835 | { | 3846 | { |
@@ -6458,7 +6469,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6458 | GridInstantMessage msg = new GridInstantMessage(World, | 6469 | GridInstantMessage msg = new GridInstantMessage(World, |
6459 | m_host.OwnerID, m_host.Name, destID, | 6470 | m_host.OwnerID, m_host.Name, destID, |
6460 | (byte)InstantMessageDialog.TaskInventoryOffered, | 6471 | (byte)InstantMessageDialog.TaskInventoryOffered, |
6461 | false, string.Format("'{0}'"), | 6472 | false, string.Format("'{0}'", category), |
6462 | // We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06 | 6473 | // We won't go so far as to add a SLURL, but this is the format used by LL as of 2012-10-06 |
6463 | // false, string.Format("'{0}' ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z), | 6474 | // false, string.Format("'{0}' ( http://slurl.com/secondlife/{1}/{2}/{3}/{4} )", category, World.Name, (int)pos.X, (int)pos.Y, (int)pos.Z), |
6464 | folderID, false, pos, | 6475 | folderID, false, pos, |
@@ -9313,11 +9324,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9313 | 9324 | ||
9314 | GridRegion info; | 9325 | GridRegion info; |
9315 | 9326 | ||
9316 | if (m_ScriptEngine.World.RegionInfo.RegionName == simulator) //Det data for this simulator? | 9327 | if (World.RegionInfo.RegionName == simulator) |
9317 | 9328 | info = new GridRegion(World.RegionInfo); | |
9318 | info = new GridRegion(m_ScriptEngine.World.RegionInfo); | ||
9319 | else | 9329 | else |
9320 | info = m_ScriptEngine.World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); | 9330 | info = World.GridService.GetRegionByName(m_ScriptEngine.World.RegionInfo.ScopeID, simulator); |
9321 | 9331 | ||
9322 | switch (data) | 9332 | switch (data) |
9323 | { | 9333 | { |
@@ -9327,9 +9337,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9327 | ScriptSleep(1000); | 9337 | ScriptSleep(1000); |
9328 | return UUID.Zero.ToString(); | 9338 | return UUID.Zero.ToString(); |
9329 | } | 9339 | } |
9330 | if (m_ScriptEngine.World.RegionInfo.RegionName != simulator) | 9340 | |
9341 | bool isHypergridRegion = false; | ||
9342 | |||
9343 | if (World.RegionInfo.RegionName != simulator && info.RegionSecret != "") | ||
9344 | { | ||
9345 | // Hypergrid is currently placing real destination region co-ords into RegionSecret. | ||
9346 | // But other code can also use this field for a genuine RegionSecret! Therefore, if | ||
9347 | // anything is present we need to disambiguate. | ||
9348 | // | ||
9349 | // FIXME: Hypergrid should be storing this data in a different field. | ||
9350 | RegionFlags regionFlags | ||
9351 | = (RegionFlags)m_ScriptEngine.World.GridService.GetRegionFlags( | ||
9352 | info.ScopeID, info.RegionID); | ||
9353 | isHypergridRegion = (regionFlags & RegionFlags.Hyperlink) != 0; | ||
9354 | } | ||
9355 | |||
9356 | if (isHypergridRegion) | ||
9331 | { | 9357 | { |
9332 | //Hypergrid Region co-ordinates | ||
9333 | uint rx = 0, ry = 0; | 9358 | uint rx = 0, ry = 0; |
9334 | Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry); | 9359 | Utils.LongToUInts(Convert.ToUInt64(info.RegionSecret), out rx, out ry); |
9335 | 9360 | ||
@@ -9340,7 +9365,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
9340 | } | 9365 | } |
9341 | else | 9366 | else |
9342 | { | 9367 | { |
9343 | //Local-cooridnates | 9368 | // Local grid co-oridnates |
9344 | reply = new LSL_Vector( | 9369 | reply = new LSL_Vector( |
9345 | info.RegionLocX, | 9370 | info.RegionLocX, |
9346 | info.RegionLocY, | 9371 | info.RegionLocY, |