From f8bd3d2f2ee99c69b3196f55d785c178d97109e5 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Wed, 22 Jun 2016 11:52:53 -0700 Subject: [PATCH] Mantis #7935: regression on transferring attachments over the HG --- .../EntityTransfer/EntityTransferModule.cs | 11 +++-- OpenSim/Region/Framework/Scenes/Scene.cs | 46 +------------------ 2 files changed, 7 insertions(+), 50 deletions(-) diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index e5d725c7e7..8beed938db 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs @@ -1491,7 +1491,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // m_log.DebugFormat( // "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); - // Compute world location of the agente position + // Compute world location of the agent's position double presenceWorldX = (double)scene.RegionInfo.WorldLocX + pos.X; double presenceWorldY = (double)scene.RegionInfo.WorldLocY + pos.Y; @@ -2240,7 +2240,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // needed for current OSG or old grid code - public GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) + protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py) { // Since we don't know how big the regions could be, we have to search a very large area // to find possible regions. @@ -2253,7 +2253,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer // 'pSizeHint' is the size of the source region but since the destination point can be anywhere // the size of the target region is unknown thus the search area might have to be very large. // Return 'null' if no such region exists. - public GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, + protected GridRegion GetRegionContainingWorldLocation(IGridService pGridService, UUID pScopeID, double px, double py, uint pSizeHint) { m_log.DebugFormat("{0} GetRegionContainingWorldLocation: call, XY=<{1},{2}>", LogHeader, px, py); @@ -2795,8 +2795,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer so.ResumeScripts(); - if (so.RootPart.KeyframeMotion != null) - so.RootPart.KeyframeMotion.UpdateSceneObject(so); + // AddSceneObject already does this and doing it again messes + //if (so.RootPart.KeyframeMotion != null) + // so.RootPart.KeyframeMotion.UpdateSceneObject(so); } return true; diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c9c8639c0e..a75b460cd2 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -2954,52 +2954,8 @@ namespace OpenSim.Region.Framework.Scenes return false; } - // If the user is banned, we won't let any of their objects - // enter. Period. - // - if (RegionInfo.EstateSettings.IsBanned(newObject.OwnerID, 36)) - { - m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", newObject.OwnerID); + if (!EntityTransferModule.HandleIncomingSceneObject(newObject, newPosition)) return false; - } - - if (newPosition != Vector3.Zero) - newObject.RootPart.GroupPosition = newPosition; - - if (!AddSceneObject(newObject)) - { - m_log.DebugFormat( - "[INTERREGION]: Problem adding scene object {0} in {1} ", newObject.UUID, RegionInfo.RegionName); - return false; - } - - if (!newObject.IsAttachment) - { - // FIXME: It would be better to never add the scene object at all rather than add it and then delete - // it - if (!Permissions.CanObjectEntry(newObject.UUID, true, newObject.AbsolutePosition)) - { - // Deny non attachments based on parcel settings - // - m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings"); - - DeleteSceneObject(newObject, false); - - return false; - } - - // For attachments, we need to wait until the agent is root - // before we restart the scripts, or else some functions won't work. - newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); - newObject.ResumeScripts(); - - // AddSceneObject already does this and doing it again messes - // up region crossings, so don't. - //if (newObject.RootPart.KeyframeMotion != null) - // newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); - } - - // Do this as late as possible so that listeners have full access to the incoming object EventManager.TriggerOnIncomingSceneObject(newObject);