diff options
author | Justin Clark-Casey (justincc) | 2014-11-04 16:49:32 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-11-25 23:23:10 +0000 |
commit | 1d19e1bbd0dfc1e7de99652284963d330f04de99 (patch) | |
tree | 5b5f00b05389751d883bb24f3e64467d21de5548 /OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |
parent | Label all threadpool calls being made in core OpenSimulator. This is to add ... (diff) | |
download | opensim-SC_OLD-1d19e1bbd0dfc1e7de99652284963d330f04de99.zip opensim-SC_OLD-1d19e1bbd0dfc1e7de99652284963d330f04de99.tar.gz opensim-SC_OLD-1d19e1bbd0dfc1e7de99652284963d330f04de99.tar.bz2 opensim-SC_OLD-1d19e1bbd0dfc1e7de99652284963d330f04de99.tar.xz |
Add naive implementation of controlled incoming HG attachments to manage load.
Instead of processing all incoming attachment scene object concurrently, process them consecutively to eliminate potential overload from this source.
This is a naive implementation because it does not currently account for slow foreign asset services.
Although it may take longer, this approach may also improve attachment visibility for HG avatars
since the scene object is now always added to the scene after receiving assets from the foreign service and not before.
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 | } |