diff options
author | Justin Clark-Casey (justincc) | 2013-08-02 00:00:00 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-08-02 00:00:00 +0100 |
commit | c9695a0a59cba91a184683efaa7802338d68e4bd (patch) | |
tree | fb080c5ba8361478f224d887fb3afd7a834196bf /OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.zip opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.tar.gz opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.tar.bz2 opensim-SC_OLD-c9695a0a59cba91a184683efaa7802338d68e4bd.tar.xz |
Move experimental attachments throttling further down the chain so that multiple attachments changes (e.g. change outfit) are also throttled
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 97477d4..675fccc 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -53,8 +53,8 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
53 | public int DebugLevel { get; set; } | 53 | public int DebugLevel { get; set; } |
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// Period to sleep per 100 prims in order to avoid CPU spikes when an avatar with many attachments logs in | 56 | /// Period to sleep per 100 prims in order to avoid CPU spikes when an avatar with many attachments logs in/changes |
57 | /// or many avatars with a medium levels of attachments login simultaneously. | 57 | /// outfit or many avatars with a medium levels of attachments login/change outfit simultaneously. |
58 | /// </summary> | 58 | /// </summary> |
59 | /// <remarks> | 59 | /// <remarks> |
60 | /// A value of 0 will apply no pause. The pause is specified in milliseconds. | 60 | /// A value of 0 will apply no pause. The pause is specified in milliseconds. |
@@ -319,19 +319,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
319 | SceneObjectGroup objatt | 319 | SceneObjectGroup objatt |
320 | = RezSingleAttachmentFromInventoryInternal( | 320 | = RezSingleAttachmentFromInventoryInternal( |
321 | sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true); | 321 | sp, sp.PresenceType == PresenceType.Npc ? UUID.Zero : attach.ItemID, attach.AssetID, attachmentPt, true); |
322 | |||
323 | |||
324 | if (ThrottlePer100PrimsRezzed > 0) | ||
325 | { | ||
326 | int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed); | ||
327 | |||
328 | if (DebugLevel > 0) | ||
329 | m_log.DebugFormat( | ||
330 | "[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}", | ||
331 | throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name); | ||
332 | |||
333 | Thread.Sleep(throttleMs); | ||
334 | } | ||
335 | } | 322 | } |
336 | catch (Exception e) | 323 | catch (Exception e) |
337 | { | 324 | { |
@@ -1023,7 +1010,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
1023 | } | 1010 | } |
1024 | 1011 | ||
1025 | if (tainted) | 1012 | if (tainted) |
1026 | objatt.HasGroupChanged = true; | 1013 | objatt.HasGroupChanged = true; |
1014 | |||
1015 | if (ThrottlePer100PrimsRezzed > 0) | ||
1016 | { | ||
1017 | int throttleMs = (int)Math.Round((float)objatt.PrimCount / 100 * ThrottlePer100PrimsRezzed); | ||
1018 | |||
1019 | if (DebugLevel > 0) | ||
1020 | m_log.DebugFormat( | ||
1021 | "[ATTACHMENTS MODULE]: Throttling by {0}ms after rez of {1} with {2} prims for attachment to {3} on point {4} in {5}", | ||
1022 | throttleMs, objatt.Name, objatt.PrimCount, sp.Name, attachmentPt, m_scene.Name); | ||
1023 | |||
1024 | Thread.Sleep(throttleMs); | ||
1025 | } | ||
1027 | 1026 | ||
1028 | return objatt; | 1027 | return objatt; |
1029 | } | 1028 | } |