Fix issue where a dns resolution failure on the final destination might leave the user unable to teleport since the transit flag was not being reset.

This moves the 'already in transit' check further up and resets the flag if dns resolution fails and in the new required places.
0.7.3-extended
Justin Clark-Casey (justincc) 2012-05-24 22:26:02 +01:00
parent 7692ccc0cc
commit 5c48c3c57a
1 changed files with 231 additions and 223 deletions

View File

@ -352,6 +352,30 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
ScenePresence sp, GridRegion reg, GridRegion finalDestination,
Vector3 position, Vector3 lookAt, uint teleportFlags)
{
// Record that this agent is in transit so that we can prevent simultaneous requests and do later detection
// of whether the destination region completes the teleport.
if (!SetInTransit(sp.UUID))
{
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
return;
}
if (reg == null || finalDestination == null)
{
sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
ResetFromTransit(sp.UUID);
return;
}
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
RegionInfo sourceRegion = sp.Scene.RegionInfo;
if (!IsWithinMaxTeleportDistance(sourceRegion, finalDestination))
@ -363,31 +387,13 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sourceRegion.RegionName, sourceRegion.RegionLocX, sourceRegion.RegionLocY,
MaxTransferDistance));
ResetFromTransit(sp.UUID);
return;
}
IEventQueue eq = sp.Scene.RequestModuleInterface<IEventQueue>();
if (reg == null || finalDestination == null)
{
sp.ControllingClient.SendTeleportFailed("Unable to locate destination");
return;
}
if (!SetInTransit(sp.UUID)) // Avie is already on the way. Caller shouldn't do this.
{
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Ignoring teleport request of {0} {1} to {2} ({3}) {4}/{5} - agent is already in transit.",
sp.Name, sp.UUID, reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
return;
}
m_log.DebugFormat(
"[ENTITY TRANSFER MODULE]: Teleporting {0} {1} from {2} to {3} ({4}) {5}/{6}",
sp.Name, sp.UUID, sp.Scene.RegionInfo.RegionName,
reg.ServerURI, finalDestination.ServerURI, finalDestination.RegionName, position);
uint newRegionX = (uint)(reg.RegionHandle >> 40);
uint newRegionY = (((uint)(reg.RegionHandle)) >> 8);
uint oldRegionX = (uint)(sp.Scene.RegionInfo.RegionHandle >> 40);
@ -399,8 +405,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
// This may be a costly operation. The reg.ExternalEndPoint field is not a passive field,
// it's actually doing a lot of work.
IPEndPoint endPoint = finalDestination.ExternalEndPoint;
if (endPoint.Address != null)
if (endPoint.Address == null)
{
sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
ResetFromTransit(sp.UUID);
return;
}
// Fixing a bug where teleporting while sitting results in the avatar ending up removed from
// both regions
if (sp.ParentID != (uint)0)
@ -619,11 +632,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
sp.UUID);
}
}
else
{
sp.ControllingClient.SendTeleportFailed("Remote Region appears to be down");
}
}
protected virtual void Fail(ScenePresence sp, GridRegion finalDestination, bool logout)
{