varregion: fix bug where destination region is not found and object is

not restored to its original location.
varregion
Robert Adams 2013-12-24 11:51:50 -08:00
parent a01862509e
commit 5c9fa15f30
1 changed files with 61 additions and 47 deletions

View File

@ -1441,6 +1441,18 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
}
}
if (neighbourRegion == null)
m_log.DebugFormat("{0} GetDestination: region not found. Old region name={1} at <{2},{3}> of size <{4},{5}>. Old pos={6}",
LogHeader, scene.RegionInfo.RegionName,
scene.RegionInfo.RegionLocX, scene.RegionInfo.RegionLocY,
scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY,
pos);
else
m_log.DebugFormat("{0} GetDestination: new region={1} at <{2},{3}> of size <{4},{5}>, newpos=<{6},{7}>",
LogHeader, neighbourRegion.RegionName,
neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, neighbourRegion.RegionSizeX, neighbourRegion.RegionSizeY,
newpos.X, newpos.Y);
return neighbourRegion;
}
@ -1563,14 +1575,19 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
ScenePresence agent, Vector3 pos, GridRegion neighbourRegion,
bool isFlying, string version)
{
m_log.DebugFormat("{0} CrossAgentToNewRegionAsync: new region={1} at <{2},{3}>. newpos={4}",
LogHeader, neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, pos);
if (!CrossAgentToNewRegionPrep(agent, neighbourRegion))
{
m_log.DebugFormat("{0} CrossAgentToNewRegionAsync: prep failed. Resetting transfer state", LogHeader);
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
return agent;
}
if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying))
{
m_log.DebugFormat("{0} CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader);
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
return agent;
}
@ -2294,9 +2311,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
attemptedPosition.Z);
}
if (destination != null)
{
if (!CrossPrimGroupIntoNewRegion(destination, pos, grp, silent))
if (destination == null || !CrossPrimGroupIntoNewRegion(destination, pos, grp, silent))
{
m_log.InfoFormat("[ENTITY TRANSFER MODULE] cross region transfer failed for object {0}", grp.UUID);
@ -2317,7 +2332,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
grp.ScheduleGroupForFullUpdate();
}
}
}
/// <summary>
/// Move the given scene object into a new region