diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 76 |
1 files changed, 58 insertions, 18 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 |