aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs76
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs4
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs10
5 files changed, 77 insertions, 19 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 0199461..7c375e6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -4643,20 +4643,31 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4643 ScenePresence presence = World.GetScenePresence(agentId); 4643 ScenePresence presence = World.GetScenePresence(agentId);
4644 if (presence != null && presence.PresenceType != PresenceType.Npc) 4644 if (presence != null && presence.PresenceType != PresenceType.Npc)
4645 { 4645 {
4646 // agent must not be a god
4647 if (presence.GodLevel >= 200) return;
4648
4649 if (destination == String.Empty) 4646 if (destination == String.Empty)
4650 destination = World.RegionInfo.RegionName; 4647 destination = World.RegionInfo.RegionName;
4651 4648
4652 // agent must be over the owners land 4649 if (m_item.PermsGranter == agentId)
4653 if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID) 4650 {
4651 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
4652 {
4653 DoLLTeleport(presence, destination, targetPos, targetLookAt);
4654 }
4655 }
4656
4657 // agent must be wearing the object
4658 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID)
4654 { 4659 {
4655 DoLLTeleport(presence, destination, targetPos, targetLookAt); 4660 DoLLTeleport(presence, destination, targetPos, targetLookAt);
4656 } 4661 }
4657 else // or must be wearing the prim 4662 else
4658 { 4663 {
4659 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) 4664 // agent must not be a god
4665 if (presence.GodLevel >= 200) return;
4666
4667 // agent must be over the owners land
4668 ILandObject agentLand = World.LandChannel.GetLandObject(presence.AbsolutePosition);
4669 ILandObject objectLand = World.LandChannel.GetLandObject(m_host.AbsolutePosition);
4670 if (m_host.OwnerID == objectLand.LandData.OwnerID && m_host.OwnerID == agentLand.LandData.OwnerID)
4660 { 4671 {
4661 DoLLTeleport(presence, destination, targetPos, targetLookAt); 4672 DoLLTeleport(presence, destination, targetPos, targetLookAt);
4662 } 4673 }
@@ -4670,24 +4681,29 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
4670 m_host.AddScriptLPS(1); 4681 m_host.AddScriptLPS(1);
4671 UUID agentId = new UUID(); 4682 UUID agentId = new UUID();
4672 4683
4673 ulong regionHandle = Utils.UIntsToLong((uint)global_coords.x, (uint)global_coords.y); 4684 ulong regionHandle = Utils.UIntsToLong((uint)(global_coords.x / 256) * 256, (uint)(global_coords.y / 256) * 256);
4674 4685
4675 if (UUID.TryParse(agent, out agentId)) 4686 if (UUID.TryParse(agent, out agentId))
4676 { 4687 {
4688 // This function is owner only!
4689 if (m_host.OwnerID != agentId)
4690 return;
4691
4677 ScenePresence presence = World.GetScenePresence(agentId); 4692 ScenePresence presence = World.GetScenePresence(agentId);
4693
4694 // Can't TP sitting avatars
4695 if (presence.ParentID != 0) // Sitting
4696 return;
4697
4678 if (presence != null && presence.PresenceType != PresenceType.Npc) 4698 if (presence != null && presence.PresenceType != PresenceType.Npc)
4679 { 4699 {
4680 // agent must not be a god 4700 if (m_item.PermsGranter == agentId)
4681 if (presence.GodLevel >= 200) return;
4682
4683 // agent must be over the owners land
4684 if (m_host.OwnerID == World.LandChannel.GetLandObject(presence.AbsolutePosition).LandData.OwnerID)
4685 {
4686 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
4687 }
4688 else // or must be wearing the prim
4689 { 4701 {
4690 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.OwnerID == presence.UUID) 4702 // If attached using llAttachToAvatarTemp, cowardly refuse
4703 if (m_host.ParentGroup.AttachmentPoint != 0 && m_host.ParentGroup.FromItemID == UUID.Zero)
4704 return;
4705
4706 if ((m_item.PermsMask & ScriptBaseClass.PERMISSION_TELEPORT) != 0)
4691 { 4707 {
4692 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation); 4708 World.RequestTeleportLocation(presence.ControllingClient, regionHandle, targetPos, targetLookAt, (uint)TeleportFlags.ViaLocation);
4693 } 4709 }
@@ -7853,6 +7869,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
7853 } 7869 }
7854 } 7870 }
7855 7871
7872 public LSL_List llGetPhysicsMaterial()
7873 {
7874 LSL_List result = new LSL_List();
7875
7876 result.Add(new LSL_Float(m_host.GravityModifier));
7877 result.Add(new LSL_Float(m_host.Restitution));
7878 result.Add(new LSL_Float(m_host.Friction));
7879 result.Add(new LSL_Float(m_host.Density));
7880
7881 return result;
7882 }
7883
7856 private void SetPhysicsMaterial(SceneObjectPart part, int material_bits, 7884 private void SetPhysicsMaterial(SceneObjectPart part, int material_bits,
7857 float material_density, float material_friction, 7885 float material_density, float material_friction,
7858 float material_restitution, float material_gravity_modifier) 7886 float material_restitution, float material_gravity_modifier)
@@ -13379,6 +13407,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
13379 13407
13380 return null; 13408 return null;
13381 } 13409 }
13410
13411 public void llSetContentType(LSL_Key id, LSL_Integer content_type)
13412 {
13413 if (m_UrlModule != null)
13414 {
13415 string type = "text.plain";
13416 if (content_type == (int)ScriptBaseClass.CONTENT_TYPE_HTML)
13417 type = "text/html";
13418
13419 m_UrlModule.HttpContentType(new UUID(id),type);
13420 }
13421 }
13382 } 13422 }
13383 13423
13384 public class NotecardCache 13424 public class NotecardCache
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
index 884f07c..a47e452 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/SensorRepeat.cs
@@ -398,7 +398,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins
398 objtype = 0; 398 objtype = 0;
399 399
400 part = ((SceneObjectGroup)ent).RootPart; 400 part = ((SceneObjectGroup)ent).RootPart;
401 if (part.ParentGroup.AttachmentPoint != 0) // Attached so ignore 401 if (part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.Tree &&
402 part.ParentGroup.RootPart.Shape.PCode != (byte)PCode.NewTree &&
403 part.ParentGroup.AttachmentPoint != 0) // Attached so ignore
402 continue; 404 continue;
403 405
404 if (part.Inventory.ContainsScripts()) 406 if (part.Inventory.ContainsScripts())
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
index 9bf6f9b..daf89e5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/ILSL_Api.cs
@@ -433,5 +433,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
433 void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc); 433 void SetPrimitiveParamsEx(LSL_Key prim, LSL_List rules, string originFunc);
434 void llSetKeyframedMotion(LSL_List frames, LSL_List options); 434 void llSetKeyframedMotion(LSL_List frames, LSL_List options);
435 LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules); 435 LSL_List GetPrimitiveParamsEx(LSL_Key prim, LSL_List rules);
436 LSL_List llGetPhysicsMaterial();
437 void llSetContentType(LSL_Key id, LSL_Integer content_type);
436 } 438 }
437} 439}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 2f8154d..6efa73f 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -80,6 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
80 public const int PERMISSION_CHANGE_PERMISSIONS = 512; 80 public const int PERMISSION_CHANGE_PERMISSIONS = 512;
81 public const int PERMISSION_TRACK_CAMERA = 1024; 81 public const int PERMISSION_TRACK_CAMERA = 1024;
82 public const int PERMISSION_CONTROL_CAMERA = 2048; 82 public const int PERMISSION_CONTROL_CAMERA = 2048;
83 public const int PERMISSION_TELEPORT = 4096;
83 84
84 public const int AGENT_FLYING = 1; 85 public const int AGENT_FLYING = 1;
85 public const int AGENT_ATTACHMENTS = 2; 86 public const int AGENT_ATTACHMENTS = 2;
@@ -771,5 +772,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
771 /// process message parameter as regex 772 /// process message parameter as regex
772 /// </summary> 773 /// </summary>
773 public const int OS_LISTEN_REGEX_MESSAGE = 0x2; 774 public const int OS_LISTEN_REGEX_MESSAGE = 0x2;
775
776 public const int CONTENT_TYPE_TEXT = 0;
777 public const int CONTENT_TYPE_HTML = 1;
774 } 778 }
775} 779}
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
index 8ecc4f8..6f3677c 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Stub.cs
@@ -2009,5 +2009,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
2009 { 2009 {
2010 m_LSL_Functions.llSetPhysicsMaterial(material_bits, material_gravity_modifier, material_restitution, material_friction, material_density); 2010 m_LSL_Functions.llSetPhysicsMaterial(material_bits, material_gravity_modifier, material_restitution, material_friction, material_density);
2011 } 2011 }
2012
2013 public LSL_List llGetPhysicsMaterial()
2014 {
2015 return m_LSL_Functions.llGetPhysicsMaterial();
2016 }
2017
2018 public void llSetContentType(LSL_Key id, LSL_Integer content_type)
2019 {
2020 m_LSL_Functions.llSetContentType(id, content_type);
2021 }
2012 } 2022 }
2013} 2023}