diff options
Diffstat (limited to 'OpenSim/Region/Framework')
5 files changed, 62 insertions, 34 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index f11e571..98efcbe 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -35,7 +35,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
35 | string ScriptEngineName { get; } | 35 | string ScriptEngineName { get; } |
36 | 36 | ||
37 | string GetXMLState(UUID itemID); | 37 | string GetXMLState(UUID itemID); |
38 | void SetXMLState(UUID itemID, string xml); | 38 | bool SetXMLState(UUID itemID, string xml); |
39 | 39 | ||
40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); | 40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); |
41 | bool PostObjectEvent(UUID itemID, string name, Object[] args); | 41 | bool PostObjectEvent(UUID itemID, string name, Object[] args); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 20cae5d..265129c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -1328,7 +1328,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1328 | maintc = Util.EnvironmentTickCountSubtract(maintc); | 1328 | maintc = Util.EnvironmentTickCountSubtract(maintc); |
1329 | maintc = (int)(m_timespan * 1000) - maintc; | 1329 | maintc = (int)(m_timespan * 1000) - maintc; |
1330 | 1330 | ||
1331 | if ((maintc < (m_timespan * 1000)) && maintc > 0) | 1331 | if (maintc > 0) |
1332 | Thread.Sleep(maintc); | 1332 | Thread.Sleep(maintc); |
1333 | 1333 | ||
1334 | // Tell the watchdog that this thread is still alive | 1334 | // Tell the watchdog that this thread is still alive |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 4495eda..0eddbfd 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -513,24 +513,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
513 | { | 513 | { |
514 | // If this is a linkset, we don't want the physics engine mucking up our group position here. | 514 | // If this is a linkset, we don't want the physics engine mucking up our group position here. |
515 | PhysicsActor actor = PhysActor; | 515 | PhysicsActor actor = PhysActor; |
516 | |||
517 | if (actor != null && _parentID == 0) | 516 | if (actor != null && _parentID == 0) |
518 | { | 517 | { |
519 | m_groupPosition = actor.Position; | 518 | m_groupPosition = actor.Position; |
520 | } | ||
521 | /* | ||
522 | if (actor != null) | ||
523 | { | ||
524 | if (_parentID == 0) | ||
525 | { | ||
526 | m_groupPosition = actor.Position; | ||
527 | } | ||
528 | else | ||
529 | { | ||
530 | m_groupPosition = ParentGroup.AbsolutePosition; // KF+Casper Update Child prims too! | ||
531 | } | ||
532 | } | 519 | } |
533 | */ | 520 | |
534 | if (IsAttachment) | 521 | if (IsAttachment) |
535 | { | 522 | { |
536 | ScenePresence sp = m_parentGroup.Scene.GetScenePresence(AttachedAvatar); | 523 | ScenePresence sp = m_parentGroup.Scene.GetScenePresence(AttachedAvatar); |
@@ -545,7 +532,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
545 | StoreUndoState(); | 532 | StoreUndoState(); |
546 | 533 | ||
547 | m_groupPosition = value; | 534 | m_groupPosition = value; |
548 | |||
549 | PhysicsActor actor = PhysActor; | 535 | PhysicsActor actor = PhysActor; |
550 | if (actor != null) | 536 | if (actor != null) |
551 | { | 537 | { |
@@ -1755,16 +1741,17 @@ namespace OpenSim.Region.Framework.Scenes | |||
1755 | public Vector3 GetWorldPosition() | 1741 | public Vector3 GetWorldPosition() |
1756 | { | 1742 | { |
1757 | Quaternion parentRot = ParentGroup.RootPart.RotationOffset; | 1743 | Quaternion parentRot = ParentGroup.RootPart.RotationOffset; |
1758 | |||
1759 | Vector3 axPos = OffsetPosition; | 1744 | Vector3 axPos = OffsetPosition; |
1760 | axPos *= parentRot; | 1745 | axPos *= parentRot; |
1761 | Vector3 translationOffsetPosition = axPos; | 1746 | Vector3 translationOffsetPosition = axPos; |
1762 | 1747 | if(_parentID == 0) | |
1763 | int tx = (int)GroupPosition.X; | 1748 | { |
1764 | int ty = (int)GroupPosition.Y; | 1749 | return GroupPosition; |
1765 | int tz = (int)GroupPosition.Z; | 1750 | } |
1766 | 1751 | else | |
1767 | return GroupPosition + translationOffsetPosition; | 1752 | { |
1753 | return ParentGroup.AbsolutePosition + translationOffsetPosition; //KF: Fix child prim position | ||
1754 | } | ||
1768 | } | 1755 | } |
1769 | 1756 | ||
1770 | /// <summary> | 1757 | /// <summary> |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs index b57d912..0321c41 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPartInventory.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Xml; | ||
29 | using System.IO; | 30 | using System.IO; |
30 | using System.Collections.Generic; | 31 | using System.Collections.Generic; |
31 | using System.Reflection; | 32 | using System.Reflection; |
@@ -295,15 +296,55 @@ namespace OpenSim.Region.Framework.Scenes | |||
295 | 296 | ||
296 | private void RestoreSavedScriptState(UUID oldID, UUID newID) | 297 | private void RestoreSavedScriptState(UUID oldID, UUID newID) |
297 | { | 298 | { |
299 | IScriptModule[] engines = m_part.ParentGroup.Scene.RequestModuleInterfaces<IScriptModule>(); | ||
300 | if (engines == null) // No engine at all | ||
301 | return; | ||
302 | |||
298 | if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) | 303 | if (m_part.ParentGroup.m_savedScriptState.ContainsKey(oldID)) |
299 | { | 304 | { |
300 | string fpath = Path.Combine("ScriptEngines/"+m_part.ParentGroup.Scene.RegionInfo.RegionID.ToString(), | 305 | XmlDocument doc = new XmlDocument(); |
301 | newID.ToString()+".state"); | 306 | |
302 | FileStream fs = File.Create(fpath); | 307 | doc.LoadXml(m_part.ParentGroup.m_savedScriptState[oldID]); |
303 | Byte[] buffer = enc.GetBytes(m_part.ParentGroup.m_savedScriptState[oldID]); | 308 | |
304 | fs.Write(buffer,0,buffer.Length); | 309 | ////////// CRUFT WARNING /////////////////////////////////// |
305 | fs.Close(); | 310 | // |
306 | m_part.ParentGroup.m_savedScriptState.Remove(oldID); | 311 | // Old objects will have <ScriptState><State> ... |
312 | // This format is XEngine ONLY | ||
313 | // | ||
314 | // New objects have <State Engine="...." ...><ScriptState>... | ||
315 | // This can be passed to any engine | ||
316 | // | ||
317 | XmlNode n = doc.SelectSingleNode("ScriptState"); | ||
318 | if (n != null) // Old format data | ||
319 | { | ||
320 | XmlDocument newDoc = new XmlDocument(); | ||
321 | |||
322 | XmlElement rootN = newDoc.CreateElement("", "State", ""); | ||
323 | XmlAttribute uuidA = newDoc.CreateAttribute("", "UUID", ""); | ||
324 | uuidA.Value = oldID.ToString(); | ||
325 | rootN.Attributes.Append(uuidA); | ||
326 | XmlAttribute engineA = newDoc.CreateAttribute("", "Engine", ""); | ||
327 | engineA.Value = "XEngine"; | ||
328 | rootN.Attributes.Append(engineA); | ||
329 | |||
330 | newDoc.AppendChild(rootN); | ||
331 | |||
332 | XmlNode stateN = newDoc.ImportNode(n, true); | ||
333 | rootN.AppendChild(stateN); | ||
334 | |||
335 | // This created document has only the minimun data | ||
336 | // necessary for XEngine to parse it successfully | ||
337 | |||
338 | m_part.ParentGroup.m_savedScriptState[oldID] = newDoc.OuterXml; | ||
339 | } | ||
340 | foreach (IScriptModule e in engines) | ||
341 | { | ||
342 | if (e != null) | ||
343 | { | ||
344 | if (e.SetXMLState(newID, m_part.ParentGroup.m_savedScriptState[oldID])) | ||
345 | break; | ||
346 | } | ||
347 | } | ||
307 | } | 348 | } |
308 | } | 349 | } |
309 | 350 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index abdd1a0..a3ad7ca 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -129,7 +129,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
129 | private Vector3? m_forceToApply; | 129 | private Vector3? m_forceToApply; |
130 | private uint m_requestedSitTargetID; | 130 | private uint m_requestedSitTargetID; |
131 | private UUID m_requestedSitTargetUUID; | 131 | private UUID m_requestedSitTargetUUID; |
132 | private Vector3 m_requestedSitOffset; | 132 | |
133 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; | 133 | private SendCourseLocationsMethod m_sendCourseLocationsMethod; |
134 | 134 | ||
135 | private bool m_startAnimationSet; | 135 | private bool m_startAnimationSet; |
@@ -1926,7 +1926,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1926 | m_nextSitAnimation = part.SitAnimation; | 1926 | m_nextSitAnimation = part.SitAnimation; |
1927 | } | 1927 | } |
1928 | m_requestedSitTargetID = part.LocalId; | 1928 | m_requestedSitTargetID = part.LocalId; |
1929 | m_requestedSitOffset = offset; | 1929 | //m_requestedSitOffset = offset; |
1930 | m_requestedSitTargetUUID = targetID; | 1930 | m_requestedSitTargetUUID = targetID; |
1931 | 1931 | ||
1932 | m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); | 1932 | m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); |
@@ -2159,7 +2159,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2159 | if (part != null) | 2159 | if (part != null) |
2160 | { | 2160 | { |
2161 | m_requestedSitTargetID = part.LocalId; | 2161 | m_requestedSitTargetID = part.LocalId; |
2162 | m_requestedSitOffset = offset; | 2162 | //m_requestedSitOffset = offset; |
2163 | m_requestedSitTargetUUID = targetID; | 2163 | m_requestedSitTargetUUID = targetID; |
2164 | 2164 | ||
2165 | m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); | 2165 | m_log.DebugFormat("[SIT]: Client requested Sit Position: {0}", offset); |