aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-29 00:00:35 +0100
committerJustin Clark-Casey (justincc)2011-07-29 00:00:35 +0100
commit8c3eb324c4b666e7abadef4a714d1bd8d5f71ac2 (patch)
tree3b67325f04fb9a1103f9c5bba84fb8f0ecafed92
parentEnsure that packet headers get parsed correctly (diff)
downloadopensim-SC-8c3eb324c4b666e7abadef4a714d1bd8d5f71ac2.zip
opensim-SC-8c3eb324c4b666e7abadef4a714d1bd8d5f71ac2.tar.gz
opensim-SC-8c3eb324c4b666e7abadef4a714d1bd8d5f71ac2.tar.bz2
opensim-SC-8c3eb324c4b666e7abadef4a714d1bd8d5f71ac2.tar.xz
When using osTeleportAgent() and osTeleportAvatar(), only teleport if the region name exactly matches (not near matches)
This is to prevent situations where the first name returned by GridService.GetRegionsByName is not one that exactly matches the given region name, even when there is an exact match later on in the list. Only the above two functions call this teleport method (the map uses a different routine) so this seems safe to change. Addresses http://opensimulator.org/mantis/view.php?id=5606
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs12
1 files changed, 8 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 1a32510..b84c3d5 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -3881,8 +3881,11 @@ namespace OpenSim.Region.Framework.Scenes
3881 } 3881 }
3882 3882
3883 /// <summary> 3883 /// <summary>
3884 /// Tries to teleport agent to other region. 3884 /// Tries to teleport agent to another region.
3885 /// </summary> 3885 /// </summary>
3886 /// <remarks>
3887 /// The region name must exactly match that given.
3888 /// </remarks>
3886 /// <param name="remoteClient"></param> 3889 /// <param name="remoteClient"></param>
3887 /// <param name="regionName"></param> 3890 /// <param name="regionName"></param>
3888 /// <param name="position"></param> 3891 /// <param name="position"></param>
@@ -3891,15 +3894,16 @@ namespace OpenSim.Region.Framework.Scenes
3891 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position, 3894 public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
3892 Vector3 lookat, uint teleportFlags) 3895 Vector3 lookat, uint teleportFlags)
3893 { 3896 {
3894 List<GridRegion> regions = GridService.GetRegionsByName(RegionInfo.ScopeID, regionName, 1); 3897 GridRegion region = GridService.GetRegionByName(RegionInfo.ScopeID, regionName);
3895 if (regions == null || regions.Count == 0) 3898
3899 if (region == null)
3896 { 3900 {
3897 // can't find the region: Tell viewer and abort 3901 // can't find the region: Tell viewer and abort
3898 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found."); 3902 remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
3899 return; 3903 return;
3900 } 3904 }
3901 3905
3902 RequestTeleportLocation(remoteClient, regions[0].RegionHandle, position, lookat, teleportFlags); 3906 RequestTeleportLocation(remoteClient, region.RegionHandle, position, lookat, teleportFlags);
3903 } 3907 }
3904 3908
3905 /// <summary> 3909 /// <summary>