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
bulletsim
Justin Clark-Casey (justincc) 2011-07-29 00:00:35 +01:00
parent c4ffcd4b7d
commit 8c3eb324c4
1 changed files with 8 additions and 4 deletions

View File

@ -3881,8 +3881,11 @@ namespace OpenSim.Region.Framework.Scenes
}
/// <summary>
/// Tries to teleport agent to other region.
/// Tries to teleport agent to another region.
/// </summary>
/// <remarks>
/// The region name must exactly match that given.
/// </remarks>
/// <param name="remoteClient"></param>
/// <param name="regionName"></param>
/// <param name="position"></param>
@ -3891,15 +3894,16 @@ namespace OpenSim.Region.Framework.Scenes
public void RequestTeleportLocation(IClientAPI remoteClient, string regionName, Vector3 position,
Vector3 lookat, uint teleportFlags)
{
List<GridRegion> regions = GridService.GetRegionsByName(RegionInfo.ScopeID, regionName, 1);
if (regions == null || regions.Count == 0)
GridRegion region = GridService.GetRegionByName(RegionInfo.ScopeID, regionName);
if (region == null)
{
// can't find the region: Tell viewer and abort
remoteClient.SendTeleportFailed("The region '" + regionName + "' could not be found.");
return;
}
RequestTeleportLocation(remoteClient, regions[0].RegionHandle, position, lookat, teleportFlags);
RequestTeleportLocation(remoteClient, region.RegionHandle, position, lookat, teleportFlags);
}
/// <summary>