aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-11-16 19:18:43 +0000
committerJustin Clark-Casey (justincc)2010-11-16 19:18:43 +0000
commitc5d78c723b0965b196ba22224e4bf56696ea96f5 (patch)
treed47ff745be7d74a43d322ad3884fddea7d03732b /OpenSim
parentDo not include hyperlinks in a random region search during a login. (diff)
parentFix osTeleportAgent for hypergrid destinations. (diff)
downloadopensim-SC-c5d78c723b0965b196ba22224e4bf56696ea96f5.zip
opensim-SC-c5d78c723b0965b196ba22224e4bf56696ea96f5.tar.gz
opensim-SC-c5d78c723b0965b196ba22224e4bf56696ea96f5.tar.bz2
opensim-SC-c5d78c723b0965b196ba22224e4bf56696ea96f5.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs5
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs20
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs38
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs3
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs15
5 files changed, 71 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index 7f37878..fb4ef28 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -735,7 +735,10 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
735 735
736 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) 736 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader)
737 { 737 {
738 item.OldItemID = ReadUUID(reader, "OldItemID"); 738 ReadUUID(reader, "OldItemID");
739 // On deserialization, the old item id MUST BE UUID.Zero!!!!!
740 // Setting this to the saved value will BREAK script persistence!
741 // item.OldItemID = ReadUUID(reader, "OldItemID");
739 } 742 }
740 743
741 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) 744 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader)
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index c251a49..cc3cf17 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -2983,17 +2983,25 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
2983 2983
2984 if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0) 2984 if ((item.PermsMask & ScriptBaseClass.PERMISSION_ATTACH) != 0)
2985 { 2985 {
2986 SceneObjectGroup grp = m_host.ParentGroup;
2987 UUID itemID = grp.GetFromItemID();
2988
2989 ScenePresence presence = World.GetScenePresence(m_host.OwnerID);
2990
2991 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule; 2986 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
2992 if (attachmentsModule != null) 2987 if (attachmentsModule != null)
2993 attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient); 2988 Util.FireAndForget(DetachWrapper, m_host);
2994 } 2989 }
2995 } 2990 }
2996 2991
2992 private void DetachWrapper(object o)
2993 {
2994 SceneObjectPart host = (SceneObjectPart)o;
2995
2996 SceneObjectGroup grp = host.ParentGroup;
2997 UUID itemID = grp.GetFromItemID();
2998 ScenePresence presence = World.GetScenePresence(host.OwnerID);
2999
3000 IAttachmentsModule attachmentsModule = m_ScriptEngine.World.AttachmentsModule;
3001 if (attachmentsModule != null)
3002 attachmentsModule.ShowDetachInUserInventory(itemID, presence.ControllingClient);
3003 }
3004
2997 public void llTakeCamera(string avatar) 3005 public void llTakeCamera(string avatar)
2998 { 3006 {
2999 m_host.AddScriptLPS(1); 3007 m_host.AddScriptLPS(1);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index 8a98be7..e6a323e 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -639,6 +639,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
639 // 639 //
640 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); 640 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
641 641
642 TeleportAgent(agent, regionName, position, lookat);
643 }
644
645 private void TeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
646 {
642 m_host.AddScriptLPS(1); 647 m_host.AddScriptLPS(1);
643 UUID agentId = new UUID(); 648 UUID agentId = new UUID();
644 if (UUID.TryParse(agent, out agentId)) 649 if (UUID.TryParse(agent, out agentId))
@@ -651,7 +656,6 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
651 == World.LandChannel.GetLandObject( 656 == World.LandChannel.GetLandObject(
652 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) 657 presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID)
653 { 658 {
654
655 // Check for hostname , attempt to make a hglink 659 // Check for hostname , attempt to make a hglink
656 // and convert the regionName to the target region 660 // and convert the regionName to the target region
657 if (regionName.Contains(".") && regionName.Contains(":")) 661 if (regionName.Contains(".") && regionName.Contains(":"))
@@ -661,7 +665,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
661 if (regions != null && regions.Count > 0) 665 if (regions != null && regions.Count > 0)
662 { 666 {
663 GridRegion regInfo = regions[0]; 667 GridRegion regInfo = regions[0];
664 regionName = regInfo.RegionName; 668 string[] parts = regInfo.RegionName.Split(new char[] { ':' });
669 if (parts.Length > 2)
670 regionName = parts[2];
671 else
672 regionName = parts[0];
665 } 673 }
666 } 674 }
667 World.RequestTeleportLocation(presence.ControllingClient, regionName, 675 World.RequestTeleportLocation(presence.ControllingClient, regionName,
@@ -674,13 +682,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
674 } 682 }
675 } 683 }
676 684
677 // Teleport functions
678 public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat) 685 public void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
679 { 686 {
680 // High because there is no security check. High griefer potential 687 // High because there is no security check. High griefer potential
681 // 688 //
682 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent"); 689 CheckThreatLevel(ThreatLevel.High, "osTeleportAgent");
683 690
691 TeleportAgent(agent, regionX, regionY, position, lookat);
692 }
693
694 private void TeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
695 {
684 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize)); 696 ulong regionHandle = Util.UIntsToLong(((uint)regionX * (uint)Constants.RegionSize), ((uint)regionY * (uint)Constants.RegionSize));
685 697
686 m_host.AddScriptLPS(1); 698 m_host.AddScriptLPS(1);
@@ -709,6 +721,26 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
709 osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat); 721 osTeleportAgent(agent, World.RegionInfo.RegionName, position, lookat);
710 } 722 }
711 723
724 public void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
725 {
726 // Threat level None because this is what can already be done with the World Map in the viewer
727 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
728
729 TeleportAgent(m_host.OwnerID.ToString(), regionName, position, lookat);
730 }
731
732 public void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
733 {
734 osTeleportOwner(World.RegionInfo.RegionName, position, lookat);
735 }
736
737 public void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat)
738 {
739 CheckThreatLevel(ThreatLevel.None, "osTeleportOwner");
740
741 TeleportAgent(m_host.OwnerID.ToString(), regionX, regionY, position, lookat);
742 }
743
712 // Functions that get information from the agent itself. 744 // Functions that get information from the agent itself.
713 // 745 //
714 // osGetAgentIP - this is used to determine the IP address of 746 // osGetAgentIP - this is used to determine the IP address of
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
index 630821b..c9a24f6 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IOSSL_Api.cs
@@ -86,6 +86,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces
86 void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); 86 void osTeleportAgent(string agent, string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
87 void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); 87 void osTeleportAgent(string agent, int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
88 void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat); 88 void osTeleportAgent(string agent, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
89 void osTeleportOwner(string regionName, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
90 void osTeleportOwner(int regionX, int regionY, LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
91 void osTeleportOwner(LSL_Types.Vector3 position, LSL_Types.Vector3 lookat);
89 92
90 // Animation commands 93 // Animation commands
91 void osAvatarPlayAnimation(string avatar, string animation); 94 void osAvatarPlayAnimation(string avatar, string animation);
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
index e289554..370bf1d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/OSSL_Stub.cs
@@ -227,6 +227,21 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
227 m_OSSL_Functions.osTeleportAgent(agent, position, lookat); 227 m_OSSL_Functions.osTeleportAgent(agent, position, lookat);
228 } 228 }
229 229
230 public void osTeleportOwner(string regionName, vector position, vector lookat)
231 {
232 m_OSSL_Functions.osTeleportOwner(regionName, position, lookat);
233 }
234
235 public void osTeleportOwner(int regionX, int regionY, vector position, vector lookat)
236 {
237 m_OSSL_Functions.osTeleportOwner(regionX, regionY, position, lookat);
238 }
239
240 public void osTeleportOwner(vector position, vector lookat)
241 {
242 m_OSSL_Functions.osTeleportOwner(position, lookat);
243 }
244
230 // Avatar info functions 245 // Avatar info functions
231 public string osGetAgentIP(string agent) 246 public string osGetAgentIP(string agent)
232 { 247 {