diff options
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index ba88089..09e8204 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -2700,5 +2700,69 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2700 | } | 2700 | } |
2701 | #endregion | 2701 | #endregion |
2702 | 2702 | ||
2703 | public virtual bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition) | ||
2704 | { | ||
2705 | // If the user is banned, we won't let any of their objects | ||
2706 | // enter. Period. | ||
2707 | // | ||
2708 | if (Scene.RegionInfo.EstateSettings.IsBanned(so.OwnerID)) | ||
2709 | { | ||
2710 | m_log.DebugFormat( | ||
2711 | "[ENTITY TRANSFER MODULE]: Denied prim crossing of {0} {1} into {2} for banned avatar {3}", | ||
2712 | so.Name, so.UUID, Scene.Name, so.OwnerID); | ||
2713 | |||
2714 | return false; | ||
2715 | } | ||
2716 | |||
2717 | if (newPosition != Vector3.Zero) | ||
2718 | so.RootPart.GroupPosition = newPosition; | ||
2719 | |||
2720 | if (!Scene.AddSceneObject(so)) | ||
2721 | { | ||
2722 | m_log.DebugFormat( | ||
2723 | "[ENTITY TRANSFER MODULE]: Problem adding scene object {0} {1} into {2} ", | ||
2724 | so.Name, so.UUID, Scene.Name); | ||
2725 | |||
2726 | return false; | ||
2727 | } | ||
2728 | |||
2729 | if (!so.IsAttachment) | ||
2730 | { | ||
2731 | // FIXME: It would be better to never add the scene object at all rather than add it and then delete | ||
2732 | // it | ||
2733 | if (!Scene.Permissions.CanObjectEntry(so.UUID, true, so.AbsolutePosition)) | ||
2734 | { | ||
2735 | // Deny non attachments based on parcel settings | ||
2736 | // | ||
2737 | m_log.Info("[ENTITY TRANSFER MODULE]: Denied prim crossing because of parcel settings"); | ||
2738 | |||
2739 | Scene.DeleteSceneObject(so, false); | ||
2740 | |||
2741 | return false; | ||
2742 | } | ||
2743 | |||
2744 | // For attachments, we need to wait until the agent is root | ||
2745 | // before we restart the scripts, or else some functions won't work. | ||
2746 | so.RootPart.ParentGroup.CreateScriptInstances( | ||
2747 | 0, false, Scene.DefaultScriptEngine, GetStateSource(so)); | ||
2748 | |||
2749 | so.ResumeScripts(); | ||
2750 | |||
2751 | if (so.RootPart.KeyframeMotion != null) | ||
2752 | so.RootPart.KeyframeMotion.UpdateSceneObject(so); | ||
2753 | } | ||
2754 | |||
2755 | return true; | ||
2756 | } | ||
2757 | |||
2758 | private int GetStateSource(SceneObjectGroup sog) | ||
2759 | { | ||
2760 | ScenePresence sp = Scene.GetScenePresence(sog.OwnerID); | ||
2761 | |||
2762 | if (sp != null) | ||
2763 | return sp.GetStateSource(); | ||
2764 | |||
2765 | return 2; // StateSource.PrimCrossing | ||
2766 | } | ||
2703 | } | 2767 | } |
2704 | } | 2768 | } |