aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorUbitUmarov2016-07-27 03:50:47 +0100
committerUbitUmarov2016-07-27 03:50:47 +0100
commit2e4c8798abf539bddd9770b162acb6d3f3a105ac (patch)
tree75cbd326185912282de414bad7432a362b2f46b2 /OpenSim/Region/CoreModules/Framework
parentwaste another thread job on another thing that should be part of a more (diff)
downloadopensim-SC_OLD-2e4c8798abf539bddd9770b162acb6d3f3a105ac.zip
opensim-SC_OLD-2e4c8798abf539bddd9770b162acb6d3f3a105ac.tar.gz
opensim-SC_OLD-2e4c8798abf539bddd9770b162acb6d3f3a105ac.tar.bz2
opensim-SC_OLD-2e4c8798abf539bddd9770b162acb6d3f3a105ac.tar.xz
a few more changes on avatar crossing
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs46
1 files changed, 9 insertions, 37 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index a1ad910..fbb99b0 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1560,7 +1560,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1560 // We need this because of decimal number parsing of the protocols. 1560 // We need this because of decimal number parsing of the protocols.
1561 Culture.SetCurrentCulture(); 1561 Culture.SetCurrentCulture();
1562 1562
1563 Vector3 pos = agent.AbsolutePosition + agent.Velocity; 1563 Vector3 pos = agent.AbsolutePosition + agent.Velocity * 0.2f;
1564 1564
1565 GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, pos, 1565 GridRegion neighbourRegion = GetDestination(agent.Scene, agent.UUID, pos,
1566 ctx, out newpos, out failureReason); 1566 ctx, out newpos, out failureReason);
@@ -1648,17 +1648,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1648 icon.EndInvoke(iar); 1648 icon.EndInvoke(iar);
1649 } 1649 }
1650 1650
1651 public bool CrossAgentToNewRegionPrep(ScenePresence agent, GridRegion neighbourRegion) 1651
1652 {
1653 if (neighbourRegion == null)
1654 return false;
1655
1656 m_entityTransferStateMachine.SetInTransit(agent.UUID);
1657
1658 agent.RemoveFromPhysicalScene();
1659
1660 return true;
1661 }
1662 1652
1663 /// <summary> 1653 /// <summary>
1664 /// This Closes child agents on neighbouring regions 1654 /// This Closes child agents on neighbouring regions
@@ -1673,16 +1663,20 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1673 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: new region={1} at <{2},{3}>. newpos={4}", 1663 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: new region={1} at <{2},{3}>. newpos={4}",
1674 LogHeader, neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, pos); 1664 LogHeader, neighbourRegion.RegionName, neighbourRegion.RegionLocX, neighbourRegion.RegionLocY, pos);
1675 1665
1676 if (!CrossAgentToNewRegionPrep(agent, neighbourRegion)) 1666 if (neighbourRegion == null)
1677 { 1667 {
1678 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: prep failed. Resetting transfer state", LogHeader); 1668 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: invalid destiny", LogHeader);
1679 m_entityTransferStateMachine.ResetFromTransit(agent.UUID); 1669 return agent;
1680 } 1670 }
1681 1671
1672 m_entityTransferStateMachine.SetInTransit(agent.UUID);
1673 agent.RemoveFromPhysicalScene();
1674
1682 if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying, ctx)) 1675 if (!CrossAgentIntoNewRegionMain(agent, pos, neighbourRegion, isFlying, ctx))
1683 { 1676 {
1684 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader); 1677 m_log.DebugFormat("{0}: CrossAgentToNewRegionAsync: cross main failed. Resetting transfer state", LogHeader);
1685 m_entityTransferStateMachine.ResetFromTransit(agent.UUID); 1678 m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
1679 return agent;
1686 } 1680 }
1687 1681
1688 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx); 1682 CrossAgentToNewRegionPost(agent, pos, neighbourRegion, isFlying, ctx);
@@ -1706,7 +1700,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1706// agent.Appearance.WearableCacheItems = null; 1700// agent.Appearance.WearableCacheItems = null;
1707 1701
1708 cAgent.Position = pos; 1702 cAgent.Position = pos;
1709
1710 cAgent.ChildrenCapSeeds = agent.KnownRegions; 1703 cAgent.ChildrenCapSeeds = agent.KnownRegions;
1711 1704
1712 if (isFlying) 1705 if (isFlying)
@@ -1787,15 +1780,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1787 capsPath); 1780 capsPath);
1788 } 1781 }
1789 1782
1790/*
1791 // Backwards compatibility. Best effort
1792 if (version == 0f)
1793 {
1794 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
1795 Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
1796 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1797 }
1798*/
1799 // SUCCESS! 1783 // SUCCESS!
1800 m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination); 1784 m_entityTransferStateMachine.UpdateInTransit(agent.UUID, AgentTransferState.ReceivedAtDestination);
1801 1785
@@ -1814,18 +1798,6 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1814 // but not sure yet what the side effects would be. 1798 // but not sure yet what the side effects would be.
1815 m_entityTransferStateMachine.ResetFromTransit(agent.UUID); 1799 m_entityTransferStateMachine.ResetFromTransit(agent.UUID);
1816 1800
1817
1818 // TODO: Check since what version this wasn't needed anymore. May be as old as 0.6
1819/*
1820 // Backwards compatibility. Best effort
1821 if (version == 0f)
1822 {
1823 m_log.DebugFormat("[ENTITY TRANSFER MODULE]: neighbor with old version, passing attachments one by one...");
1824 Thread.Sleep(3000); // wait a little now that we're not waiting for the callback
1825 CrossAttachmentsIntoNewRegion(neighbourRegion, agent, true);
1826 }
1827*/
1828
1829 // the user may change their profile information in other region, 1801 // the user may change their profile information in other region,
1830 // so the userinfo in UserProfileCache is not reliable any more, delete it 1802 // so the userinfo in UserProfileCache is not reliable any more, delete it
1831 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE! 1803 // REFACTORING PROBLEM. Well, not a problem, but this method is HORRIBLE!