aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2012-06-28 03:21:08 +0100
committerMelanie2012-06-28 03:21:08 +0100
commit41a1903c60475fc2d98b1b11d336a3ecee0bc150 (patch)
tree0e78852eee96e9506b815cea0abbd35ac7da7f1a /OpenSim/Region/Framework
parentMerge branch 'master' into careminster (diff)
parentAvoid reporting false positives when a colon is in a comment in the first lin... (diff)
downloadopensim-SC-41a1903c60475fc2d98b1b11d336a3ecee0bc150.zip
opensim-SC-41a1903c60475fc2d98b1b11d336a3ecee0bc150.tar.gz
opensim-SC-41a1903c60475fc2d98b1b11d336a3ecee0bc150.tar.bz2
opensim-SC-41a1903c60475fc2d98b1b11d336a3ecee0bc150.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Avatar/Attachments/Tests/AttachmentsModuleTests.cs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs14
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScenePresence.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs41
3 files changed, 24 insertions, 37 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
index 70ea7cf..7446530 100644
--- a/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
+++ b/OpenSim/Region/Framework/Interfaces/IAttachmentsModule.cs
@@ -37,6 +37,20 @@ namespace OpenSim.Region.Framework.Interfaces
37 public interface IAttachmentsModule 37 public interface IAttachmentsModule
38 { 38 {
39 /// <summary> 39 /// <summary>
40 /// Copy attachment data from a ScenePresence into the AgentData structure for transmission to another simulator
41 /// </summary>
42 /// <param name='sp'></param>
43 /// <param name='ad'></param>
44 void CopyAttachments(IScenePresence sp, AgentData ad);
45
46 /// <summary>
47 /// Copy attachment data from an AgentData structure into a ScenePresence.
48 /// </summary>
49 /// <param name='ad'></param>
50 /// <param name='sp'></param>
51 void CopyAttachments(AgentData ad, IScenePresence sp);
52
53 /// <summary>
40 /// RezAttachments. This should only be called upon login on the first region. 54 /// RezAttachments. This should only be called upon login on the first region.
41 /// Attachment rezzings on crossings and TPs are done in a different way. 55 /// Attachment rezzings on crossings and TPs are done in a different way.
42 /// </summary> 56 /// </summary>
diff --git a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
index 5e43843..19a8236 100644
--- a/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScenePresence.cs
@@ -41,6 +41,12 @@ namespace OpenSim.Region.Framework.Interfaces
41 public interface IScenePresence : ISceneAgent 41 public interface IScenePresence : ISceneAgent
42 { 42 {
43 /// <summary> 43 /// <summary>
44 /// Copy of the script states while the agent is in transit. This state may
45 /// need to be placed back in case of transfer fail.
46 /// </summary>
47 List<string> InTransitScriptStates { get; }
48
49 /// <summary>
44 /// The AttachmentsModule synchronizes on this to avoid race conditions between commands to add and remove attachments. 50 /// The AttachmentsModule synchronizes on this to avoid race conditions between commands to add and remove attachments.
45 /// </summary> 51 /// </summary>
46 /// <remarks> 52 /// <remarks>
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f3e8377..159a92a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3279,31 +3279,8 @@ namespace OpenSim.Region.Framework.Scenes
3279 catch { } 3279 catch { }
3280 cAgent.DefaultAnim = Animator.Animations.DefaultAnimation; 3280 cAgent.DefaultAnim = Animator.Animations.DefaultAnimation;
3281 3281
3282 // Attachment objects 3282 if (Scene.AttachmentsModule != null)
3283 List<SceneObjectGroup> attachments = GetAttachments(); 3283 Scene.AttachmentsModule.CopyAttachments(this, cAgent);
3284 if (attachments.Count > 0)
3285 {
3286 cAgent.AttachmentObjects = new List<ISceneObject>();
3287 cAgent.AttachmentObjectStates = new List<string>();
3288// IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
3289 InTransitScriptStates.Clear();
3290
3291 foreach (SceneObjectGroup sog in attachments)
3292 {
3293 // We need to make a copy and pass that copy
3294 // because of transfers withn the same sim
3295 ISceneObject clone = sog.CloneForNewScene();
3296 // Attachment module assumes that GroupPosition holds the offsets...!
3297 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
3298 ((SceneObjectGroup)clone).IsAttachment = false;
3299 cAgent.AttachmentObjects.Add(clone);
3300 string state = sog.GetStateSnapshot();
3301 cAgent.AttachmentObjectStates.Add(state);
3302 InTransitScriptStates.Add(state);
3303 // Let's remove the scripts of the original object here
3304 sog.RemoveScriptInstances(true);
3305 }
3306 }
3307 } 3284 }
3308 3285
3309 private void CopyFrom(AgentData cAgent) 3286 private void CopyFrom(AgentData cAgent)
@@ -3378,18 +3355,8 @@ namespace OpenSim.Region.Framework.Scenes
3378 if (cAgent.DefaultAnim != null) 3355 if (cAgent.DefaultAnim != null)
3379 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero); 3356 Animator.Animations.SetDefaultAnimation(cAgent.DefaultAnim.AnimID, cAgent.DefaultAnim.SequenceNum, UUID.Zero);
3380 3357
3381 if (cAgent.AttachmentObjects != null && cAgent.AttachmentObjects.Count > 0) 3358 if (Scene.AttachmentsModule != null)
3382 { 3359 Scene.AttachmentsModule.CopyAttachments(cAgent, this);
3383 m_attachments = new List<SceneObjectGroup>();
3384 int i = 0;
3385 foreach (ISceneObject so in cAgent.AttachmentObjects)
3386 {
3387 ((SceneObjectGroup)so).LocalId = 0;
3388 ((SceneObjectGroup)so).RootPart.ClearUpdateSchedule();
3389 so.SetState(cAgent.AttachmentObjectStates[i++], m_scene);
3390 m_scene.IncomingCreateObject(Vector3.Zero, so);
3391 }
3392 }
3393 } 3360 }
3394 3361
3395 public bool CopyAgent(out IAgentData agent) 3362 public bool CopyAgent(out IAgentData agent)