diff options
author | Marck | 2011-01-21 20:00:04 +0100 |
---|---|---|
committer | Marck | 2011-02-17 13:47:13 +0100 |
commit | 4f9c3c73ad8cc2178e44c724c72a4bb292e5ea93 (patch) | |
tree | c75cf8ee0376322b61a0be5e9f8b5ed257dd47a2 | |
parent | Make osTeleportOwner work in foreign regions by relaxing the restrictions on ... (diff) | |
download | opensim-SC-4f9c3c73ad8cc2178e44c724c72a4bb292e5ea93.zip opensim-SC-4f9c3c73ad8cc2178e44c724c72a4bb292e5ea93.tar.gz opensim-SC-4f9c3c73ad8cc2178e44c724c72a4bb292e5ea93.tar.bz2 opensim-SC-4f9c3c73ad8cc2178e44c724c72a4bb292e5ea93.tar.xz |
Add support for new naming syntax of linked regions to osTeleportAgent and osTeleportOwner.
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 6 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | 17 |
2 files changed, 5 insertions, 18 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2fd6b52..02a0268 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3770,15 +3770,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3770 | public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, | 3770 | public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, |
3771 | Vector3 lookat, uint teleportFlags) | 3771 | Vector3 lookat, uint teleportFlags) |
3772 | { | 3772 | { |
3773 | GridRegion regionInfo = GridService.GetRegionByName(UUID.Zero, regionName); | 3773 | List<GridRegion> regions = GridService.GetRegionsByName(RegionInfo.ScopeID, regionName, 1); |
3774 | if (regionInfo == null) | 3774 | if (regions == null || regions.Count == 0) |
3775 | { | 3775 | { |
3776 | // can't find the region: Tell viewer and abort | 3776 | // can't find the region: Tell viewer and abort |
3777 | remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); | 3777 | remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); |
3778 | return; | 3778 | return; |
3779 | } | 3779 | } |
3780 | 3780 | ||
3781 | RequestTeleportLocation(remoteClient, regionInfo.RegionHandle, position, lookat, teleportFlags); | 3781 | RequestTeleportLocation(remoteClient, regions[0].RegionHandle, position, lookat, teleportFlags); |
3782 | } | 3782 | } |
3783 | 3783 | ||
3784 | /// <summary> | 3784 | /// <summary> |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 402d3a5..64931d0 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -694,26 +694,13 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
694 | ScenePresence presence = World.GetScenePresence(agentId); | 694 | ScenePresence presence = World.GetScenePresence(agentId); |
695 | if (presence != null) | 695 | if (presence != null) |
696 | { | 696 | { |
697 | // agent must be over owners land to avoid abuse | 697 | // For osTeleportAgent, agent must be over owners land to avoid abuse |
698 | // For osTeleportOwner, this restriction isn't necessary | ||
698 | if (relaxRestrictions || | 699 | if (relaxRestrictions || |
699 | m_host.OwnerID | 700 | m_host.OwnerID |
700 | == World.LandChannel.GetLandObject( | 701 | == World.LandChannel.GetLandObject( |
701 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) | 702 | presence.AbsolutePosition.X, presence.AbsolutePosition.Y).LandData.OwnerID) |
702 | { | 703 | { |
703 | // Check for hostname, attempt to make a HG link, | ||
704 | // and convert the regionName to the target region | ||
705 | if (regionName.Contains(".") && regionName.Contains(":")) | ||
706 | { | ||
707 | // Even though we use none of the results, we need to perform this call because it appears | ||
708 | // to have some the side effect of setting up hypergrid teleport locations. | ||
709 | World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1); | ||
710 | // List<GridRegion> regions = World.GridService.GetRegionsByName(World.RegionInfo.ScopeID, regionName, 1); | ||
711 | |||
712 | string[] parts = regionName.Split(new char[] { ':' }); | ||
713 | if (parts.Length > 2) | ||
714 | regionName = parts[0] + ':' + parts[1] + "/ " + parts[2]; | ||
715 | regionName = "http://" + regionName; | ||
716 | } | ||
717 | World.RequestTeleportLocation(presence.ControllingClient, regionName, | 704 | World.RequestTeleportLocation(presence.ControllingClient, regionName, |
718 | new Vector3((float)position.x, (float)position.y, (float)position.z), | 705 | new Vector3((float)position.x, (float)position.y, (float)position.z), |
719 | new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); | 706 | new Vector3((float)lookat.x, (float)lookat.y, (float)lookat.z), (uint)TPFlags.ViaLocation); |