If a user has no home position set, tell them so instead of leaving the request dangling

avinationmerge
Tom 2010-08-04 00:17:02 -07:00
parent c8f09f7fcb
commit 463fbb4990
1 changed files with 13 additions and 1 deletions

View File

@ -549,6 +549,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
if (uinfo != null) if (uinfo != null)
{ {
if (uinfo.HomeRegionID == UUID.Zero)
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("You don't have a home position set.");
return;
}
GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID); GridRegion regionInfo = m_aScene.GridService.GetRegionByUUID(UUID.Zero, uinfo.HomeRegionID);
if (regionInfo == null) if (regionInfo == null)
{ {
@ -556,7 +562,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
client.SendTeleportFailed("Your home region could not be found."); client.SendTeleportFailed("Your home region could not be found.");
return; return;
} }
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})", m_log.DebugFormat("[ENTITY TRANSFER MODULE]: User's home region is {0} {1} ({2}-{3})",
regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize); regionInfo.RegionName, regionInfo.RegionID, regionInfo.RegionLocX / Constants.RegionSize, regionInfo.RegionLocY / Constants.RegionSize);
// a little eekie that this goes back to Scene and with a forced cast, will fix that at some point... // a little eekie that this goes back to Scene and with a forced cast, will fix that at some point...
@ -564,6 +570,12 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt, client, regionInfo.RegionHandle, uinfo.HomePosition, uinfo.HomeLookAt,
(uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome)); (uint)(Constants.TeleportFlags.SetLastToTarget | Constants.TeleportFlags.ViaHome));
} }
else
{
// can't find the Home region: Tell viewer and abort
client.SendTeleportFailed("Your home region could not be found.");
return;
}
} }
#endregion #endregion