aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorDiva Canto2011-05-04 12:04:35 -0700
committerDiva Canto2011-05-04 12:04:35 -0700
commit6c503e75acb459e4cdda423bbfbf4cb22611315e (patch)
treee01ebff20708bd4b27cf4aafabc86624339f08d9 /OpenSim/Region/Framework
parentFixes mantis #5461. (diff)
downloadopensim-SC-6c503e75acb459e4cdda423bbfbf4cb22611315e.zip
opensim-SC-6c503e75acb459e4cdda423bbfbf4cb22611315e.tar.gz
opensim-SC-6c503e75acb459e4cdda423bbfbf4cb22611315e.tar.bz2
opensim-SC-6c503e75acb459e4cdda423bbfbf4cb22611315e.tar.xz
Put the previous state back in the attachments in case the agent transfer fails.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs15
1 files changed, 14 insertions, 1 deletions
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 }