diff options
author | BlueWall | 2012-10-20 05:25:58 -0400 |
---|---|---|
committer | BlueWall | 2012-10-20 05:25:58 -0400 |
commit | 07f1d44174f5e2b4e3d5ffdec3619bb84f357af2 (patch) | |
tree | 83cc0442b2c1b89a5b3dd94cff23d5098415777e /OpenSim/Region/ScriptEngine/Shared/Api/Implementation | |
parent | Merge branch 'master' into connector_plugin (diff) | |
parent | Fix: invinite loading for Viewer3 : parcelinfo request of traffic-value (impl... (diff) | |
download | opensim-SC-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.zip opensim-SC-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.tar.gz opensim-SC-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.tar.bz2 opensim-SC-07f1d44174f5e2b4e3d5ffdec3619bb84f357af2.tar.xz |
Merge branch 'master' into connector_plugin
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 51 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 5 |
2 files changed, 41 insertions, 15 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, |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 31be450..29bc163 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -3545,17 +3545,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
3545 | /// <returns></returns> | 3545 | /// <returns></returns> |
3546 | public void osSetContentType(LSL_Key id, string type) | 3546 | public void osSetContentType(LSL_Key id, string type) |
3547 | { | 3547 | { |
3548 | CheckThreatLevel(ThreatLevel.High,"osSetResponseType"); | 3548 | CheckThreatLevel(ThreatLevel.High, "osSetContentType"); |
3549 | |||
3549 | if (m_UrlModule != null) | 3550 | if (m_UrlModule != null) |
3550 | m_UrlModule.HttpContentType(new UUID(id),type); | 3551 | m_UrlModule.HttpContentType(new UUID(id),type); |
3551 | } | 3552 | } |
3553 | |||
3552 | /// Shout an error if the object owner did not grant the script the specified permissions. | 3554 | /// Shout an error if the object owner did not grant the script the specified permissions. |
3553 | /// </summary> | 3555 | /// </summary> |
3554 | /// <param name="perms"></param> | 3556 | /// <param name="perms"></param> |
3555 | /// <returns>boolean indicating whether an error was shouted.</returns> | 3557 | /// <returns>boolean indicating whether an error was shouted.</returns> |
3556 | protected bool ShoutErrorOnLackingOwnerPerms(int perms, string errorPrefix) | 3558 | protected bool ShoutErrorOnLackingOwnerPerms(int perms, string errorPrefix) |
3557 | { | 3559 | { |
3558 | CheckThreatLevel(ThreatLevel.Moderate, "osDropAttachment"); | ||
3559 | m_host.AddScriptLPS(1); | 3560 | m_host.AddScriptLPS(1); |
3560 | bool fail = false; | 3561 | bool fail = false; |
3561 | if (m_item.PermsGranter != m_host.OwnerID) | 3562 | if (m_item.PermsGranter != m_host.OwnerID) |