From ea56f4f27c6e707b54e0e29d2477ef3af2a8c732 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Sat, 31 Oct 2015 18:13:02 +0100 Subject: Introduce an EntityTransferContext carrying the version numbers to pass to all interested functions. Should fix the varregion conditional. Still a testing version, do NOT use in production! --- OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs | 6 +++--- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 9 +++++---- 2 files changed, 8 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs index 9e91d7d..d07b15a 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs @@ -35,7 +35,7 @@ using OpenSim.Region.Framework.Scenes; namespace OpenSim.Region.Framework.Interfaces { - public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, float version); + public delegate ScenePresence CrossAgentToNewRegionDelegate(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx); public interface IEntityTransferModule { @@ -92,12 +92,12 @@ namespace OpenSim.Region.Framework.Interfaces void EnableChildAgent(ScenePresence agent, GridRegion region); - GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, out float version, + GridRegion GetDestination(Scene scene, UUID agentID, Vector3 pos, EntityTransferContext ctx, out Vector3 newpos, out string reason); void Cross(SceneObjectGroup sog, Vector3 position, bool silent); - ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, float version); + ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, EntityTransferContext ctx); bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition); } diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index 3b13e64..d08237e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -41,6 +41,7 @@ using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.PhysicsModules.SharedBase; using OpenSim.Region.Framework.Scenes.Serialization; using PermissionMask = OpenSim.Framework.PermissionMask; +using OpenSim.Services.Interfaces; namespace OpenSim.Region.Framework.Scenes { @@ -476,7 +477,7 @@ namespace OpenSim.Region.Framework.Scenes ) { IEntityTransferModule entityTransfer = m_scene.RequestModuleInterface(); - float version = 0f; + EntityTransferContext ctx = new EntityTransferContext(); Vector3 newpos = Vector3.Zero; string failureReason = String.Empty; OpenSim.Services.Interfaces.GridRegion destination = null; @@ -496,7 +497,7 @@ namespace OpenSim.Region.Framework.Scenes // We set the avatar position as being the object // position to get the region to send to - if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, out version, out newpos, out failureReason)) == null) + if ((destination = entityTransfer.GetDestination(m_scene, av.UUID, val, ctx, out newpos, out failureReason)) == null) { canCross = false; break; @@ -557,14 +558,14 @@ namespace OpenSim.Region.Framework.Scenes // threads rather than any replace threadpool that we might be using. if (Util.FireAndForgetMethod == FireAndForgetMethod.RegressionTest) { - entityTransfer.CrossAgentToNewRegionAsync(av, val, destination, av.Flying, version); + entityTransfer.CrossAgentToNewRegionAsync(av, val, destination, av.Flying, ctx); CrossAgentToNewRegionCompleted(av); } else { CrossAgentToNewRegionDelegate d = entityTransfer.CrossAgentToNewRegionAsync; d.BeginInvoke( - av, val, destination, av.Flying, version, + av, val, destination, av.Flying, ctx, ar => CrossAgentToNewRegionCompleted(d.EndInvoke(ar)), null); } } -- cgit v1.1