diff options
author | Justin Clark-Casey (justincc) | 2013-03-28 22:51:59 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-03-28 22:51:59 +0000 |
commit | 4ad9b275302ee109937512963eab095ff542a0c7 (patch) | |
tree | a05aa20cb64a048fd79001386612a31226f36153 | |
parent | Fix regression tests by making a new NPC always trigger simulator side attach... (diff) | |
download | opensim-SC_OLD-4ad9b275302ee109937512963eab095ff542a0c7.zip opensim-SC_OLD-4ad9b275302ee109937512963eab095ff542a0c7.tar.gz opensim-SC_OLD-4ad9b275302ee109937512963eab095ff542a0c7.tar.bz2 opensim-SC_OLD-4ad9b275302ee109937512963eab095ff542a0c7.tar.xz |
If the viewer has already rezzed any attachments itself, then ignore the simulator-side rez attachments call.
This is a further effort to reduce v3 viewer race conditions where this call may clash with the viewer signalling attachment wearing from its current outfit folder.
3 files changed, 19 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index a46834c..55c5422 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -182,10 +182,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
182 | } | 182 | } |
183 | } | 183 | } |
184 | 184 | ||
185 | /// <summary> | ||
186 | /// RezAttachments. This should only be called upon login on the first region. | ||
187 | /// Attachment rezzings on crossings and TPs are done in a different way. | ||
188 | /// </summary> | ||
189 | public void RezAttachments(IScenePresence sp) | 185 | public void RezAttachments(IScenePresence sp) |
190 | { | 186 | { |
191 | if (!Enabled) | 187 | if (!Enabled) |
@@ -194,9 +190,19 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
194 | if (null == sp.Appearance) | 190 | if (null == sp.Appearance) |
195 | { | 191 | { |
196 | m_log.WarnFormat("[ATTACHMENTS MODULE]: Appearance has not been initialized for agent {0}", sp.UUID); | 192 | m_log.WarnFormat("[ATTACHMENTS MODULE]: Appearance has not been initialized for agent {0}", sp.UUID); |
193 | |||
197 | return; | 194 | return; |
198 | } | 195 | } |
199 | 196 | ||
197 | if (sp.GetAttachments().Count > 0) | ||
198 | { | ||
199 | // m_log.DebugFormat( | ||
200 | // "[ATTACHMENTS MODULE]: Not doing simulator-side attachment rez for {0} in {1} as their viewer has already rezzed attachments", | ||
201 | // m_scene.Name, sp.Name); | ||
202 | |||
203 | return; | ||
204 | } | ||
205 | |||
200 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0} from simulator-side", sp.Name); | 206 | // m_log.DebugFormat("[ATTACHMENTS MODULE]: Rezzing any attachments for {0} from simulator-side", sp.Name); |
201 | 207 | ||
202 | List<AvatarAttachment> attachments = sp.Appearance.GetAttachments(); | 208 | List<AvatarAttachment> attachments = sp.Appearance.GetAttachments(); |
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs index 46daab3..156a09d 100644 --- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs | |||
@@ -53,6 +53,10 @@ namespace OpenSim.Region.Framework.Interfaces | |||
53 | /// RezAttachments. This should only be called upon login on the first region. | 53 | /// RezAttachments. This should only be called upon login on the first region. |
54 | /// Attachment rezzings on crossings and TPs are done in a different way. | 54 | /// Attachment rezzings on crossings and TPs are done in a different way. |
55 | /// </summary> | 55 | /// </summary> |
56 | /// <remarks> | ||
57 | /// This is only actually necessary for viewers which do not have a current outfit folder (these viewers make | ||
58 | /// their own attachment calls on login) and agents which have attachments but no viewer (e.g. NPCs). | ||
59 | /// </remarks> | ||
56 | /// <param name="sp"></param> | 60 | /// <param name="sp"></param> |
57 | void RezAttachments(IScenePresence sp); | 61 | void RezAttachments(IScenePresence sp); |
58 | 62 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3a1e758..fcb2f6d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -953,13 +953,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
953 | // haven't started yet. | 953 | // haven't started yet. |
954 | if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0) | 954 | if (PresenceType == PresenceType.Npc || (TeleportFlags & TeleportFlags.ViaLogin) != 0) |
955 | { | 955 | { |
956 | // We leave a 5 second pause before attempting to rez attachments to avoid a clash with | 956 | // Viewers which have a current outfit folder will actually rez their own attachments. However, |
957 | // version 3 viewers that maybe doing their own attachment rezzing related to their current | 957 | // viewers without (e.g. v1 viewers) will not, so we still need to make this call. |
958 | // outfit folder on startup. If these operations do clash, then the symptoms are invisible | 958 | // |
959 | // attachments until one zooms in on the avatar. | 959 | // However, we leave a 5 second pause to try and avoid a clash with viewers that are rezzing |
960 | // | 960 | // attachments themselves. This should then mean that this call ends up doing nothing. |
961 | // We do not pause if we are launching on the same thread anyway in order to avoid pointlessly | ||
962 | // delaying any attachment related regression tests. | ||
963 | if (Scene.AttachmentsModule != null) | 961 | if (Scene.AttachmentsModule != null) |
964 | Util.FireAndForget( | 962 | Util.FireAndForget( |
965 | o => | 963 | o => |