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/Framework | |
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/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 54 |
2 files changed, 4 insertions, 52 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs index 5d07a5f..1ebef90 100644 --- a/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IEntityTransferModule.cs | |||
@@ -98,6 +98,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
98 | void Cross(SceneObjectGroup sog, Vector3 position, bool silent); | 98 | void Cross(SceneObjectGroup sog, Vector3 position, bool silent); |
99 | 99 | ||
100 | ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); | 100 | ScenePresence CrossAgentToNewRegionAsync(ScenePresence agent, Vector3 pos, GridRegion neighbourRegion, bool isFlying, string version); |
101 | |||
102 | bool HandleIncomingSceneObject(SceneObjectGroup so, Vector3 newPosition); | ||
101 | } | 103 | } |
102 | 104 | ||
103 | public interface IUserAgentVerificationModule | 105 | public interface IUserAgentVerificationModule |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 7e6f942..171f066 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2623,48 +2623,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2623 | return false; | 2623 | return false; |
2624 | } | 2624 | } |
2625 | 2625 | ||
2626 | // If the user is banned, we won't let any of their objects | 2626 | if (!EntityTransferModule.HandleIncomingSceneObject(newObject, newPosition)) |
2627 | // enter. Period. | 2627 | return false; |
2628 | // | ||
2629 | if (RegionInfo.EstateSettings.IsBanned(newObject.OwnerID)) | ||
2630 | { | ||
2631 | m_log.InfoFormat("[INTERREGION]: Denied prim crossing for banned avatar {0}", newObject.OwnerID); | ||
2632 | return false; | ||
2633 | } | ||
2634 | |||
2635 | if (newPosition != Vector3.Zero) | ||
2636 | newObject.RootPart.GroupPosition = newPosition; | ||
2637 | |||
2638 | if (!AddSceneObject(newObject)) | ||
2639 | { | ||
2640 | m_log.DebugFormat( | ||
2641 | "[INTERREGION]: Problem adding scene object {0} in {1} ", newObject.UUID, RegionInfo.RegionName); | ||
2642 | return false; | ||
2643 | } | ||
2644 | |||
2645 | if (!newObject.IsAttachment) | ||
2646 | { | ||
2647 | // FIXME: It would be better to never add the scene object at all rather than add it and then delete | ||
2648 | // it | ||
2649 | if (!Permissions.CanObjectEntry(newObject.UUID, true, newObject.AbsolutePosition)) | ||
2650 | { | ||
2651 | // Deny non attachments based on parcel settings | ||
2652 | // | ||
2653 | m_log.Info("[INTERREGION]: Denied prim crossing because of parcel settings"); | ||
2654 | |||
2655 | DeleteSceneObject(newObject, false); | ||
2656 | |||
2657 | return false; | ||
2658 | } | ||
2659 | |||
2660 | // For attachments, we need to wait until the agent is root | ||
2661 | // before we restart the scripts, or else some functions won't work. | ||
2662 | newObject.RootPart.ParentGroup.CreateScriptInstances(0, false, DefaultScriptEngine, GetStateSource(newObject)); | ||
2663 | newObject.ResumeScripts(); | ||
2664 | |||
2665 | if (newObject.RootPart.KeyframeMotion != null) | ||
2666 | newObject.RootPart.KeyframeMotion.UpdateSceneObject(newObject); | ||
2667 | } | ||
2668 | 2628 | ||
2669 | // Do this as late as possible so that listeners have full access to the incoming object | 2629 | // Do this as late as possible so that listeners have full access to the incoming object |
2670 | EventManager.TriggerOnIncomingSceneObject(newObject); | 2630 | EventManager.TriggerOnIncomingSceneObject(newObject); |
@@ -2733,16 +2693,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
2733 | return true; | 2693 | return true; |
2734 | } | 2694 | } |
2735 | 2695 | ||
2736 | private int GetStateSource(SceneObjectGroup sog) | ||
2737 | { | ||
2738 | ScenePresence sp = GetScenePresence(sog.OwnerID); | ||
2739 | |||
2740 | if (sp != null) | ||
2741 | return sp.GetStateSource(); | ||
2742 | |||
2743 | return 2; // StateSource.PrimCrossing | ||
2744 | } | ||
2745 | |||
2746 | #endregion | 2696 | #endregion |
2747 | 2697 | ||
2748 | #region Add/Remove Avatar Methods | 2698 | #region Add/Remove Avatar Methods |