diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 46 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 20 |
2 files changed, 20 insertions, 46 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! |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index eac7cbc..c375450 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -4206,19 +4206,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
4206 | { | 4206 | { |
4207 | // we don't have entity transfer module | 4207 | // we don't have entity transfer module |
4208 | Vector3 pos = AbsolutePosition; | 4208 | Vector3 pos = AbsolutePosition; |
4209 | vel = Velocity; | ||
4209 | float px = pos.X; | 4210 | float px = pos.X; |
4210 | if (px < 0) | 4211 | if (px < 0) |
4211 | pos.X += Velocity.X * 2; | 4212 | pos.X += vel.X * 2; |
4212 | else if (px > m_scene.RegionInfo.RegionSizeX) | 4213 | else if (px > m_scene.RegionInfo.RegionSizeX) |
4213 | pos.X -= Velocity.X * 2; | 4214 | pos.X -= vel.X * 2; |
4214 | 4215 | ||
4215 | float py = pos.Y; | 4216 | float py = pos.Y; |
4216 | if (py < 0) | 4217 | if (py < 0) |
4217 | pos.Y += Velocity.Y * 2; | 4218 | pos.Y += vel.Y * 2; |
4218 | else if (py > m_scene.RegionInfo.RegionSizeY) | 4219 | else if (py > m_scene.RegionInfo.RegionSizeY) |
4219 | pos.Y -= Velocity.Y * 2; | 4220 | pos.Y -= vel.Y * 2; |
4220 | 4221 | ||
4221 | Velocity = Vector3.Zero; | 4222 | Velocity = Vector3.Zero; |
4223 | m_AngularVelocity = Vector3.Zero; | ||
4222 | AbsolutePosition = pos; | 4224 | AbsolutePosition = pos; |
4223 | } | 4225 | } |
4224 | } | 4226 | } |
@@ -4231,21 +4233,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
4231 | RemoveFromPhysicalScene(); | 4233 | RemoveFromPhysicalScene(); |
4232 | 4234 | ||
4233 | Vector3 pos = AbsolutePosition; | 4235 | Vector3 pos = AbsolutePosition; |
4236 | Vector3 vel = Velocity; | ||
4234 | float px = pos.X; | 4237 | float px = pos.X; |
4235 | if (px < 0) | 4238 | if (px < 0) |
4236 | pos.X += Velocity.X * 2; | 4239 | pos.X += vel.X * 2; |
4237 | else if (px > m_scene.RegionInfo.RegionSizeX) | 4240 | else if (px > m_scene.RegionInfo.RegionSizeX) |
4238 | pos.X -= Velocity.X * 2; | 4241 | pos.X -= vel.X * 2; |
4239 | 4242 | ||
4240 | float py = pos.Y; | 4243 | float py = pos.Y; |
4241 | if (py < 0) | 4244 | if (py < 0) |
4242 | pos.Y += Velocity.Y * 2; | 4245 | pos.Y += vel.Y * 2; |
4243 | else if (py > m_scene.RegionInfo.RegionSizeY) | 4246 | else if (py > m_scene.RegionInfo.RegionSizeY) |
4244 | pos.Y -= Velocity.Y * 2; | 4247 | pos.Y -= vel.Y * 2; |
4245 | 4248 | ||
4246 | Velocity = Vector3.Zero; | 4249 | Velocity = Vector3.Zero; |
4247 | m_AngularVelocity = Vector3.Zero; | 4250 | m_AngularVelocity = Vector3.Zero; |
4248 | |||
4249 | AbsolutePosition = pos; | 4251 | AbsolutePosition = pos; |
4250 | 4252 | ||
4251 | AddToPhysicalScene(isFlying); | 4253 | AddToPhysicalScene(isFlying); |