a few more changes on avatar crossing
parent
f4fa891928
commit
2e4c8798ab
|
@ -1560,7 +1560,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// We need this because of decimal number parsing of the protocols.
|
||||
Culture.SetCurrentCulture();
|
||||
|
||||
Vector3 pos = agent.AbsolutePosition + agent.Velocity;
|
||||
Vector3 pos = agent.AbsolutePosition + agent.Velocity * 0.2f;
|
||||
|
||||
GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, pos,
|
||||
ctx, out newpos, out failureReason);
|
||||
|
@ -1648,17 +1648,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
icon.EndInvoke(iar);
|
||||
}
|
||||
|
||||
public bool CrossAgentToNewRegionPrep(ScenePresence agent, GridRegion neighbourRegion)
|
||||
{
|
||||
if (neighbourRegion == null)
|
||||
return false;
|
||||
|
||||
m_entityTransferStateMachine.SetInTransit(agent.UUID);
|
||||
|
||||
agent.RemoveFromPhysicalScene();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// This Closes child agents on neighbouring regions
|
||||
|
@ -1673,16 +1663,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
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))
|
||||
if (neighbourRegion == null)
|
||||
{
|
||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: prep failed. Resetting transfer state", LogHeader);
|
||||
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: invalid destiny", LogHeader);
|
||||
return agent;
|
||||
}
|
||||
|
||||
m_entityTransferStateMachine.SetInTransit(agent.UUID);
|
||||
agent.RemoveFromPhysicalScene();
|
||||
|
||||
if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying, ctx))
|
||||
{
|
||||
m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader);
|
||||
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
||||
return agent;
|
||||
}
|
||||
|
||||
CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx);
|
||||
|
@ -1706,7 +1700,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// agent.Appearance.WearableCacheItems = null;
|
||||
|
||||
cAgent.Position = pos;
|
||||
|
||||
cAgent.ChildrenCapSeeds = agent.KnownRegions;
|
||||
|
||||
if (isFlying)
|
||||
|
@ -1787,15 +1780,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
capsPath);
|
||||
}
|
||||
|
||||
/*
|
||||
// Backwards compatibility. Best effort
|
||||
if (version == 0f)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
|
||||
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
|
||||
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
||||
}
|
||||
*/
|
||||
// SUCCESS!
|
||||
m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination);
|
||||
|
||||
|
@ -1814,18 +1798,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
|||
// but not sure yet what the side effects would be.
|
||||
m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
|
||||
|
||||
|
||||
// TODO: Check since what version this wasn't needed anymore. May be as old as 0.6
|
||||
/*
|
||||
// Backwards compatibility. Best effort
|
||||
if (version == 0f)
|
||||
{
|
||||
m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
|
||||
Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
|
||||
CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
|
||||
}
|
||||
*/
|
||||
|
||||
// the user may change their profile information in other region,
|
||||
// so the userinfo in UserProfileCache is not reliable any more, delete it
|
||||
// REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!
|
||||
|
|
|
@ -4206,19 +4206,21 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
{
|
||||
// we don't have entity transfer module
|
||||
Vector3 pos = AbsolutePosition;
|
||||
vel = Velocity;
|
||||
float px = pos.X;
|
||||
if (px < 0)
|
||||
pos.X += Velocity.X * 2;
|
||||
pos.X += vel.X * 2;
|
||||
else if (px > m_scene.RegionInfo.RegionSizeX)
|
||||
pos.X -= Velocity.X * 2;
|
||||
pos.X -= vel.X * 2;
|
||||
|
||||
float py = pos.Y;
|
||||
if (py < 0)
|
||||
pos.Y += Velocity.Y * 2;
|
||||
pos.Y += vel.Y * 2;
|
||||
else if (py > m_scene.RegionInfo.RegionSizeY)
|
||||
pos.Y -= Velocity.Y * 2;
|
||||
pos.Y -= vel.Y * 2;
|
||||
|
||||
Velocity = Vector3.Zero;
|
||||
m_AngularVelocity = Vector3.Zero;
|
||||
AbsolutePosition = pos;
|
||||
}
|
||||
}
|
||||
|
@ -4231,21 +4233,21 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
RemoveFromPhysicalScene();
|
||||
|
||||
Vector3 pos = AbsolutePosition;
|
||||
Vector3 vel = Velocity;
|
||||
float px = pos.X;
|
||||
if (px < 0)
|
||||
pos.X += Velocity.X * 2;
|
||||
pos.X += vel.X * 2;
|
||||
else if (px > m_scene.RegionInfo.RegionSizeX)
|
||||
pos.X -= Velocity.X * 2;
|
||||
pos.X -= vel.X * 2;
|
||||
|
||||
float py = pos.Y;
|
||||
if (py < 0)
|
||||
pos.Y += Velocity.Y * 2;
|
||||
pos.Y += vel.Y * 2;
|
||||
else if (py > m_scene.RegionInfo.RegionSizeY)
|
||||
pos.Y -= Velocity.Y * 2;
|
||||
pos.Y -= vel.Y * 2;
|
||||
|
||||
Velocity = Vector3.Zero;
|
||||
m_AngularVelocity = Vector3.Zero;
|
||||
|
||||
AbsolutePosition = pos;
|
||||
|
||||
AddToPhysicalScene(isFlying);
|
||||
|
|
Loading…
Reference in New Issue