aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2011-05-04 20:30:33 -0700
committerDiva Canto2011-05-04 20:30:33 -0700
commit6d3493277584e129ec72e7ff83669ce399fb751f (patch)
treeb926d9511b4870d708f3cd53dab25f437ccaeb60 /OpenSim/Region
parentMerge branch 'master' into caps (diff)
parentPut the previous state back in the attachments in case the agent transfer fails. (diff)
downloadopensim-SC_OLD-6d3493277584e129ec72e7ff83669ce399fb751f.zip
opensim-SC_OLD-6d3493277584e129ec72e7ff83669ce399fb751f.tar.gz
opensim-SC_OLD-6d3493277584e129ec72e7ff83669ce399fb751f.tar.bz2
opensim-SC_OLD-6d3493277584e129ec72e7ff83669ce399fb751f.tar.xz
Merge branch 'master' into caps
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs4
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
3 files changed, 20 insertions, 2 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
index b985fbb..e380067 100644
--- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs
@@ -1759,11 +1759,15 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
1759 1759
1760 protected void ReInstantiateScripts(ScenePresence sp) 1760 protected void ReInstantiateScripts(ScenePresence sp)
1761 { 1761 {
1762 int i = 0;
1762 sp.Attachments.ForEach(delegate(SceneObjectGroup sog) 1763 sp.Attachments.ForEach(delegate(SceneObjectGroup sog)
1763 { 1764 {
1765 sog.SetState(sp.InTransitScriptStates[i++], sp.Scene);
1764 sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0); 1766 sog.CreateScriptInstances(0, false, sp.Scene.DefaultScriptEngine, 0);
1765 sog.ResumeScripts(); 1767 sog.ResumeScripts();
1766 }); 1768 });
1769
1770 sp.InTransitScriptStates.Clear();
1767 } 1771 }
1768 #endregion 1772 #endregion
1769 1773
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 6b3df9d..1370b1f 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -371,7 +371,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
371 } 371 }
372 372
373 // This is a hook to do some per-asset post-processing for subclasses that need that 373 // This is a hook to do some per-asset post-processing for subclasses that need that
374 ExportAsset(remoteClient.AgentId, assetID); 374 if (remoteClient != null)
375 ExportAsset(remoteClient.AgentId, assetID);
375 376
376 return assetID; 377 return assetID;
377 } 378 }
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 1e90d56..631c91b 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -232,6 +232,16 @@ namespace OpenSim.Region.Framework.Scenes
232 private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>(); 232 private Dictionary<ulong, string> m_knownChildRegions = new Dictionary<ulong, string>();
233 233
234 /// <summary> 234 /// <summary>
235 /// Copy of the script states while the agent is in transit. This state may
236 /// need to be placed back in case of transfer fail.
237 /// </summary>
238 public List<string> InTransitScriptStates
239 {
240 get { return m_InTransitScriptStates; }
241 }
242 private List<string> m_InTransitScriptStates = new List<string>();
243
244 /// <summary>
235 /// Implemented Control Flags 245 /// Implemented Control Flags
236 /// </summary> 246 /// </summary>
237 private enum Dir_ControlFlags 247 private enum Dir_ControlFlags
@@ -3142,6 +3152,7 @@ namespace OpenSim.Region.Framework.Scenes
3142 cAgent.AttachmentObjects = new List<ISceneObject>(); 3152 cAgent.AttachmentObjects = new List<ISceneObject>();
3143 cAgent.AttachmentObjectStates = new List<string>(); 3153 cAgent.AttachmentObjectStates = new List<string>();
3144 IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>(); 3154 IScriptModule se = m_scene.RequestModuleInterface<IScriptModule>();
3155 m_InTransitScriptStates.Clear();
3145 foreach (SceneObjectGroup sog in m_attachments) 3156 foreach (SceneObjectGroup sog in m_attachments)
3146 { 3157 {
3147 // We need to make a copy and pass that copy 3158 // We need to make a copy and pass that copy
@@ -3151,7 +3162,9 @@ namespace OpenSim.Region.Framework.Scenes
3151 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos; 3162 ((SceneObjectGroup)clone).RootPart.GroupPosition = sog.RootPart.AttachedPos;
3152 ((SceneObjectGroup)clone).RootPart.IsAttachment = false; 3163 ((SceneObjectGroup)clone).RootPart.IsAttachment = false;
3153 cAgent.AttachmentObjects.Add(clone); 3164 cAgent.AttachmentObjects.Add(clone);
3154 cAgent.AttachmentObjectStates.Add(sog.GetStateSnapshot()); 3165 string state = sog.GetStateSnapshot();
3166 cAgent.AttachmentObjectStates.Add(state);
3167 m_InTransitScriptStates.Add(state);
3155 // Let's remove the scripts of the original object here 3168 // Let's remove the scripts of the original object here
3156 sog.RemoveScriptInstances(true); 3169 sog.RemoveScriptInstances(true);
3157 } 3170 }