aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs8
-rw-r--r--OpenSim/Framework/Serialization/External/LandDataSerializer.cs10
-rw-r--r--OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs44
-rw-r--r--OpenSim/Framework/Util.cs10
-rw-r--r--OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs6
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs1
-rw-r--r--OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs11
-rw-r--r--OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs517
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.Inventory.cs100
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs159
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs3
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs44
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs20
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs7
-rw-r--r--OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs360
-rw-r--r--OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs81
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs51
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs1
20 files changed, 921 insertions, 517 deletions
diff --git a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
index db46ea8..6debf65 100644
--- a/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
+++ b/OpenSim/Framework/Serialization/External/ExternalRepresentationUtils.cs
@@ -51,7 +51,7 @@ namespace OpenSim.Framework.Serialization.External
51 /// <param name="xtr"></param> 51 /// <param name="xtr"></param>
52 /// <returns>true on successful, false if there were any processing failures</returns> 52 /// <returns>true on successful, false if there were any processing failures</returns>
53 public static bool ExecuteReadProcessors<NodeType>( 53 public static bool ExecuteReadProcessors<NodeType>(
54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlTextReader>> processors, XmlTextReader xtr) 54 NodeType nodeToFill, Dictionary<string, Action<NodeType, XmlReader>> processors, XmlReader xtr)
55 { 55 {
56 return ExecuteReadProcessors( 56 return ExecuteReadProcessors(
57 nodeToFill, 57 nodeToFill,
@@ -75,8 +75,8 @@ namespace OpenSim.Framework.Serialization.External
75 /// <returns>true on successful, false if there were any processing failures</returns> 75 /// <returns>true on successful, false if there were any processing failures</returns>
76 public static bool ExecuteReadProcessors<NodeType>( 76 public static bool ExecuteReadProcessors<NodeType>(
77 NodeType nodeToFill, 77 NodeType nodeToFill,
78 Dictionary<string, Action<NodeType, XmlTextReader>> processors, 78 Dictionary<string, Action<NodeType, XmlReader>> processors,
79 XmlTextReader xtr, 79 XmlReader xtr,
80 Action<NodeType, string, Exception> parseExceptionAction) 80 Action<NodeType, string, Exception> parseExceptionAction)
81 { 81 {
82 bool errors = false; 82 bool errors = false;
@@ -88,7 +88,7 @@ namespace OpenSim.Framework.Serialization.External
88 88
89// m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName); 89// m_log.DebugFormat("[ExternalRepresentationUtils]: Processing: {0}", nodeName);
90 90
91 Action<NodeType, XmlTextReader> p = null; 91 Action<NodeType, XmlReader> p = null;
92 if (processors.TryGetValue(xtr.Name, out p)) 92 if (processors.TryGetValue(xtr.Name, out p))
93 { 93 {
94// m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName); 94// m_log.DebugFormat("[ExternalRepresentationUtils]: Found {0} processor, nodeName);
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
index 4b5326a..e42d56f 100644
--- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
@@ -44,11 +44,11 @@ namespace OpenSim.Framework.Serialization.External
44 { 44 {
45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 46
47 private static Dictionary<string, Action<LandData, XmlTextReader>> m_ldProcessors 47 private static Dictionary<string, Action<LandData, XmlReader>> m_ldProcessors
48 = new Dictionary<string, Action<LandData, XmlTextReader>>(); 48 = new Dictionary<string, Action<LandData, XmlReader>>();
49 49
50 private static Dictionary<string, Action<LandAccessEntry, XmlTextReader>> m_laeProcessors 50 private static Dictionary<string, Action<LandAccessEntry, XmlReader>> m_laeProcessors
51 = new Dictionary<string, Action<LandAccessEntry, XmlTextReader>>(); 51 = new Dictionary<string, Action<LandAccessEntry, XmlReader>>();
52 52
53 static LandDataSerializer() 53 static LandDataSerializer()
54 { 54 {
@@ -134,7 +134,7 @@ namespace OpenSim.Framework.Serialization.External
134 "AccessList", (lae, xtr) => lae.Flags = (AccessList)Convert.ToUInt32(xtr.ReadElementString("AccessList"))); 134 "AccessList", (lae, xtr) => lae.Flags = (AccessList)Convert.ToUInt32(xtr.ReadElementString("AccessList")));
135 } 135 }
136 136
137 public static void ProcessParcelAccessList(LandData ld, XmlTextReader xtr) 137 public static void ProcessParcelAccessList(LandData ld, XmlReader xtr)
138 { 138 {
139 if (!xtr.IsEmptyElement) 139 if (!xtr.IsEmptyElement)
140 { 140 {
diff --git a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
index 135cefb..994cede 100644
--- a/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/UserInventoryItemSerializer.cs
@@ -46,8 +46,8 @@ namespace OpenSim.Framework.Serialization.External
46 { 46 {
47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private static Dictionary<string, Action<InventoryItemBase, XmlTextReader>> m_InventoryItemXmlProcessors 49 private static Dictionary<string, Action<InventoryItemBase, XmlReader>> m_InventoryItemXmlProcessors
50 = new Dictionary<string, Action<InventoryItemBase, XmlTextReader>>(); 50 = new Dictionary<string, Action<InventoryItemBase, XmlReader>>();
51 51
52 #region InventoryItemBase Processor initialization 52 #region InventoryItemBase Processor initialization
53 static UserInventoryItemSerializer() 53 static UserInventoryItemSerializer()
@@ -76,103 +76,103 @@ namespace OpenSim.Framework.Serialization.External
76 #endregion 76 #endregion
77 77
78 #region InventoryItemBase Processors 78 #region InventoryItemBase Processors
79 private static void ProcessName(InventoryItemBase item, XmlTextReader reader) 79 private static void ProcessName(InventoryItemBase item, XmlReader reader)
80 { 80 {
81 item.Name = reader.ReadElementContentAsString("Name", String.Empty); 81 item.Name = reader.ReadElementContentAsString("Name", String.Empty);
82 } 82 }
83 83
84 private static void ProcessID(InventoryItemBase item, XmlTextReader reader) 84 private static void ProcessID(InventoryItemBase item, XmlReader reader)
85 { 85 {
86 item.ID = Util.ReadUUID(reader, "ID"); 86 item.ID = Util.ReadUUID(reader, "ID");
87 } 87 }
88 88
89 private static void ProcessInvType(InventoryItemBase item, XmlTextReader reader) 89 private static void ProcessInvType(InventoryItemBase item, XmlReader reader)
90 { 90 {
91 item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty); 91 item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty);
92 } 92 }
93 93
94 private static void ProcessCreatorUUID(InventoryItemBase item, XmlTextReader reader) 94 private static void ProcessCreatorUUID(InventoryItemBase item, XmlReader reader)
95 { 95 {
96 item.CreatorId = reader.ReadElementContentAsString("CreatorUUID", String.Empty); 96 item.CreatorId = reader.ReadElementContentAsString("CreatorUUID", String.Empty);
97 } 97 }
98 98
99 private static void ProcessCreatorID(InventoryItemBase item, XmlTextReader reader) 99 private static void ProcessCreatorID(InventoryItemBase item, XmlReader reader)
100 { 100 {
101 // when it exists, this overrides the previous 101 // when it exists, this overrides the previous
102 item.CreatorId = reader.ReadElementContentAsString("CreatorID", String.Empty); 102 item.CreatorId = reader.ReadElementContentAsString("CreatorID", String.Empty);
103 } 103 }
104 104
105 private static void ProcessCreationDate(InventoryItemBase item, XmlTextReader reader) 105 private static void ProcessCreationDate(InventoryItemBase item, XmlReader reader)
106 { 106 {
107 item.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty); 107 item.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty);
108 } 108 }
109 109
110 private static void ProcessOwner(InventoryItemBase item, XmlTextReader reader) 110 private static void ProcessOwner(InventoryItemBase item, XmlReader reader)
111 { 111 {
112 item.Owner = Util.ReadUUID(reader, "Owner"); 112 item.Owner = Util.ReadUUID(reader, "Owner");
113 } 113 }
114 114
115 private static void ProcessDescription(InventoryItemBase item, XmlTextReader reader) 115 private static void ProcessDescription(InventoryItemBase item, XmlReader reader)
116 { 116 {
117 item.Description = reader.ReadElementContentAsString("Description", String.Empty); 117 item.Description = reader.ReadElementContentAsString("Description", String.Empty);
118 } 118 }
119 119
120 private static void ProcessAssetType(InventoryItemBase item, XmlTextReader reader) 120 private static void ProcessAssetType(InventoryItemBase item, XmlReader reader)
121 { 121 {
122 item.AssetType = reader.ReadElementContentAsInt("AssetType", String.Empty); 122 item.AssetType = reader.ReadElementContentAsInt("AssetType", String.Empty);
123 } 123 }
124 124
125 private static void ProcessAssetID(InventoryItemBase item, XmlTextReader reader) 125 private static void ProcessAssetID(InventoryItemBase item, XmlReader reader)
126 { 126 {
127 item.AssetID = Util.ReadUUID(reader, "AssetID"); 127 item.AssetID = Util.ReadUUID(reader, "AssetID");
128 } 128 }
129 129
130 private static void ProcessSaleType(InventoryItemBase item, XmlTextReader reader) 130 private static void ProcessSaleType(InventoryItemBase item, XmlReader reader)
131 { 131 {
132 item.SaleType = (byte)reader.ReadElementContentAsInt("SaleType", String.Empty); 132 item.SaleType = (byte)reader.ReadElementContentAsInt("SaleType", String.Empty);
133 } 133 }
134 134
135 private static void ProcessSalePrice(InventoryItemBase item, XmlTextReader reader) 135 private static void ProcessSalePrice(InventoryItemBase item, XmlReader reader)
136 { 136 {
137 item.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty); 137 item.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty);
138 } 138 }
139 139
140 private static void ProcessBasePermissions(InventoryItemBase item, XmlTextReader reader) 140 private static void ProcessBasePermissions(InventoryItemBase item, XmlReader reader)
141 { 141 {
142 item.BasePermissions = (uint)reader.ReadElementContentAsInt("BasePermissions", String.Empty); 142 item.BasePermissions = (uint)reader.ReadElementContentAsInt("BasePermissions", String.Empty);
143 } 143 }
144 144
145 private static void ProcessCurrentPermissions(InventoryItemBase item, XmlTextReader reader) 145 private static void ProcessCurrentPermissions(InventoryItemBase item, XmlReader reader)
146 { 146 {
147 item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty); 147 item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty);
148 } 148 }
149 149
150 private static void ProcessEveryOnePermissions(InventoryItemBase item, XmlTextReader reader) 150 private static void ProcessEveryOnePermissions(InventoryItemBase item, XmlReader reader)
151 { 151 {
152 item.EveryOnePermissions = (uint)reader.ReadElementContentAsInt("EveryOnePermissions", String.Empty); 152 item.EveryOnePermissions = (uint)reader.ReadElementContentAsInt("EveryOnePermissions", String.Empty);
153 } 153 }
154 154
155 private static void ProcessNextPermissions(InventoryItemBase item, XmlTextReader reader) 155 private static void ProcessNextPermissions(InventoryItemBase item, XmlReader reader)
156 { 156 {
157 item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty); 157 item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty);
158 } 158 }
159 159
160 private static void ProcessFlags(InventoryItemBase item, XmlTextReader reader) 160 private static void ProcessFlags(InventoryItemBase item, XmlReader reader)
161 { 161 {
162 item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty); 162 item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty);
163 } 163 }
164 164
165 private static void ProcessGroupID(InventoryItemBase item, XmlTextReader reader) 165 private static void ProcessGroupID(InventoryItemBase item, XmlReader reader)
166 { 166 {
167 item.GroupID = Util.ReadUUID(reader, "GroupID"); 167 item.GroupID = Util.ReadUUID(reader, "GroupID");
168 } 168 }
169 169
170 private static void ProcessGroupOwned(InventoryItemBase item, XmlTextReader reader) 170 private static void ProcessGroupOwned(InventoryItemBase item, XmlReader reader)
171 { 171 {
172 item.GroupOwned = Util.ReadBoolean(reader); 172 item.GroupOwned = Util.ReadBoolean(reader);
173 } 173 }
174 174
175 private static void ProcessCreatorData(InventoryItemBase item, XmlTextReader reader) 175 private static void ProcessCreatorData(InventoryItemBase item, XmlReader reader)
176 { 176 {
177 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty); 177 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
178 } 178 }
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 2d0178e..2c38571 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -2605,7 +2605,7 @@ namespace OpenSim.Framework
2605 } 2605 }
2606 2606
2607 #region Xml Serialization Utilities 2607 #region Xml Serialization Utilities
2608 public static bool ReadBoolean(XmlTextReader reader) 2608 public static bool ReadBoolean(XmlReader reader)
2609 { 2609 {
2610 // AuroraSim uses "int" for some fields that are boolean in OpenSim, e.g. "PassCollisions". Don't fail because of this. 2610 // AuroraSim uses "int" for some fields that are boolean in OpenSim, e.g. "PassCollisions". Don't fail because of this.
2611 reader.ReadStartElement(); 2611 reader.ReadStartElement();
@@ -2616,7 +2616,7 @@ namespace OpenSim.Framework
2616 return result; 2616 return result;
2617 } 2617 }
2618 2618
2619 public static UUID ReadUUID(XmlTextReader reader, string name) 2619 public static UUID ReadUUID(XmlReader reader, string name)
2620 { 2620 {
2621 UUID id; 2621 UUID id;
2622 string idStr; 2622 string idStr;
@@ -2635,7 +2635,7 @@ namespace OpenSim.Framework
2635 return id; 2635 return id;
2636 } 2636 }
2637 2637
2638 public static Vector3 ReadVector(XmlTextReader reader, string name) 2638 public static Vector3 ReadVector(XmlReader reader, string name)
2639 { 2639 {
2640 Vector3 vec; 2640 Vector3 vec;
2641 2641
@@ -2648,7 +2648,7 @@ namespace OpenSim.Framework
2648 return vec; 2648 return vec;
2649 } 2649 }
2650 2650
2651 public static Quaternion ReadQuaternion(XmlTextReader reader, string name) 2651 public static Quaternion ReadQuaternion(XmlReader reader, string name)
2652 { 2652 {
2653 Quaternion quat = new Quaternion(); 2653 Quaternion quat = new Quaternion();
2654 2654
@@ -2677,7 +2677,7 @@ namespace OpenSim.Framework
2677 return quat; 2677 return quat;
2678 } 2678 }
2679 2679
2680 public static T ReadEnum<T>(XmlTextReader reader, string name) 2680 public static T ReadEnum<T>(XmlReader reader, string name)
2681 { 2681 {
2682 string value = reader.ReadElementContentAsString(name, String.Empty); 2682 string value = reader.ReadElementContentAsString(name, String.Empty);
2683 // !!!!! to deal with flags without commas 2683 // !!!!! to deal with flags without commas
diff --git a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs
index e2178e5..39d1875 100644
--- a/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs
+++ b/OpenSim/Region/ClientStack/Linden/UDP/Tests/MockScene.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Region.ClientStack.LindenUDP.Tests
49 m_regStatus = RegionStatus.Up; 49 m_regStatus = RegionStatus.Up;
50 } 50 }
51 51
52 public override void Update(int frames) {} 52 public override bool Update(int frames) { return true; }
53 public override void LoadWorldMap() {} 53 public override void LoadWorldMap() {}
54 54
55 public override ISceneAgent AddNewAgent(IClientAPI client, PresenceType type) 55 public override ISceneAgent AddNewAgent(IClientAPI client, PresenceType type)
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index b4771fd..8528c65 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -798,7 +798,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
798 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection, 798 UUID RayTargetID, byte BypassRayCast, bool RayEndIsIntersection,
799 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment) 799 bool RezSelected, bool RemoveItem, UUID fromTaskID, bool attachment)
800 { 800 {
801 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString()); 801 AssetBase rezAsset = m_Scene.AssetService.Get(assetID.ToString());
802 802
803 if (rezAsset == null) 803 if (rezAsset == null)
804 { 804 {
@@ -829,7 +829,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
829 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0); 829 byte bRayEndIsIntersection = (byte)(RayEndIsIntersection ? 1 : 0);
830 Vector3 pos; 830 Vector3 pos;
831 831
832 bool single = m_Scene.GetObjectsToRez(rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight); 832 bool single
833 = m_Scene.GetObjectsToRez(
834 rezAsset.Data, attachment, out objlist, out veclist, out bbox, out offsetHeight);
833 835
834 if (single) 836 if (single)
835 { 837 {
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
index ad1a0e1..80b9c0a 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/Tests/InventoryAccessModuleTests.cs
@@ -111,6 +111,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess.Tests
111 InventoryFolderBase objsFolder 111 InventoryFolderBase objsFolder
112 = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0]; 112 = InventoryArchiveUtils.FindFoldersByPath(m_scene.InventoryService, m_userId, "Objects")[0];
113 item1.Folder = objsFolder.ID; 113 item1.Folder = objsFolder.ID;
114 item1.Flags |= (uint)InventoryItemFlags.ObjectHasMultipleItems;
114 m_scene.AddInventoryItem(item1); 115 m_scene.AddInventoryItem(item1);
115 116
116 SceneObjectGroup so 117 SceneObjectGroup so
diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
index 55ef61d..11b079f 100644
--- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
+++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs
@@ -525,16 +525,13 @@ namespace OpenSim.Region.CoreModules.World.Land
525 /// </summary> 525 /// </summary>
526 /// <param name="avatar"></param> 526 /// <param name="avatar"></param>
527 public void EventManagerOnClientMovement(ScenePresence avatar) 527 public void EventManagerOnClientMovement(ScenePresence avatar)
528 //
529 { 528 {
530 ILandObject over = GetLandObject(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y); 529 Vector3 pos = avatar.AbsolutePosition;
530 ILandObject over = GetLandObject(pos.X, pos.Y);
531 if (over != null) 531 if (over != null)
532 { 532 {
533 if (!over.IsRestrictedFromLand(avatar.UUID) && (!over.IsBannedFromLand(avatar.UUID) || avatar.AbsolutePosition.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT)) 533 if (!over.IsRestrictedFromLand(avatar.UUID) && (!over.IsBannedFromLand(avatar.UUID) || pos.Z >= LandChannel.BAN_LINE_SAFETY_HIEGHT))
534 { 534 avatar.lastKnownAllowedPosition = pos;
535 avatar.lastKnownAllowedPosition =
536 new Vector3(avatar.AbsolutePosition.X, avatar.AbsolutePosition.Y, avatar.AbsolutePosition.Z);
537 }
538 } 535 }
539 } 536 }
540 537
diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
index 66059fb..a5bb1a7 100644
--- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
+++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs
@@ -27,6 +27,7 @@
27 27
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.IO; 29using System.IO;
30using System.Text;
30using System.Xml; 31using System.Xml;
31using log4net.Config; 32using log4net.Config;
32using NUnit.Framework; 33using NUnit.Framework;
@@ -42,128 +43,351 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
42 [TestFixture] 43 [TestFixture]
43 public class SerialiserTests : OpenSimTestCase 44 public class SerialiserTests : OpenSimTestCase
44 { 45 {
45 private string xml = @" 46 private const string ObjectRootPartStubXml =
46 <SceneObjectGroup> 47@"<SceneObjectGroup>
47 <RootPart> 48 <RootPart>
48 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> 49 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
49 <AllowedDrop>false</AllowedDrop> 50 <AllowedDrop>false</AllowedDrop>
50 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID> 51 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
51 <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID> 52 <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
52 <InventorySerial>1</InventorySerial> 53 <InventorySerial>1</InventorySerial>
53 <TaskInventory /> 54 <TaskInventory />
54 <ObjectFlags>0</ObjectFlags> 55 <ObjectFlags>0</ObjectFlags>
55 <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID> 56 <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
56 <LocalId>2698615125</LocalId> 57 <LocalId>2698615125</LocalId>
57 <Name>PrimMyRide</Name> 58 <Name>PrimMyRide</Name>
58 <Material>0</Material> 59 <Material>0</Material>
59 <PassTouches>false</PassTouches> 60 <PassTouches>false</PassTouches>
60 <RegionHandle>1099511628032000</RegionHandle> 61 <RegionHandle>1099511628032000</RegionHandle>
61 <ScriptAccessPin>0</ScriptAccessPin> 62 <ScriptAccessPin>0</ScriptAccessPin>
62 <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition> 63 <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
63 <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition> 64 <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
64 <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset> 65 <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
65 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity> 66 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
66 <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity> 67 <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
67 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity> 68 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
68 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration> 69 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
69 <Description /> 70 <Description />
70 <Color /> 71 <Color />
71 <Text /> 72 <Text />
72 <SitName /> 73 <SitName />
73 <TouchName /> 74 <TouchName />
74 <LinkNum>0</LinkNum> 75 <LinkNum>0</LinkNum>
75 <ClickAction>0</ClickAction> 76 <ClickAction>0</ClickAction>
76 <Shape> 77 <Shape>
77 <ProfileCurve>1</ProfileCurve> 78 <ProfileCurve>1</ProfileCurve>
78 <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry> 79 <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
79 <ExtraParams>AA==</ExtraParams> 80 <ExtraParams>AA==</ExtraParams>
80 <PathBegin>0</PathBegin> 81 <PathBegin>0</PathBegin>
81 <PathCurve>16</PathCurve> 82 <PathCurve>16</PathCurve>
82 <PathEnd>0</PathEnd> 83 <PathEnd>0</PathEnd>
83 <PathRadiusOffset>0</PathRadiusOffset> 84 <PathRadiusOffset>0</PathRadiusOffset>
84 <PathRevolutions>0</PathRevolutions> 85 <PathRevolutions>0</PathRevolutions>
85 <PathScaleX>100</PathScaleX> 86 <PathScaleX>100</PathScaleX>
86 <PathScaleY>100</PathScaleY> 87 <PathScaleY>100</PathScaleY>
87 <PathShearX>0</PathShearX> 88 <PathShearX>0</PathShearX>
88 <PathShearY>0</PathShearY> 89 <PathShearY>0</PathShearY>
89 <PathSkew>0</PathSkew> 90 <PathSkew>0</PathSkew>
90 <PathTaperX>0</PathTaperX> 91 <PathTaperX>0</PathTaperX>
91 <PathTaperY>0</PathTaperY> 92 <PathTaperY>0</PathTaperY>
92 <PathTwist>0</PathTwist> 93 <PathTwist>0</PathTwist>
93 <PathTwistBegin>0</PathTwistBegin> 94 <PathTwistBegin>0</PathTwistBegin>
94 <PCode>9</PCode> 95 <PCode>9</PCode>
95 <ProfileBegin>0</ProfileBegin> 96 <ProfileBegin>0</ProfileBegin>
96 <ProfileEnd>0</ProfileEnd> 97 <ProfileEnd>0</ProfileEnd>
97 <ProfileHollow>0</ProfileHollow> 98 <ProfileHollow>0</ProfileHollow>
98 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale> 99 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
99 <State>0</State> 100 <State>0</State>
100 <ProfileShape>Square</ProfileShape> 101 <ProfileShape>Square</ProfileShape>
101 <HollowShape>Same</HollowShape> 102 <HollowShape>Same</HollowShape>
102 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture> 103 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
103 <SculptType>0</SculptType><SculptData /> 104 <SculptType>0</SculptType><SculptData />
104 <FlexiSoftness>0</FlexiSoftness> 105 <FlexiSoftness>0</FlexiSoftness>
105 <FlexiTension>0</FlexiTension> 106 <FlexiTension>0</FlexiTension>
106 <FlexiDrag>0</FlexiDrag> 107 <FlexiDrag>0</FlexiDrag>
107 <FlexiGravity>0</FlexiGravity> 108 <FlexiGravity>0</FlexiGravity>
108 <FlexiWind>0</FlexiWind> 109 <FlexiWind>0</FlexiWind>
109 <FlexiForceX>0</FlexiForceX> 110 <FlexiForceX>0</FlexiForceX>
110 <FlexiForceY>0</FlexiForceY> 111 <FlexiForceY>0</FlexiForceY>
111 <FlexiForceZ>0</FlexiForceZ> 112 <FlexiForceZ>0</FlexiForceZ>
112 <LightColorR>0</LightColorR> 113 <LightColorR>0</LightColorR>
113 <LightColorG>0</LightColorG> 114 <LightColorG>0</LightColorG>
114 <LightColorB>0</LightColorB> 115 <LightColorB>0</LightColorB>
115 <LightColorA>1</LightColorA> 116 <LightColorA>1</LightColorA>
116 <LightRadius>0</LightRadius> 117 <LightRadius>0</LightRadius>
117 <LightCutoff>0</LightCutoff> 118 <LightCutoff>0</LightCutoff>
118 <LightFalloff>0</LightFalloff> 119 <LightFalloff>0</LightFalloff>
119 <LightIntensity>1</LightIntensity> 120 <LightIntensity>1</LightIntensity>
120 <FlexiEntry>false</FlexiEntry> 121 <FlexiEntry>false</FlexiEntry>
121 <LightEntry>false</LightEntry> 122 <LightEntry>false</LightEntry>
122 <SculptEntry>false</SculptEntry> 123 <SculptEntry>false</SculptEntry>
123 </Shape> 124 </Shape>
124 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale> 125 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
125 <UpdateFlag>0</UpdateFlag> 126 <UpdateFlag>0</UpdateFlag>
126 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation> 127 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
127 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition> 128 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
128 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL> 129 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
129 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL> 130 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
130 <ParentID>0</ParentID> 131 <ParentID>0</ParentID>
131 <CreationDate>1211330445</CreationDate> 132 <CreationDate>1211330445</CreationDate>
132 <Category>0</Category> 133 <Category>0</Category>
133 <SalePrice>0</SalePrice> 134 <SalePrice>0</SalePrice>
134 <ObjectSaleType>0</ObjectSaleType> 135 <ObjectSaleType>0</ObjectSaleType>
135 <OwnershipCost>0</OwnershipCost> 136 <OwnershipCost>0</OwnershipCost>
136 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID> 137 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
137 <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID> 138 <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
138 <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID> 139 <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
139 <BaseMask>2147483647</BaseMask> 140 <BaseMask>2147483647</BaseMask>
140 <OwnerMask>2147483647</OwnerMask> 141 <OwnerMask>2147483647</OwnerMask>
141 <GroupMask>0</GroupMask> 142 <GroupMask>0</GroupMask>
142 <EveryoneMask>0</EveryoneMask> 143 <EveryoneMask>0</EveryoneMask>
143 <NextOwnerMask>2147483647</NextOwnerMask> 144 <NextOwnerMask>2147483647</NextOwnerMask>
144 <Flags>None</Flags> 145 <Flags>None</Flags>
145 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound> 146 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
146 <CollisionSoundVolume>0</CollisionSoundVolume> 147 <CollisionSoundVolume>0</CollisionSoundVolume>
147 <DynAttrs> 148 <DynAttrs>
148 <llsd> 149 <llsd>
149 <map> 150 <map>
150 <key>MyNamespace</key> 151 <key>MyNamespace</key>
151 <map> 152 <map>
152 <key>MyStore</key> 153 <key>MyStore</key>
153 <map> 154 <map>
154 <key>the answer</key> 155 <key>the answer</key>
155 <integer>42</integer> 156 <integer>42</integer>
156 </map>
157 </map>
158 </map> 157 </map>
159 </llsd> 158 </map>
160 </DynAttrs> 159 </map>
161 </SceneObjectPart> 160 </llsd>
162 </RootPart> 161 </DynAttrs>
163 <OtherParts /> 162 </SceneObjectPart>
164 </SceneObjectGroup>"; 163 </RootPart>";
165 164
166 private string badFloatsXml = @" 165 private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml +
166@"
167 <OtherParts />
168</SceneObjectGroup>";
169
170 private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml +
171@"
172 <OtherParts>
173 <Part>
174 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
175 <AllowedDrop>false</AllowedDrop>
176 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
177 <FolderID><Guid>9958feb1-02a6-49e4-a4ce-eba6f578ee13</Guid></FolderID>
178 <InventorySerial>3</InventorySerial>
179 <UUID><Guid>9958feb1-02a6-49e4-a4ce-eba6f578ee13</Guid></UUID>
180 <LocalId>1154704500</LocalId>
181 <Name>Alien Head 1</Name>
182 <Material>3</Material>
183 <PassTouches>false</PassTouches>
184 <PassCollisions>false</PassCollisions>
185 <RegionHandle>21990232560640000</RegionHandle>
186 <ScriptAccessPin>0</ScriptAccessPin>
187 <GroupPosition><X>125.5655</X><Y>127.346</Y><Z>22.48036</Z></GroupPosition>
188 <OffsetPosition><X>-0.2171936</X><Y>0.1083984</Y><Z>0.0009994507</Z></OffsetPosition>
189 <RotationOffset><X>-0.5122106</X><Y>0.4851225</Y><Z>-0.4957454</Z><W>0.5064908</W></RotationOffset>
190 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
191 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
192 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
193 <Description>(No Description)</Description>
194 <Color><R>0</R><G>0</G><B>0</B><A>255</A></Color>
195 <Text/>
196 <SitName/>
197 <TouchName/>
198 <LinkNum>253</LinkNum>
199 <ClickAction>0</ClickAction>
200 <Shape>
201 <ProfileCurve>5</ProfileCurve>
202 <TextureEntry>Vw3dpvgTRUOiIUOGsnpWlAB/f38AAAAAgL8AAACAPwAAAAAAAAAF4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</TextureEntry>
203 <ExtraParams>AA==</ExtraParams>
204 <PathBegin>0</PathBegin>
205 <PathCurve>32</PathCurve>
206 <PathEnd>0</PathEnd>
207 <PathRadiusOffset>0</PathRadiusOffset>
208 <PathRevolutions>0</PathRevolutions>
209 <PathScaleX>100</PathScaleX>
210 <PathScaleY>100</PathScaleY>
211 <PathShearX>0</PathShearX>
212 <PathShearY>0</PathShearY>
213 <PathSkew>0</PathSkew>
214 <PathTaperX>0</PathTaperX>
215 <PathTaperY>0</PathTaperY>
216 <PathTwist>0</PathTwist>
217 <PathTwistBegin>0</PathTwistBegin>
218 <PCode>9</PCode>
219 <ProfileBegin>0</ProfileBegin>
220 <ProfileEnd>0</ProfileEnd>
221 <ProfileHollow>0</ProfileHollow>
222 <State>9</State>
223 <LastAttachPoint>0</LastAttachPoint>
224 <ProfileShape>HalfCircle</ProfileShape>
225 <HollowShape>Same</HollowShape>
226 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
227 <SculptType>0</SculptType>
228 <FlexiSoftness>0</FlexiSoftness>
229 <FlexiTension>0</FlexiTension>
230 <FlexiDrag>0</FlexiDrag>
231 <FlexiGravity>0</FlexiGravity>
232 <FlexiWind>0</FlexiWind>
233 <FlexiForceX>0</FlexiForceX>
234 <FlexiForceY>0</FlexiForceY>
235 <FlexiForceZ>0</FlexiForceZ>
236 <LightColorR>0</LightColorR>
237 <LightColorG>0</LightColorG>
238 <LightColorB>0</LightColorB>
239 <LightColorA>1</LightColorA>
240 <LightRadius>0</LightRadius>
241 <LightCutoff>0</LightCutoff>
242 <LightFalloff>0</LightFalloff>
243 <LightIntensity>1</LightIntensity>
244 <FlexiEntry>false</FlexiEntry>
245 <LightEntry>false</LightEntry>
246 <SculptEntry>false</SculptEntry>
247 </Shape>
248 <Scale><X>0.1148195</X><Y>0.0143891</Y><Z>0.02768878</Z></Scale>
249 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
250 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
251 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
252 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
253 <ParentID>1154704499</ParentID>
254 <CreationDate>1256611042</CreationDate>
255 <Category>0</Category>
256 <SalePrice>10</SalePrice>
257 <ObjectSaleType>0</ObjectSaleType>
258 <OwnershipCost>0</OwnershipCost>
259 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
260 <OwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></OwnerID>
261 <LastOwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></LastOwnerID>
262 <BaseMask>647168</BaseMask>
263 <OwnerMask>647168</OwnerMask>
264 <GroupMask>0</GroupMask>
265 <EveryoneMask>0</EveryoneMask>
266 <NextOwnerMask>581632</NextOwnerMask>
267 <Flags>None</Flags>
268 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
269 <CollisionSoundVolume>0</CollisionSoundVolume>
270 <AttachedPos><X>0</X><Y>0</Y><Z>0</Z></AttachedPos>
271 <TextureAnimation/>
272 <ParticleSystem/>
273 <PayPrice0>-2</PayPrice0>
274 <PayPrice1>-2</PayPrice1>
275 <PayPrice2>-2</PayPrice2>
276 <PayPrice3>-2</PayPrice3>
277 <PayPrice4>-2</PayPrice4>
278 </SceneObjectPart>
279 </Part>
280 <Part>
281 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
282 <AllowedDrop>false</AllowedDrop>
283 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
284 <FolderID><Guid>674b6b86-f5aa-439a-8e00-0d75bc08c80a</Guid></FolderID>
285 <InventorySerial>3</InventorySerial>
286 <UUID><Guid>674b6b86-f5aa-439a-8e00-0d75bc08c80a</Guid></UUID>
287 <LocalId>1154704501</LocalId>
288 <Name>Alien Head 2</Name>
289 <Material>3</Material>
290 <PassTouches>false</PassTouches>
291 <PassCollisions>false</PassCollisions>
292 <RegionHandle>21990232560640000</RegionHandle>
293 <ScriptAccessPin>0</ScriptAccessPin>
294 <GroupPosition><X>125.5655</X><Y>127.346</Y><Z>22.48036</Z></GroupPosition>
295 <OffsetPosition><X>-0.2490997</X><Y>0.08520126</Y><Z>0.0009002686</Z></OffsetPosition>
296 <RotationOffset><X>-0.4765368</X><Y>0.5194498</Y><Z>-0.5301372</Z><W>0.4712104</W></RotationOffset>
297 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
298 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
299 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
300 <Description>(No Description)</Description>
301 <Color><R>0</R><G>0</G><B>0</B><A>255</A></Color>
302 <Text/>
303 <SitName/>
304 <TouchName/>
305 <LinkNum>252</LinkNum>
306 <ClickAction>0</ClickAction>
307 <Shape>
308 <ProfileCurve>0</ProfileCurve>
309 <TextureEntry>Vw3dpvgTRUOiIUOGsnpWlAB/f38AAAAAgL8AAACAPwAAAAAAAAAF4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</TextureEntry>
310 <ExtraParams>AA==</ExtraParams>
311 <PathBegin>0</PathBegin>
312 <PathCurve>32</PathCurve>
313 <PathEnd>0</PathEnd>
314 <PathRadiusOffset>0</PathRadiusOffset>
315 <PathRevolutions>0</PathRevolutions>
316 <PathScaleX>100</PathScaleX>
317 <PathScaleY>150</PathScaleY>
318 <PathShearX>0</PathShearX>
319 <PathShearY>0</PathShearY>
320 <PathSkew>0</PathSkew>
321 <PathTaperX>0</PathTaperX>
322 <PathTaperY>0</PathTaperY>
323 <PathTwist>0</PathTwist>
324 <PathTwistBegin>0</PathTwistBegin>
325 <PCode>9</PCode>
326 <ProfileBegin>0</ProfileBegin>
327 <ProfileEnd>0</ProfileEnd>
328 <ProfileHollow>0</ProfileHollow>
329 <State>9</State>
330 <LastAttachPoint>0</LastAttachPoint>
331 <ProfileShape>Circle</ProfileShape>
332 <HollowShape>Same</HollowShape>
333 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
334 <SculptType>0</SculptType>
335 <FlexiSoftness>0</FlexiSoftness>
336 <FlexiTension>0</FlexiTension>
337 <FlexiDrag>0</FlexiDrag>
338 <FlexiGravity>0</FlexiGravity>
339 <FlexiWind>0</FlexiWind>
340 <FlexiForceX>0</FlexiForceX>
341 <FlexiForceY>0</FlexiForceY>
342 <FlexiForceZ>0</FlexiForceZ>
343 <LightColorR>0</LightColorR>
344 <LightColorG>0</LightColorG>
345 <LightColorB>0</LightColorB>
346 <LightColorA>1</LightColorA>
347 <LightRadius>0</LightRadius>
348 <LightCutoff>0</LightCutoff>
349 <LightFalloff>0</LightFalloff>
350 <LightIntensity>1</LightIntensity>
351 <FlexiEntry>false</FlexiEntry>
352 <LightEntry>false</LightEntry>
353 <SculptEntry>false</SculptEntry>
354 </Shape>
355 <Scale><X>0.03574385</X><Y>0.05958032</Y><Z>0.04764182</Z></Scale>
356 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
357 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
358 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
359 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
360 <ParentID>1154704499</ParentID>
361 <CreationDate>1256611042</CreationDate>
362 <Category>0</Category>
363 <SalePrice>10</SalePrice>
364 <ObjectSaleType>0</ObjectSaleType>
365 <OwnershipCost>0</OwnershipCost>
366 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
367 <OwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></OwnerID>
368 <LastOwnerID><Guid>7b2022f0-5f19-488c-b7e5-829d8f96b448</Guid></LastOwnerID>
369 <BaseMask>647168</BaseMask>
370 <OwnerMask>647168</OwnerMask>
371 <GroupMask>0</GroupMask>
372 <EveryoneMask>0</EveryoneMask>
373 <NextOwnerMask>581632</NextOwnerMask>
374 <Flags>None</Flags>
375 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
376 <CollisionSoundVolume>0</CollisionSoundVolume>
377 <AttachedPos><X>0</X><Y>0</Y><Z>0</Z></AttachedPos>
378 <TextureAnimation/>
379 <ParticleSystem/>
380 <PayPrice0>-2</PayPrice0>
381 <PayPrice1>-2</PayPrice1>
382 <PayPrice2>-2</PayPrice2>
383 <PayPrice3>-2</PayPrice3>
384 <PayPrice4>-2</PayPrice4>
385 </SceneObjectPart>
386 </Part>
387 </OtherParts>
388</SceneObjectGroup>";
389
390 private const string ObjectWithBadFloatsXml = @"
167 <SceneObjectGroup> 391 <SceneObjectGroup>
168 <RootPart> 392 <RootPart>
169 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> 393 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
@@ -270,7 +494,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
270 <OtherParts /> 494 <OtherParts />
271 </SceneObjectGroup>"; 495 </SceneObjectGroup>";
272 496
273 private string xml2 = @" 497 private const string ObjectWithNoPartsXml2 = @"
274 <SceneObjectGroup> 498 <SceneObjectGroup>
275 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema""> 499 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
276 <CreatorID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></CreatorID> 500 <CreatorID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></CreatorID>
@@ -377,12 +601,12 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
377 } 601 }
378 602
379 [Test] 603 [Test]
380 public void TestDeserializeXml() 604 public void TestDeserializeXmlObjectWithNoOtherParts()
381 { 605 {
382 TestHelpers.InMethod(); 606 TestHelpers.InMethod();
383 //log4net.Config.XmlConfigurator.Configure(); 607 TestHelpers.EnableLogging();
384 608
385 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(xml); 609 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithNoOtherPartsXml);
386 SceneObjectPart rootPart = so.RootPart; 610 SceneObjectPart rootPart = so.RootPart;
387 611
388 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); 612 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
@@ -395,12 +619,51 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
395 } 619 }
396 620
397 [Test] 621 [Test]
622 public void TestDeserializeXmlObjectWithOtherParts()
623 {
624 TestHelpers.InMethod();
625 TestHelpers.EnableLogging();
626
627 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithOtherPartsXml);
628 SceneObjectPart[] parts = so.Parts;
629 Assert.AreEqual(3, so.Parts.Length);
630
631 {
632 SceneObjectPart part = parts[0];
633
634 Assert.That(part.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
635 Assert.That(part.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
636 Assert.That(part.Name, Is.EqualTo("PrimMyRide"));
637 OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore");
638 Assert.AreEqual(42, store["the answer"].AsInteger());
639 }
640
641 {
642 SceneObjectPart part = parts[1];
643
644 Assert.That(part.UUID, Is.EqualTo(new UUID("9958feb1-02a6-49e4-a4ce-eba6f578ee13")));
645 Assert.That(part.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
646 Assert.That(part.Name, Is.EqualTo("Alien Head 1"));
647 }
648
649 {
650 SceneObjectPart part = parts[2];
651
652 Assert.That(part.UUID, Is.EqualTo(new UUID("674b6b86-f5aa-439a-8e00-0d75bc08c80a")));
653 Assert.That(part.CreatorID, Is.EqualTo(new UUID("a6dacf01-4636-4bb9-8a97-30609438af9d")));
654 Assert.That(part.Name, Is.EqualTo("Alien Head 2"));
655 }
656
657 // TODO: Check other properties
658 }
659
660 [Test]
398 public void TestDeserializeBadFloatsXml() 661 public void TestDeserializeBadFloatsXml()
399 { 662 {
400 TestHelpers.InMethod(); 663 TestHelpers.InMethod();
401// log4net.Config.XmlConfigurator.Configure(); 664// log4net.Config.XmlConfigurator.Configure();
402 665
403 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(badFloatsXml); 666 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithBadFloatsXml);
404 SceneObjectPart rootPart = so.RootPart; 667 SceneObjectPart rootPart = so.RootPart;
405 668
406 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790"))); 669 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("e6a5a05e-e8cc-4816-8701-04165e335790")));
@@ -517,7 +780,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests
517 TestHelpers.InMethod(); 780 TestHelpers.InMethod();
518 //log4net.Config.XmlConfigurator.Configure(); 781 //log4net.Config.XmlConfigurator.Configure();
519 782
520 SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(xml2); 783 SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(ObjectWithNoPartsXml2);
521 SceneObjectPart rootPart = so.RootPart; 784 SceneObjectPart rootPart = so.RootPart;
522 785
523 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946"))); 786 Assert.That(rootPart.UUID, Is.EqualTo(new UUID("9be68fdd-f740-4a0f-9675-dfbbb536b946")));
diff --git a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
index 542d454..3489873 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.Inventory.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Collections; 30using System.Collections;
31using System.Reflection; 31using System.Reflection;
32using System.Text; 32using System.Text;
33using System.Threading;
33using System.Timers; 34using System.Timers;
34using System.Xml; 35using System.Xml;
35using OpenMetaverse; 36using OpenMetaverse;
@@ -2192,60 +2193,87 @@ namespace OpenSim.Region.Framework.Scenes
2192 /// Returns one object if the asset is a regular object, and multiple objects for a coalesced object. 2193 /// Returns one object if the asset is a regular object, and multiple objects for a coalesced object.
2193 /// </remarks> 2194 /// </remarks>
2194 /// <param name="assetData">Asset data</param> 2195 /// <param name="assetData">Asset data</param>
2195 /// <param name="attachment">Whether the item is an attachment</param> 2196 /// <param name="isAttachment">True if the object is an attachment.</param>
2196 /// <param name="objlist">The objects included in the asset</param> 2197 /// <param name="objlist">The objects included in the asset</param>
2197 /// <param name="veclist">Relative positions of the objects</param> 2198 /// <param name="veclist">Relative positions of the objects</param>
2198 /// <param name="bbox">Bounding box of all the objects</param> 2199 /// <param name="bbox">Bounding box of all the objects</param>
2199 /// <param name="offsetHeight">Offset in the Z axis from the centre of the bounding box 2200 /// <param name="offsetHeight">Offset in the Z axis from the centre of the bounding box
2200 /// to the centre of the root prim (relevant only when returning a single object)</param> 2201 /// to the centre of the root prim (relevant only when returning a single object)</param>
2201 /// <returns>true = returning a single object; false = multiple objects</returns> 2202 /// <returns>
2202 public bool GetObjectsToRez(byte[] assetData, bool attachment, out List<SceneObjectGroup> objlist, out List<Vector3> veclist, 2203 /// true if returning a single object or deserialization fails, false if returning the coalesced
2204 /// list of objects
2205 /// </returns>
2206 public bool GetObjectsToRez(
2207 byte[] assetData, bool isAttachment, out List<SceneObjectGroup> objlist, out List<Vector3> veclist,
2203 out Vector3 bbox, out float offsetHeight) 2208 out Vector3 bbox, out float offsetHeight)
2204 { 2209 {
2205 objlist = new List<SceneObjectGroup>(); 2210 objlist = new List<SceneObjectGroup>();
2206 veclist = new List<Vector3>(); 2211 veclist = new List<Vector3>();
2207 2212
2208 XmlDocument doc = new XmlDocument();
2209 string xmlData = Utils.BytesToString(assetData); 2213 string xmlData = Utils.BytesToString(assetData);
2210 doc.LoadXml(xmlData);
2211 XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
2212 2214
2213 if (e == null || attachment) // Single 2215 try
2214 { 2216 {
2215 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(xmlData); 2217 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
2216 objlist.Add(g); 2218 {
2217 veclist.Add(new Vector3(0, 0, 0)); 2219 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment }))
2218 bbox = g.GetAxisAlignedBoundingBox(out offsetHeight); 2220 {
2219 return true; 2221 reader.Read();
2222 bool isSingleObject = reader.Name != "CoalescedObject";
2223
2224 if (isSingleObject || isAttachment)
2225 {
2226 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(reader);
2227 objlist.Add(g);
2228 veclist.Add(Vector3.Zero);
2229 bbox = g.GetAxisAlignedBoundingBox(out offsetHeight);
2230 return true;
2231 }
2232 else
2233 {
2234 XmlDocument doc = new XmlDocument();
2235 doc.LoadXml(xmlData);
2236 XmlElement e = (XmlElement)doc.SelectSingleNode("/CoalescedObject");
2237 XmlElement coll = (XmlElement)e;
2238 float bx = Convert.ToSingle(coll.GetAttribute("x"));
2239 float by = Convert.ToSingle(coll.GetAttribute("y"));
2240 float bz = Convert.ToSingle(coll.GetAttribute("z"));
2241 bbox = new Vector3(bx, by, bz);
2242 offsetHeight = 0;
2243
2244 XmlNodeList groups = e.SelectNodes("SceneObjectGroup");
2245 foreach (XmlNode n in groups)
2246 {
2247 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
2248 objlist.Add(g);
2249
2250 XmlElement el = (XmlElement)n;
2251 string rawX = el.GetAttribute("offsetx");
2252 string rawY = el.GetAttribute("offsety");
2253 string rawZ = el.GetAttribute("offsetz");
2254
2255 float x = Convert.ToSingle(rawX);
2256 float y = Convert.ToSingle(rawY);
2257 float z = Convert.ToSingle(rawZ);
2258 veclist.Add(new Vector3(x, y, z));
2259 }
2260
2261 return false;
2262 }
2263 }
2264 }
2220 } 2265 }
2221 else 2266 catch (Exception e)
2222 { 2267 {
2223 XmlElement coll = (XmlElement)e; 2268 m_log.Error(
2224 float bx = Convert.ToSingle(coll.GetAttribute("x")); 2269 "[AGENT INVENTORY]: Deserialization of xml failed when looking for CoalescedObject tag. Exception ",
2225 float by = Convert.ToSingle(coll.GetAttribute("y")); 2270 e);
2226 float bz = Convert.ToSingle(coll.GetAttribute("z"));
2227 bbox = new Vector3(bx, by, bz);
2228 offsetHeight = 0;
2229 2271
2230 XmlNodeList groups = e.SelectNodes("SceneObjectGroup"); 2272 bbox = Vector3.Zero;
2231 foreach (XmlNode n in groups) 2273 offsetHeight = 0;
2232 {
2233 SceneObjectGroup g = SceneObjectSerializer.FromOriginalXmlFormat(n.OuterXml);
2234 objlist.Add(g);
2235
2236 XmlElement el = (XmlElement)n;
2237 string rawX = el.GetAttribute("offsetx");
2238 string rawY = el.GetAttribute("offsety");
2239 string rawZ = el.GetAttribute("offsetz");
2240
2241 float x = Convert.ToSingle(rawX);
2242 float y = Convert.ToSingle(rawY);
2243 float z = Convert.ToSingle(rawZ);
2244 veclist.Add(new Vector3(x, y, z));
2245 }
2246 } 2274 }
2247 2275
2248 return false; 2276 return true;
2249 } 2277 }
2250 2278
2251 /// <summary> 2279 /// <summary>
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index a43de29..18376c3 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -329,6 +329,17 @@ namespace OpenSim.Region.Framework.Scenes
329 private Dictionary<string, string> m_extraSettings; 329 private Dictionary<string, string> m_extraSettings;
330 330
331 /// <summary> 331 /// <summary>
332 /// If true then the next time the scene loop is activated, updates will be performed by firing of a timer
333 /// rather than on a single thread that sleeps.
334 /// </summary>
335 public bool UpdateOnTimer { get; set; }
336
337 /// <summary>
338 /// Only used if we are updating scene on a timer rather than sleeping a thread.
339 /// </summary>
340 private Timer m_sceneUpdateTimer;
341
342 /// <summary>
332 /// Current scene frame number 343 /// Current scene frame number
333 /// </summary> 344 /// </summary>
334 public uint Frame 345 public uint Frame
@@ -430,7 +441,8 @@ namespace OpenSim.Region.Framework.Scenes
430 /// Is the scene active? 441 /// Is the scene active?
431 /// </summary> 442 /// </summary>
432 /// <remarks> 443 /// <remarks>
433 /// If false, maintenance and update loops are not being run. Updates can still be triggered manually if 444 /// If false, maintenance and update loops are not being run, though after setting to false update may still
445 /// be active for a period (and IsRunning will still be true). Updates can still be triggered manually if
434 /// the scene is not active. 446 /// the scene is not active.
435 /// </remarks> 447 /// </remarks>
436 public bool Active 448 public bool Active
@@ -453,8 +465,11 @@ namespace OpenSim.Region.Framework.Scenes
453 } 465 }
454 private volatile bool m_active; 466 private volatile bool m_active;
455 467
456// private int m_lastUpdate; 468 /// <summary>
457// private bool m_firstHeartbeat = true; 469 /// If true then updates are running. This may be true for a short period after a scene is de-activated.
470 /// </summary>
471 public bool IsRunning { get { return m_isRunning; } }
472 private volatile bool m_isRunning;
458 473
459 private Timer m_mapGenerationTimer = new Timer(); 474 private Timer m_mapGenerationTimer = new Timer();
460 private bool m_generateMaptiles; 475 private bool m_generateMaptiles;
@@ -1352,19 +1367,18 @@ namespace OpenSim.Region.Framework.Scenes
1352 /// </param> 1367 /// </param>
1353 public void Start(bool startScripts) 1368 public void Start(bool startScripts)
1354 { 1369 {
1370 if (IsRunning)
1371 return;
1372
1373 m_isRunning = true;
1355 m_active = true; 1374 m_active = true;
1356 1375
1357// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName); 1376// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName);
1358
1359 //m_heartbeatTimer.Enabled = true;
1360 //m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
1361 //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
1362 if (m_heartbeatThread != null) 1377 if (m_heartbeatThread != null)
1363 { 1378 {
1364 m_heartbeatThread.Abort(); 1379 m_heartbeatThread.Abort();
1365 m_heartbeatThread = null; 1380 m_heartbeatThread = null;
1366 } 1381 }
1367// m_lastUpdate = Util.EnvironmentTickCount();
1368 1382
1369 m_heartbeatThread 1383 m_heartbeatThread
1370 = Watchdog.StartThread( 1384 = Watchdog.StartThread(
@@ -1401,15 +1415,6 @@ namespace OpenSim.Region.Framework.Scenes
1401 /// </summary> 1415 /// </summary>
1402 private void Heartbeat() 1416 private void Heartbeat()
1403 { 1417 {
1404// if (!Monitor.TryEnter(m_heartbeatLock))
1405// {
1406// Watchdog.RemoveThread();
1407// return;
1408// }
1409
1410// try
1411// {
1412
1413 m_eventManager.TriggerOnRegionStarted(this); 1418 m_eventManager.TriggerOnRegionStarted(this);
1414 1419
1415 // The first frame can take a very long time due to physics actors being added on startup. Therefore, 1420 // The first frame can take a very long time due to physics actors being added on startup. Therefore,
@@ -1418,21 +1423,47 @@ namespace OpenSim.Region.Framework.Scenes
1418 Update(1); 1423 Update(1);
1419 1424
1420 Watchdog.StartThread( 1425 Watchdog.StartThread(
1421 Maintenance, string.Format("Maintenance ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, true); 1426 Maintenance, string.Format("Maintenance ({0})", RegionInfo.RegionName), ThreadPriority.Normal, false, true);
1422 1427
1423 Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true; 1428 Watchdog.GetCurrentThreadInfo().AlarmIfTimeout = true;
1424 Update(-1); 1429 m_lastFrameTick = Util.EnvironmentTickCount();
1425 1430
1426// m_lastUpdate = Util.EnvironmentTickCount(); 1431 if (UpdateOnTimer)
1427// m_firstHeartbeat = false; 1432 {
1428// } 1433 m_sceneUpdateTimer = new Timer(MinFrameTime * 1000);
1429// finally 1434 m_sceneUpdateTimer.AutoReset = true;
1430// { 1435 m_sceneUpdateTimer.Elapsed += Update;
1431// Monitor.Pulse(m_heartbeatLock); 1436 m_sceneUpdateTimer.Start();
1432// Monitor.Exit(m_heartbeatLock); 1437 }
1433// } 1438 else
1439 {
1440 Update(-1);
1441 Watchdog.RemoveThread();
1442 m_isRunning = false;
1443 }
1444 }
1434 1445
1435 Watchdog.RemoveThread(); 1446 private volatile bool m_isTimerUpdateRunning;
1447
1448 private void Update(object sender, ElapsedEventArgs e)
1449 {
1450 if (m_isTimerUpdateRunning)
1451 return;
1452
1453 m_isTimerUpdateRunning = true;
1454
1455 // If the last frame did not complete on time, then immediately start the next update on the same thread
1456 // and ignore further timed updates until we have a frame that had spare time.
1457 while (!Update(1) && Active) {}
1458
1459 if (!Active || m_shuttingDown)
1460 {
1461 m_sceneUpdateTimer.Stop();
1462 m_sceneUpdateTimer = null;
1463 m_isRunning = false;
1464 }
1465
1466 m_isTimerUpdateRunning = false;
1436 } 1467 }
1437 1468
1438 private void Maintenance() 1469 private void Maintenance()
@@ -1502,7 +1533,7 @@ namespace OpenSim.Region.Framework.Scenes
1502 } 1533 }
1503 } 1534 }
1504 1535
1505 public override void Update(int frames) 1536 public override bool Update(int frames)
1506 { 1537 {
1507 long? endFrame = null; 1538 long? endFrame = null;
1508 1539
@@ -1511,7 +1542,6 @@ namespace OpenSim.Region.Framework.Scenes
1511 1542
1512 float physicsFPS = 0f; 1543 float physicsFPS = 0f;
1513 int previousFrameTick, tmpMS; 1544 int previousFrameTick, tmpMS;
1514 int maintc = Util.EnvironmentTickCount();
1515 1545
1516 while (!m_shuttingDown && ((endFrame == null && Active) || Frame < endFrame)) 1546 while (!m_shuttingDown && ((endFrame == null && Active) || Frame < endFrame))
1517 { 1547 {
@@ -1651,24 +1681,29 @@ namespace OpenSim.Region.Framework.Scenes
1651 } 1681 }
1652 1682
1653 EventManager.TriggerRegionHeartbeatEnd(this); 1683 EventManager.TriggerRegionHeartbeatEnd(this);
1684 otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
1654 1685
1655 Watchdog.UpdateThread(); 1686 if (!UpdateOnTimer)
1687 {
1688 Watchdog.UpdateThread();
1656 1689
1657 previousFrameTick = m_lastFrameTick; 1690 tmpMS = Util.EnvironmentTickCountSubtract(Util.EnvironmentTickCount(), m_lastFrameTick);
1658 m_lastFrameTick = Util.EnvironmentTickCount(); 1691 tmpMS = (int)(MinFrameTime * 1000) - tmpMS;
1659 tmpMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick, maintc);
1660 tmpMS = (int)(MinFrameTime * 1000) - tmpMS;
1661 1692
1662 if (tmpMS > 0) 1693 if (tmpMS > 0)
1694 {
1695 spareMS = tmpMS;
1696 Thread.Sleep(tmpMS);
1697 }
1698 }
1699 else
1663 { 1700 {
1664 Thread.Sleep(tmpMS); 1701 spareMS = Math.Max(0, (int)(MinFrameTime * 1000) - physicsMS2 - agentMS - physicsMS -otherMS);
1665 spareMS += tmpMS;
1666 } 1702 }
1667 1703
1668 frameMS = Util.EnvironmentTickCountSubtract(maintc); 1704 previousFrameTick = m_lastFrameTick;
1669 maintc = Util.EnvironmentTickCount(); 1705 frameMS = Util.EnvironmentTickCountSubtract(m_lastFrameTick);
1670 1706 m_lastFrameTick = Util.EnvironmentTickCount();
1671 otherMS = tempOnRezMS + eventMS + backupMS + terrainMS + landMS;
1672 1707
1673 // if (Frame%m_update_avatars == 0) 1708 // if (Frame%m_update_avatars == 0)
1674 // UpdateInWorldTime(); 1709 // UpdateInWorldTime();
@@ -1683,7 +1718,7 @@ namespace OpenSim.Region.Framework.Scenes
1683 StatsReporter.AddSpareMS(spareMS); 1718 StatsReporter.AddSpareMS(spareMS);
1684 StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS()); 1719 StatsReporter.addScriptLines(m_sceneGraph.GetScriptLPS());
1685 1720
1686 // Optionally warn if a frame takes double the amount of time that it should. 1721 // Optionally warn if a frame takes double the amount of time that it should.
1687 if (DebugUpdates 1722 if (DebugUpdates
1688 && Util.EnvironmentTickCountSubtract( 1723 && Util.EnvironmentTickCountSubtract(
1689 m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2)) 1724 m_lastFrameTick, previousFrameTick) > (int)(MinFrameTime * 1000 * 2))
@@ -1693,6 +1728,8 @@ namespace OpenSim.Region.Framework.Scenes
1693 MinFrameTime * 1000, 1728 MinFrameTime * 1000,
1694 RegionInfo.RegionName); 1729 RegionInfo.RegionName);
1695 } 1730 }
1731
1732 return spareMS >= 0;
1696 } 1733 }
1697 1734
1698 public void AddGroupTarget(SceneObjectGroup grp) 1735 public void AddGroupTarget(SceneObjectGroup grp)
@@ -2073,8 +2110,8 @@ namespace OpenSim.Region.Framework.Scenes
2073 SceneObjectPart target = GetSceneObjectPart(RayTargetID); 2110 SceneObjectPart target = GetSceneObjectPart(RayTargetID);
2074 2111
2075 Vector3 direction = Vector3.Normalize(RayEnd - RayStart); 2112 Vector3 direction = Vector3.Normalize(RayEnd - RayStart);
2076 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 2113 Vector3 AXOrigin = RayStart;
2077 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 2114 Vector3 AXdirection = direction;
2078 2115
2079 if (target != null) 2116 if (target != null)
2080 { 2117 {
@@ -2090,19 +2127,19 @@ namespace OpenSim.Region.Framework.Scenes
2090 EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter); 2127 EntityIntersection ei = target.TestIntersectionOBB(NewRay, Quaternion.Identity, frontFacesOnly, FaceCenter);
2091 2128
2092 // Un-comment out the following line to Get Raytrace results printed to the console. 2129 // Un-comment out the following line to Get Raytrace results printed to the console.
2093 // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString()); 2130 // m_log.Info("[RAYTRACERESULTS]: Hit:" + ei.HitTF.ToString() + " Point: " + ei.ipoint.ToString() + " Normal: " + ei.normal.ToString());
2094 float ScaleOffset = 0.5f; 2131 float ScaleOffset = 0.5f;
2095 2132
2096 // If we hit something 2133 // If we hit something
2097 if (ei.HitTF) 2134 if (ei.HitTF)
2098 { 2135 {
2099 Vector3 scaleComponent = new Vector3(ei.AAfaceNormal.X, ei.AAfaceNormal.Y, ei.AAfaceNormal.Z); 2136 Vector3 scaleComponent = ei.AAfaceNormal;
2100 if (scaleComponent.X != 0) ScaleOffset = scale.X; 2137 if (scaleComponent.X != 0) ScaleOffset = scale.X;
2101 if (scaleComponent.Y != 0) ScaleOffset = scale.Y; 2138 if (scaleComponent.Y != 0) ScaleOffset = scale.Y;
2102 if (scaleComponent.Z != 0) ScaleOffset = scale.Z; 2139 if (scaleComponent.Z != 0) ScaleOffset = scale.Z;
2103 ScaleOffset = Math.Abs(ScaleOffset); 2140 ScaleOffset = Math.Abs(ScaleOffset);
2104 Vector3 intersectionpoint = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); 2141 Vector3 intersectionpoint = ei.ipoint;
2105 Vector3 normal = new Vector3(ei.normal.X, ei.normal.Y, ei.normal.Z); 2142 Vector3 normal = ei.normal;
2106 // Set the position to the intersection point 2143 // Set the position to the intersection point
2107 Vector3 offset = (normal * (ScaleOffset / 2f)); 2144 Vector3 offset = (normal * (ScaleOffset / 2f));
2108 pos = (intersectionpoint + offset); 2145 pos = (intersectionpoint + offset);
@@ -2127,8 +2164,9 @@ namespace OpenSim.Region.Framework.Scenes
2127 2164
2128 if (ei.HitTF) 2165 if (ei.HitTF)
2129 { 2166 {
2130 pos = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); 2167 pos = ei.ipoint;
2131 } else 2168 }
2169 else
2132 { 2170 {
2133 // fall back to our stupid functionality 2171 // fall back to our stupid functionality
2134 pos = RayEnd; 2172 pos = RayEnd;
@@ -3181,8 +3219,8 @@ namespace OpenSim.Region.Framework.Scenes
3181 if (target != null && target2 != null) 3219 if (target != null && target2 != null)
3182 { 3220 {
3183 Vector3 direction = Vector3.Normalize(RayEnd - RayStart); 3221 Vector3 direction = Vector3.Normalize(RayEnd - RayStart);
3184 Vector3 AXOrigin = new Vector3(RayStart.X, RayStart.Y, RayStart.Z); 3222 Vector3 AXOrigin = RayStart;
3185 Vector3 AXdirection = new Vector3(direction.X, direction.Y, direction.Z); 3223 Vector3 AXdirection = direction;
3186 3224
3187 pos = target2.AbsolutePosition; 3225 pos = target2.AbsolutePosition;
3188 //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString()); 3226 //m_log.Info("[OBJECT_REZ]: TargetPos: " + pos.ToString() + ", RayStart: " + RayStart.ToString() + ", RayEnd: " + RayEnd.ToString() + ", Volume: " + Util.GetDistanceTo(RayStart,RayEnd).ToString() + ", mag1: " + Util.GetMagnitude(RayStart).ToString() + ", mag2: " + Util.GetMagnitude(RayEnd).ToString());
@@ -3203,13 +3241,13 @@ namespace OpenSim.Region.Framework.Scenes
3203 if (ei.HitTF) 3241 if (ei.HitTF)
3204 { 3242 {
3205 Vector3 scale = target.Scale; 3243 Vector3 scale = target.Scale;
3206 Vector3 scaleComponent = new Vector3(ei.AAfaceNormal.X, ei.AAfaceNormal.Y, ei.AAfaceNormal.Z); 3244 Vector3 scaleComponent = ei.AAfaceNormal;
3207 if (scaleComponent.X != 0) ScaleOffset = scale.X; 3245 if (scaleComponent.X != 0) ScaleOffset = scale.X;
3208 if (scaleComponent.Y != 0) ScaleOffset = scale.Y; 3246 if (scaleComponent.Y != 0) ScaleOffset = scale.Y;
3209 if (scaleComponent.Z != 0) ScaleOffset = scale.Z; 3247 if (scaleComponent.Z != 0) ScaleOffset = scale.Z;
3210 ScaleOffset = Math.Abs(ScaleOffset); 3248 ScaleOffset = Math.Abs(ScaleOffset);
3211 Vector3 intersectionpoint = new Vector3(ei.ipoint.X, ei.ipoint.Y, ei.ipoint.Z); 3249 Vector3 intersectionpoint = ei.ipoint;
3212 Vector3 normal = new Vector3(ei.normal.X, ei.normal.Y, ei.normal.Z); 3250 Vector3 normal = ei.normal;
3213 Vector3 offset = normal * (ScaleOffset / 2f); 3251 Vector3 offset = normal * (ScaleOffset / 2f);
3214 pos = intersectionpoint + offset; 3252 pos = intersectionpoint + offset;
3215 3253
@@ -3229,6 +3267,7 @@ namespace OpenSim.Region.Framework.Scenes
3229 { 3267 {
3230 copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity); 3268 copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity);
3231 } 3269 }
3270
3232 if (copy != null) 3271 if (copy != null)
3233 EventManager.TriggerObjectAddedToScene(copy); 3272 EventManager.TriggerObjectAddedToScene(copy);
3234 } 3273 }
@@ -5061,7 +5100,7 @@ namespace OpenSim.Region.Framework.Scenes
5061 case PhysicsJointType.Ball: 5100 case PhysicsJointType.Ball:
5062 { 5101 {
5063 Vector3 jointAnchor = PhysicsScene.GetJointAnchor(joint); 5102 Vector3 jointAnchor = PhysicsScene.GetJointAnchor(joint);
5064 Vector3 proxyPos = new Vector3(jointAnchor.X, jointAnchor.Y, jointAnchor.Z); 5103 Vector3 proxyPos = jointAnchor;
5065 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update 5104 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update
5066 } 5105 }
5067 break; 5106 break;
@@ -5086,7 +5125,7 @@ namespace OpenSim.Region.Framework.Scenes
5086 jointErrorMessage(joint, "joint.TrackedBodyName is null, joint " + joint.ObjectNameInScene); 5125 jointErrorMessage(joint, "joint.TrackedBodyName is null, joint " + joint.ObjectNameInScene);
5087 } 5126 }
5088 5127
5089 Vector3 proxyPos = new Vector3(jointAnchor.X, jointAnchor.Y, jointAnchor.Z); 5128 Vector3 proxyPos = jointAnchor;
5090 Quaternion q = trackedBody.RotationOffset * joint.LocalRotation; 5129 Quaternion q = trackedBody.RotationOffset * joint.LocalRotation;
5091 5130
5092 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update 5131 jointProxyObject.ParentGroup.UpdateGroupPosition(proxyPos); // schedules the entire group for a terse update
@@ -5187,8 +5226,8 @@ namespace OpenSim.Region.Framework.Scenes
5187 y = Heightmap.Height - 1; 5226 y = Heightmap.Height - 1;
5188 5227
5189 Vector3 p0 = new Vector3(x, y, (float)Heightmap[(int)x, (int)y]); 5228 Vector3 p0 = new Vector3(x, y, (float)Heightmap[(int)x, (int)y]);
5190 Vector3 p1 = new Vector3(p0); 5229 Vector3 p1 = p0;
5191 Vector3 p2 = new Vector3(p0); 5230 Vector3 p2 = p0;
5192 5231
5193 p1.X += 1.0f; 5232 p1.X += 1.0f;
5194 if (p1.X < Heightmap.Width) 5233 if (p1.X < Heightmap.Width)
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index 0445268..aaddce6 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -196,7 +196,8 @@ namespace OpenSim.Region.Framework.Scenes
196 /// Number of frames to update. Exits on shutdown even if there are frames remaining. 196 /// Number of frames to update. Exits on shutdown even if there are frames remaining.
197 /// If -1 then updates until shutdown. 197 /// If -1 then updates until shutdown.
198 /// </param> 198 /// </param>
199 public abstract void Update(int frames); 199 /// <returns>true if update completed within minimum frame time, false otherwise.</returns>
200 public abstract bool Update(int frames);
200 201
201 #endregion 202 #endregion
202 203
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 3678c7e..51f50d9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -1446,8 +1446,9 @@ namespace OpenSim.Region.Framework.Scenes
1446 { 1446 {
1447 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.) 1447 if (m_parentScene.Permissions.CanMoveObject(group.UUID, remoteClient.AgentId))// && PermissionsMngr.)
1448 { 1448 {
1449 group.GrabMovement(offset, pos, remoteClient); 1449 group.GrabMovement(objectID, offset, pos, remoteClient);
1450 } 1450 }
1451
1451 // This is outside the above permissions condition 1452 // This is outside the above permissions condition
1452 // so that if the object is locked the client moving the object 1453 // so that if the object is locked the client moving the object
1453 // get's it's position on the simulator even if it was the same as before 1454 // get's it's position on the simulator even if it was the same as before
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 69491b7..2aeccd8 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -828,6 +828,12 @@ namespace OpenSim.Region.Framework.Scenes
828 public UUID FromFolderID { get; set; } 828 public UUID FromFolderID { get; set; }
829 829
830 /// <summary> 830 /// <summary>
831 /// If true then grabs are blocked no matter what the individual part BlockGrab setting.
832 /// </summary>
833 /// <value><c>true</c> if block grab override; otherwise, <c>false</c>.</value>
834 public bool BlockGrabOverride { get; set; }
835
836 /// <summary>
831 /// IDs of all avatars sat on this scene object. 837 /// IDs of all avatars sat on this scene object.
832 /// </summary> 838 /// </summary>
833 /// <remarks> 839 /// <remarks>
@@ -902,6 +908,34 @@ namespace OpenSim.Region.Framework.Scenes
902 } 908 }
903 } 909 }
904 910
911 public void LoadScriptState(XmlReader reader)
912 {
913// m_log.DebugFormat("[SCENE OBJECT GROUP]: Looking for script state for {0} in {1}", Name);
914
915 while (reader.ReadToFollowing("SavedScriptState"))
916 {
917// m_log.DebugFormat("[SCENE OBJECT GROUP]: Loading script state for {0}", Name);
918
919 if (m_savedScriptState == null)
920 m_savedScriptState = new Dictionary<UUID, string>();
921
922 string uuid = reader.GetAttribute("UUID");
923
924 if (uuid != null)
925 {
926// m_log.DebugFormat("[SCENE OBJECT GROUP]: Found state for item ID {0} in object {1}", uuid, Name);
927
928 UUID itemid = new UUID(uuid);
929 if (itemid != UUID.Zero)
930 m_savedScriptState[itemid] = reader.ReadInnerXml();
931 }
932 else
933 {
934 m_log.WarnFormat("[SCENE OBJECT GROUP]: SavedScriptState element had no UUID in object {0}", Name);
935 }
936 }
937 }
938
905 /// <summary> 939 /// <summary>
906 /// Hooks this object up to the backup event so that it is persisted to the database when the update thread executes. 940 /// Hooks this object up to the backup event so that it is persisted to the database when the update thread executes.
907 /// </summary> 941 /// </summary>
@@ -2582,20 +2616,26 @@ namespace OpenSim.Region.Framework.Scenes
2582 /// If object is physical, apply force to move it around 2616 /// If object is physical, apply force to move it around
2583 /// If object is not physical, just put it at the resulting location 2617 /// If object is not physical, just put it at the resulting location
2584 /// </summary> 2618 /// </summary>
2619 /// <param name="partID">Part ID to check for grab</param>
2585 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param> 2620 /// <param name="offset">Always seems to be 0,0,0, so ignoring</param>
2586 /// <param name="pos">New position. We do the math here to turn it into a force</param> 2621 /// <param name="pos">New position. We do the math here to turn it into a force</param>
2587 /// <param name="remoteClient"></param> 2622 /// <param name="remoteClient"></param>
2588 public void GrabMovement(Vector3 offset, Vector3 pos, IClientAPI remoteClient) 2623 public void GrabMovement(UUID partID, Vector3 offset, Vector3 pos, IClientAPI remoteClient)
2589 { 2624 {
2590 if (m_scene.EventManager.TriggerGroupMove(UUID, pos)) 2625 if (m_scene.EventManager.TriggerGroupMove(UUID, pos))
2591 { 2626 {
2627 SceneObjectPart part = GetPart(partID);
2628
2629 if (part == null)
2630 return;
2631
2592 PhysicsActor pa = m_rootPart.PhysActor; 2632 PhysicsActor pa = m_rootPart.PhysActor;
2593 2633
2594 if (pa != null) 2634 if (pa != null)
2595 { 2635 {
2596 if (pa.IsPhysical) 2636 if (pa.IsPhysical)
2597 { 2637 {
2598 if (!m_rootPart.BlockGrab) 2638 if (!BlockGrabOverride && !part.BlockGrab)
2599 { 2639 {
2600 Vector3 llmoveforce = pos - AbsolutePosition; 2640 Vector3 llmoveforce = pos - AbsolutePosition;
2601 Vector3 grabforce = llmoveforce; 2641 Vector3 grabforce = llmoveforce;
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 31fc26e..8785ca9 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -186,7 +186,7 @@ namespace OpenSim.Region.Framework.Scenes
186 186
187 public bool RETURN_AT_EDGE; 187 public bool RETURN_AT_EDGE;
188 188
189 public bool BlockGrab; 189 public bool BlockGrab { get; set; }
190 190
191 public bool StatusSandbox; 191 public bool StatusSandbox;
192 192
@@ -2044,7 +2044,7 @@ namespace OpenSim.Region.Framework.Scenes
2044 /// </summary> 2044 /// </summary>
2045 /// <param name="xmlReader"></param> 2045 /// <param name="xmlReader"></param>
2046 /// <returns></returns> 2046 /// <returns></returns>
2047 public static SceneObjectPart FromXml(XmlTextReader xmlReader) 2047 public static SceneObjectPart FromXml(XmlReader xmlReader)
2048 { 2048 {
2049 SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader); 2049 SceneObjectPart part = SceneObjectSerializer.Xml2ToSOP(xmlReader);
2050 2050
@@ -2079,22 +2079,6 @@ namespace OpenSim.Region.Framework.Scenes
2079 ParentGroup.RootPart.RETURN_AT_EDGE = p; 2079 ParentGroup.RootPart.RETURN_AT_EDGE = p;
2080 } 2080 }
2081 2081
2082 public bool GetBlockGrab()
2083 {
2084 if (ParentGroup.IsDeleted)
2085 return false;
2086
2087 return ParentGroup.RootPart.BlockGrab;
2088 }
2089
2090 public void SetBlockGrab(bool p)
2091 {
2092 if (ParentGroup.IsDeleted)
2093 return;
2094
2095 ParentGroup.RootPart.BlockGrab = p;
2096 }
2097
2098 public void SetStatusSandbox(bool p) 2082 public void SetStatusSandbox(bool p)
2099 { 2083 {
2100 if (ParentGroup.IsDeleted) 2084 if (ParentGroup.IsDeleted)
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ebbc6f3..e0b7640 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -622,9 +622,14 @@ namespace OpenSim.Region.Framework.Scenes
622// "[SCENE PRESENCE]: Set velocity {0} for {1} in {2} via getting Velocity!", 622// "[SCENE PRESENCE]: Set velocity {0} for {1} in {2} via getting Velocity!",
623// m_velocity, Name, Scene.RegionInfo.RegionName); 623// m_velocity, Name, Scene.RegionInfo.RegionName);
624 } 624 }
625 else if (ParentPart != null)
626 {
627 return ParentPart.ParentGroup.Velocity;
628 }
625 629
626 return m_velocity; 630 return m_velocity;
627 } 631 }
632
628 set 633 set
629 { 634 {
630 if (PhysicsActor != null) 635 if (PhysicsActor != null)
@@ -2631,7 +2636,7 @@ namespace OpenSim.Region.Framework.Scenes
2631 2636
2632// Vector3 standPositionAdjustment 2637// Vector3 standPositionAdjustment
2633// = part.SitTargetPosition + new Vector3(0.5f, 0f, m_sitAvatarHeight / 2f); 2638// = part.SitTargetPosition + new Vector3(0.5f, 0f, m_sitAvatarHeight / 2f);
2634 Vector3 adjustmentForSitPosition = part.SitTargetPosition * part.GetWorldRotation(); 2639 Vector3 adjustmentForSitPosition = (part.SitTargetPosition + OffsetPosition) * part.GetWorldRotation();
2635 2640
2636 // XXX: This is based on the physics capsule sizes. Need to find a better way to read this rather than 2641 // XXX: This is based on the physics capsule sizes. Need to find a better way to read this rather than
2637 // hardcoding here. 2642 // hardcoding here.
diff --git a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
index e68f954..3899b99 100644
--- a/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
+++ b/OpenSim/Region/Framework/Scenes/Serialization/SceneObjectSerializer.cs
@@ -59,57 +59,59 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
59 /// <returns>The scene object deserialized. Null on failure.</returns> 59 /// <returns>The scene object deserialized. Null on failure.</returns>
60 public static SceneObjectGroup FromOriginalXmlFormat(string xmlData) 60 public static SceneObjectGroup FromOriginalXmlFormat(string xmlData)
61 { 61 {
62 using (XmlTextReader wrappedReader = new XmlTextReader(xmlData, XmlNodeType.Element, null))
63 using (XmlReader reader = XmlReader.Create(wrappedReader, new XmlReaderSettings() { IgnoreWhitespace = true, ConformanceLevel = ConformanceLevel.Fragment }))
64 return FromOriginalXmlFormat(reader);
65 }
66
67 /// <summary>
68 /// Deserialize a scene object from the original xml format
69 /// </summary>
70 /// <param name="xmlData"></param>
71 /// <returns>The scene object deserialized. Null on failure.</returns>
72 public static SceneObjectGroup FromOriginalXmlFormat(XmlReader reader)
73 {
62 //m_log.DebugFormat("[SOG]: Starting deserialization of SOG"); 74 //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
63 //int time = System.Environment.TickCount; 75 //int time = System.Environment.TickCount;
64 76
77 SceneObjectGroup sceneObject = null;
78
65 try 79 try
66 { 80 {
67 StringReader sr;
68 XmlTextReader reader;
69 XmlNodeList parts;
70 XmlDocument doc;
71 int linkNum; 81 int linkNum;
72 82
73 doc = new XmlDocument(); 83 reader.ReadToFollowing("RootPart");
74 doc.LoadXml(xmlData); 84 reader.ReadToFollowing("SceneObjectPart");
75 parts = doc.GetElementsByTagName("RootPart"); 85 sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
86 reader.ReadToFollowing("OtherParts");
76 87
77 if (parts.Count == 0) 88 if (reader.ReadToDescendant("Part"))
78 throw new Exception("Invalid Xml format - no root part");
79
80 sr = new StringReader(parts[0].InnerXml);
81 reader = new XmlTextReader(sr);
82 SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
83 reader.Close();
84 sr.Close();
85
86 parts = doc.GetElementsByTagName("Part");
87
88 for (int i = 0; i < parts.Count; i++)
89 { 89 {
90 sr = new StringReader(parts[i].InnerXml); 90 do
91 reader = new XmlTextReader(sr); 91 {
92 SceneObjectPart part = SceneObjectPart.FromXml(reader); 92 if (reader.ReadToDescendant("SceneObjectPart"))
93 linkNum = part.LinkNum; 93 {
94 sceneObject.AddPart(part); 94 SceneObjectPart part = SceneObjectPart.FromXml(reader);
95 part.LinkNum = linkNum; 95 linkNum = part.LinkNum;
96 part.TrimPermissions(); 96 sceneObject.AddPart(part);
97 reader.Close(); 97 part.LinkNum = linkNum;
98 sr.Close(); 98 part.TrimPermissions();
99 }
100 }
101 while (reader.ReadToNextSibling("Part"));
99 } 102 }
100 103
101 // Script state may, or may not, exist. Not having any, is NOT 104 // Script state may, or may not, exist. Not having any, is NOT
102 // ever a problem. 105 // ever a problem.
103 sceneObject.LoadScriptState(doc); 106 sceneObject.LoadScriptState(reader);
104
105 return sceneObject;
106 } 107 }
107 catch (Exception e) 108 catch (Exception e)
108 { 109 {
109 m_log.ErrorFormat( 110 m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed. Exception {0}", e);
110 "[SERIALIZER]: Deserialization of xml failed with {0}. xml was {1}", e, xmlData);
111 return null; 111 return null;
112 } 112 }
113
114 return sceneObject;
113 } 115 }
114 116
115 /// <summary> 117 /// <summary>
@@ -369,14 +371,14 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
369 371
370 #region manual serialization 372 #region manual serialization
371 373
372 private static Dictionary<string, Action<SceneObjectPart, XmlTextReader>> m_SOPXmlProcessors 374 private static Dictionary<string, Action<SceneObjectPart, XmlReader>> m_SOPXmlProcessors
373 = new Dictionary<string, Action<SceneObjectPart, XmlTextReader>>(); 375 = new Dictionary<string, Action<SceneObjectPart, XmlReader>>();
374 376
375 private static Dictionary<string, Action<TaskInventoryItem, XmlTextReader>> m_TaskInventoryXmlProcessors 377 private static Dictionary<string, Action<TaskInventoryItem, XmlReader>> m_TaskInventoryXmlProcessors
376 = new Dictionary<string, Action<TaskInventoryItem, XmlTextReader>>(); 378 = new Dictionary<string, Action<TaskInventoryItem, XmlReader>>();
377 379
378 private static Dictionary<string, Action<PrimitiveBaseShape, XmlTextReader>> m_ShapeXmlProcessors 380 private static Dictionary<string, Action<PrimitiveBaseShape, XmlReader>> m_ShapeXmlProcessors
379 = new Dictionary<string, Action<PrimitiveBaseShape, XmlTextReader>>(); 381 = new Dictionary<string, Action<PrimitiveBaseShape, XmlReader>>();
380 382
381 static SceneObjectSerializer() 383 static SceneObjectSerializer()
382 { 384 {
@@ -532,112 +534,112 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
532 } 534 }
533 535
534 #region SOPXmlProcessors 536 #region SOPXmlProcessors
535 private static void ProcessAllowedDrop(SceneObjectPart obj, XmlTextReader reader) 537 private static void ProcessAllowedDrop(SceneObjectPart obj, XmlReader reader)
536 { 538 {
537 obj.AllowedDrop = Util.ReadBoolean(reader); 539 obj.AllowedDrop = Util.ReadBoolean(reader);
538 } 540 }
539 541
540 private static void ProcessCreatorID(SceneObjectPart obj, XmlTextReader reader) 542 private static void ProcessCreatorID(SceneObjectPart obj, XmlReader reader)
541 { 543 {
542 obj.CreatorID = Util.ReadUUID(reader, "CreatorID"); 544 obj.CreatorID = Util.ReadUUID(reader, "CreatorID");
543 } 545 }
544 546
545 private static void ProcessCreatorData(SceneObjectPart obj, XmlTextReader reader) 547 private static void ProcessCreatorData(SceneObjectPart obj, XmlReader reader)
546 { 548 {
547 obj.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty); 549 obj.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
548 } 550 }
549 551
550 private static void ProcessFolderID(SceneObjectPart obj, XmlTextReader reader) 552 private static void ProcessFolderID(SceneObjectPart obj, XmlReader reader)
551 { 553 {
552 obj.FolderID = Util.ReadUUID(reader, "FolderID"); 554 obj.FolderID = Util.ReadUUID(reader, "FolderID");
553 } 555 }
554 556
555 private static void ProcessInventorySerial(SceneObjectPart obj, XmlTextReader reader) 557 private static void ProcessInventorySerial(SceneObjectPart obj, XmlReader reader)
556 { 558 {
557 obj.InventorySerial = (uint)reader.ReadElementContentAsInt("InventorySerial", String.Empty); 559 obj.InventorySerial = (uint)reader.ReadElementContentAsInt("InventorySerial", String.Empty);
558 } 560 }
559 561
560 private static void ProcessTaskInventory(SceneObjectPart obj, XmlTextReader reader) 562 private static void ProcessTaskInventory(SceneObjectPart obj, XmlReader reader)
561 { 563 {
562 obj.TaskInventory = ReadTaskInventory(reader, "TaskInventory"); 564 obj.TaskInventory = ReadTaskInventory(reader, "TaskInventory");
563 } 565 }
564 566
565 private static void ProcessUUID(SceneObjectPart obj, XmlTextReader reader) 567 private static void ProcessUUID(SceneObjectPart obj, XmlReader reader)
566 { 568 {
567 obj.UUID = Util.ReadUUID(reader, "UUID"); 569 obj.UUID = Util.ReadUUID(reader, "UUID");
568 } 570 }
569 571
570 private static void ProcessLocalId(SceneObjectPart obj, XmlTextReader reader) 572 private static void ProcessLocalId(SceneObjectPart obj, XmlReader reader)
571 { 573 {
572 obj.LocalId = (uint)reader.ReadElementContentAsLong("LocalId", String.Empty); 574 obj.LocalId = (uint)reader.ReadElementContentAsLong("LocalId", String.Empty);
573 } 575 }
574 576
575 private static void ProcessName(SceneObjectPart obj, XmlTextReader reader) 577 private static void ProcessName(SceneObjectPart obj, XmlReader reader)
576 { 578 {
577 obj.Name = reader.ReadElementString("Name"); 579 obj.Name = reader.ReadElementString("Name");
578 } 580 }
579 581
580 private static void ProcessMaterial(SceneObjectPart obj, XmlTextReader reader) 582 private static void ProcessMaterial(SceneObjectPart obj, XmlReader reader)
581 { 583 {
582 obj.Material = (byte)reader.ReadElementContentAsInt("Material", String.Empty); 584 obj.Material = (byte)reader.ReadElementContentAsInt("Material", String.Empty);
583 } 585 }
584 586
585 private static void ProcessPassTouches(SceneObjectPart obj, XmlTextReader reader) 587 private static void ProcessPassTouches(SceneObjectPart obj, XmlReader reader)
586 { 588 {
587 obj.PassTouches = Util.ReadBoolean(reader); 589 obj.PassTouches = Util.ReadBoolean(reader);
588 } 590 }
589 591
590 private static void ProcessPassCollisions(SceneObjectPart obj, XmlTextReader reader) 592 private static void ProcessPassCollisions(SceneObjectPart obj, XmlReader reader)
591 { 593 {
592 obj.PassCollisions = Util.ReadBoolean(reader); 594 obj.PassCollisions = Util.ReadBoolean(reader);
593 } 595 }
594 596
595 private static void ProcessRegionHandle(SceneObjectPart obj, XmlTextReader reader) 597 private static void ProcessRegionHandle(SceneObjectPart obj, XmlReader reader)
596 { 598 {
597 obj.RegionHandle = (ulong)reader.ReadElementContentAsLong("RegionHandle", String.Empty); 599 obj.RegionHandle = (ulong)reader.ReadElementContentAsLong("RegionHandle", String.Empty);
598 } 600 }
599 601
600 private static void ProcessScriptAccessPin(SceneObjectPart obj, XmlTextReader reader) 602 private static void ProcessScriptAccessPin(SceneObjectPart obj, XmlReader reader)
601 { 603 {
602 obj.ScriptAccessPin = reader.ReadElementContentAsInt("ScriptAccessPin", String.Empty); 604 obj.ScriptAccessPin = reader.ReadElementContentAsInt("ScriptAccessPin", String.Empty);
603 } 605 }
604 606
605 private static void ProcessGroupPosition(SceneObjectPart obj, XmlTextReader reader) 607 private static void ProcessGroupPosition(SceneObjectPart obj, XmlReader reader)
606 { 608 {
607 obj.GroupPosition = Util.ReadVector(reader, "GroupPosition"); 609 obj.GroupPosition = Util.ReadVector(reader, "GroupPosition");
608 } 610 }
609 611
610 private static void ProcessOffsetPosition(SceneObjectPart obj, XmlTextReader reader) 612 private static void ProcessOffsetPosition(SceneObjectPart obj, XmlReader reader)
611 { 613 {
612 obj.OffsetPosition = Util.ReadVector(reader, "OffsetPosition"); ; 614 obj.OffsetPosition = Util.ReadVector(reader, "OffsetPosition"); ;
613 } 615 }
614 616
615 private static void ProcessRotationOffset(SceneObjectPart obj, XmlTextReader reader) 617 private static void ProcessRotationOffset(SceneObjectPart obj, XmlReader reader)
616 { 618 {
617 obj.RotationOffset = Util.ReadQuaternion(reader, "RotationOffset"); 619 obj.RotationOffset = Util.ReadQuaternion(reader, "RotationOffset");
618 } 620 }
619 621
620 private static void ProcessVelocity(SceneObjectPart obj, XmlTextReader reader) 622 private static void ProcessVelocity(SceneObjectPart obj, XmlReader reader)
621 { 623 {
622 obj.Velocity = Util.ReadVector(reader, "Velocity"); 624 obj.Velocity = Util.ReadVector(reader, "Velocity");
623 } 625 }
624 626
625 private static void ProcessAngularVelocity(SceneObjectPart obj, XmlTextReader reader) 627 private static void ProcessAngularVelocity(SceneObjectPart obj, XmlReader reader)
626 { 628 {
627 obj.AngularVelocity = Util.ReadVector(reader, "AngularVelocity"); 629 obj.AngularVelocity = Util.ReadVector(reader, "AngularVelocity");
628 } 630 }
629 631
630 private static void ProcessAcceleration(SceneObjectPart obj, XmlTextReader reader) 632 private static void ProcessAcceleration(SceneObjectPart obj, XmlReader reader)
631 { 633 {
632 obj.Acceleration = Util.ReadVector(reader, "Acceleration"); 634 obj.Acceleration = Util.ReadVector(reader, "Acceleration");
633 } 635 }
634 636
635 private static void ProcessDescription(SceneObjectPart obj, XmlTextReader reader) 637 private static void ProcessDescription(SceneObjectPart obj, XmlReader reader)
636 { 638 {
637 obj.Description = reader.ReadElementString("Description"); 639 obj.Description = reader.ReadElementString("Description");
638 } 640 }
639 641
640 private static void ProcessColor(SceneObjectPart obj, XmlTextReader reader) 642 private static void ProcessColor(SceneObjectPart obj, XmlReader reader)
641 { 643 {
642 reader.ReadStartElement("Color"); 644 reader.ReadStartElement("Color");
643 if (reader.Name == "R") 645 if (reader.Name == "R")
@@ -651,57 +653,57 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
651 } 653 }
652 } 654 }
653 655
654 private static void ProcessText(SceneObjectPart obj, XmlTextReader reader) 656 private static void ProcessText(SceneObjectPart obj, XmlReader reader)
655 { 657 {
656 obj.Text = reader.ReadElementString("Text", String.Empty); 658 obj.Text = reader.ReadElementString("Text", String.Empty);
657 } 659 }
658 660
659 private static void ProcessSitName(SceneObjectPart obj, XmlTextReader reader) 661 private static void ProcessSitName(SceneObjectPart obj, XmlReader reader)
660 { 662 {
661 obj.SitName = reader.ReadElementString("SitName", String.Empty); 663 obj.SitName = reader.ReadElementString("SitName", String.Empty);
662 } 664 }
663 665
664 private static void ProcessTouchName(SceneObjectPart obj, XmlTextReader reader) 666 private static void ProcessTouchName(SceneObjectPart obj, XmlReader reader)
665 { 667 {
666 obj.TouchName = reader.ReadElementString("TouchName", String.Empty); 668 obj.TouchName = reader.ReadElementString("TouchName", String.Empty);
667 } 669 }
668 670
669 private static void ProcessLinkNum(SceneObjectPart obj, XmlTextReader reader) 671 private static void ProcessLinkNum(SceneObjectPart obj, XmlReader reader)
670 { 672 {
671 obj.LinkNum = reader.ReadElementContentAsInt("LinkNum", String.Empty); 673 obj.LinkNum = reader.ReadElementContentAsInt("LinkNum", String.Empty);
672 } 674 }
673 675
674 private static void ProcessClickAction(SceneObjectPart obj, XmlTextReader reader) 676 private static void ProcessClickAction(SceneObjectPart obj, XmlReader reader)
675 { 677 {
676 obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty); 678 obj.ClickAction = (byte)reader.ReadElementContentAsInt("ClickAction", String.Empty);
677 } 679 }
678 680
679 private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlTextReader reader) 681 private static void ProcessPhysicsShapeType(SceneObjectPart obj, XmlReader reader)
680 { 682 {
681 obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty); 683 obj.PhysicsShapeType = (byte)reader.ReadElementContentAsInt("PhysicsShapeType", String.Empty);
682 } 684 }
683 685
684 private static void ProcessDensity(SceneObjectPart obj, XmlTextReader reader) 686 private static void ProcessDensity(SceneObjectPart obj, XmlReader reader)
685 { 687 {
686 obj.Density = reader.ReadElementContentAsFloat("Density", String.Empty); 688 obj.Density = reader.ReadElementContentAsFloat("Density", String.Empty);
687 } 689 }
688 690
689 private static void ProcessFriction(SceneObjectPart obj, XmlTextReader reader) 691 private static void ProcessFriction(SceneObjectPart obj, XmlReader reader)
690 { 692 {
691 obj.Friction = reader.ReadElementContentAsFloat("Friction", String.Empty); 693 obj.Friction = reader.ReadElementContentAsFloat("Friction", String.Empty);
692 } 694 }
693 695
694 private static void ProcessBounce(SceneObjectPart obj, XmlTextReader reader) 696 private static void ProcessBounce(SceneObjectPart obj, XmlReader reader)
695 { 697 {
696 obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty); 698 obj.Restitution = reader.ReadElementContentAsFloat("Bounce", String.Empty);
697 } 699 }
698 700
699 private static void ProcessGravityModifier(SceneObjectPart obj, XmlTextReader reader) 701 private static void ProcessGravityModifier(SceneObjectPart obj, XmlReader reader)
700 { 702 {
701 obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty); 703 obj.GravityModifier = reader.ReadElementContentAsFloat("GravityModifier", String.Empty);
702 } 704 }
703 705
704 private static void ProcessShape(SceneObjectPart obj, XmlTextReader reader) 706 private static void ProcessShape(SceneObjectPart obj, XmlReader reader)
705 { 707 {
706 List<string> errorNodeNames; 708 List<string> errorNodeNames;
707 obj.Shape = ReadShape(reader, "Shape", out errorNodeNames); 709 obj.Shape = ReadShape(reader, "Shape", out errorNodeNames);
@@ -714,163 +716,163 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
714 } 716 }
715 } 717 }
716 718
717 private static void ProcessScale(SceneObjectPart obj, XmlTextReader reader) 719 private static void ProcessScale(SceneObjectPart obj, XmlReader reader)
718 { 720 {
719 obj.Scale = Util.ReadVector(reader, "Scale"); 721 obj.Scale = Util.ReadVector(reader, "Scale");
720 } 722 }
721 723
722 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader) 724 private static void ProcessSitTargetOrientation(SceneObjectPart obj, XmlReader reader)
723 { 725 {
724 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation"); 726 obj.SitTargetOrientation = Util.ReadQuaternion(reader, "SitTargetOrientation");
725 } 727 }
726 728
727 private static void ProcessSitTargetPosition(SceneObjectPart obj, XmlTextReader reader) 729 private static void ProcessSitTargetPosition(SceneObjectPart obj, XmlReader reader)
728 { 730 {
729 obj.SitTargetPosition = Util.ReadVector(reader, "SitTargetPosition"); 731 obj.SitTargetPosition = Util.ReadVector(reader, "SitTargetPosition");
730 } 732 }
731 733
732 private static void ProcessSitTargetPositionLL(SceneObjectPart obj, XmlTextReader reader) 734 private static void ProcessSitTargetPositionLL(SceneObjectPart obj, XmlReader reader)
733 { 735 {
734 obj.SitTargetPositionLL = Util.ReadVector(reader, "SitTargetPositionLL"); 736 obj.SitTargetPositionLL = Util.ReadVector(reader, "SitTargetPositionLL");
735 } 737 }
736 738
737 private static void ProcessSitTargetOrientationLL(SceneObjectPart obj, XmlTextReader reader) 739 private static void ProcessSitTargetOrientationLL(SceneObjectPart obj, XmlReader reader)
738 { 740 {
739 obj.SitTargetOrientationLL = Util.ReadQuaternion(reader, "SitTargetOrientationLL"); 741 obj.SitTargetOrientationLL = Util.ReadQuaternion(reader, "SitTargetOrientationLL");
740 } 742 }
741 743
742 private static void ProcessParentID(SceneObjectPart obj, XmlTextReader reader) 744 private static void ProcessParentID(SceneObjectPart obj, XmlReader reader)
743 { 745 {
744 string str = reader.ReadElementContentAsString("ParentID", String.Empty); 746 string str = reader.ReadElementContentAsString("ParentID", String.Empty);
745 obj.ParentID = Convert.ToUInt32(str); 747 obj.ParentID = Convert.ToUInt32(str);
746 } 748 }
747 749
748 private static void ProcessCreationDate(SceneObjectPart obj, XmlTextReader reader) 750 private static void ProcessCreationDate(SceneObjectPart obj, XmlReader reader)
749 { 751 {
750 obj.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty); 752 obj.CreationDate = reader.ReadElementContentAsInt("CreationDate", String.Empty);
751 } 753 }
752 754
753 private static void ProcessCategory(SceneObjectPart obj, XmlTextReader reader) 755 private static void ProcessCategory(SceneObjectPart obj, XmlReader reader)
754 { 756 {
755 obj.Category = (uint)reader.ReadElementContentAsInt("Category", String.Empty); 757 obj.Category = (uint)reader.ReadElementContentAsInt("Category", String.Empty);
756 } 758 }
757 759
758 private static void ProcessSalePrice(SceneObjectPart obj, XmlTextReader reader) 760 private static void ProcessSalePrice(SceneObjectPart obj, XmlReader reader)
759 { 761 {
760 obj.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty); 762 obj.SalePrice = reader.ReadElementContentAsInt("SalePrice", String.Empty);
761 } 763 }
762 764
763 private static void ProcessObjectSaleType(SceneObjectPart obj, XmlTextReader reader) 765 private static void ProcessObjectSaleType(SceneObjectPart obj, XmlReader reader)
764 { 766 {
765 obj.ObjectSaleType = (byte)reader.ReadElementContentAsInt("ObjectSaleType", String.Empty); 767 obj.ObjectSaleType = (byte)reader.ReadElementContentAsInt("ObjectSaleType", String.Empty);
766 } 768 }
767 769
768 private static void ProcessOwnershipCost(SceneObjectPart obj, XmlTextReader reader) 770 private static void ProcessOwnershipCost(SceneObjectPart obj, XmlReader reader)
769 { 771 {
770 obj.OwnershipCost = reader.ReadElementContentAsInt("OwnershipCost", String.Empty); 772 obj.OwnershipCost = reader.ReadElementContentAsInt("OwnershipCost", String.Empty);
771 } 773 }
772 774
773 private static void ProcessGroupID(SceneObjectPart obj, XmlTextReader reader) 775 private static void ProcessGroupID(SceneObjectPart obj, XmlReader reader)
774 { 776 {
775 obj.GroupID = Util.ReadUUID(reader, "GroupID"); 777 obj.GroupID = Util.ReadUUID(reader, "GroupID");
776 } 778 }
777 779
778 private static void ProcessOwnerID(SceneObjectPart obj, XmlTextReader reader) 780 private static void ProcessOwnerID(SceneObjectPart obj, XmlReader reader)
779 { 781 {
780 obj.OwnerID = Util.ReadUUID(reader, "OwnerID"); 782 obj.OwnerID = Util.ReadUUID(reader, "OwnerID");
781 } 783 }
782 784
783 private static void ProcessLastOwnerID(SceneObjectPart obj, XmlTextReader reader) 785 private static void ProcessLastOwnerID(SceneObjectPart obj, XmlReader reader)
784 { 786 {
785 obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID"); 787 obj.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID");
786 } 788 }
787 789
788 private static void ProcessBaseMask(SceneObjectPart obj, XmlTextReader reader) 790 private static void ProcessBaseMask(SceneObjectPart obj, XmlReader reader)
789 { 791 {
790 obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty); 792 obj.BaseMask = (uint)reader.ReadElementContentAsInt("BaseMask", String.Empty);
791 } 793 }
792 794
793 private static void ProcessOwnerMask(SceneObjectPart obj, XmlTextReader reader) 795 private static void ProcessOwnerMask(SceneObjectPart obj, XmlReader reader)
794 { 796 {
795 obj.OwnerMask = (uint)reader.ReadElementContentAsInt("OwnerMask", String.Empty); 797 obj.OwnerMask = (uint)reader.ReadElementContentAsInt("OwnerMask", String.Empty);
796 } 798 }
797 799
798 private static void ProcessGroupMask(SceneObjectPart obj, XmlTextReader reader) 800 private static void ProcessGroupMask(SceneObjectPart obj, XmlReader reader)
799 { 801 {
800 obj.GroupMask = (uint)reader.ReadElementContentAsInt("GroupMask", String.Empty); 802 obj.GroupMask = (uint)reader.ReadElementContentAsInt("GroupMask", String.Empty);
801 } 803 }
802 804
803 private static void ProcessEveryoneMask(SceneObjectPart obj, XmlTextReader reader) 805 private static void ProcessEveryoneMask(SceneObjectPart obj, XmlReader reader)
804 { 806 {
805 obj.EveryoneMask = (uint)reader.ReadElementContentAsInt("EveryoneMask", String.Empty); 807 obj.EveryoneMask = (uint)reader.ReadElementContentAsInt("EveryoneMask", String.Empty);
806 } 808 }
807 809
808 private static void ProcessNextOwnerMask(SceneObjectPart obj, XmlTextReader reader) 810 private static void ProcessNextOwnerMask(SceneObjectPart obj, XmlReader reader)
809 { 811 {
810 obj.NextOwnerMask = (uint)reader.ReadElementContentAsInt("NextOwnerMask", String.Empty); 812 obj.NextOwnerMask = (uint)reader.ReadElementContentAsInt("NextOwnerMask", String.Empty);
811 } 813 }
812 814
813 private static void ProcessFlags(SceneObjectPart obj, XmlTextReader reader) 815 private static void ProcessFlags(SceneObjectPart obj, XmlReader reader)
814 { 816 {
815 obj.Flags = Util.ReadEnum<PrimFlags>(reader, "Flags"); 817 obj.Flags = Util.ReadEnum<PrimFlags>(reader, "Flags");
816 } 818 }
817 819
818 private static void ProcessCollisionSound(SceneObjectPart obj, XmlTextReader reader) 820 private static void ProcessCollisionSound(SceneObjectPart obj, XmlReader reader)
819 { 821 {
820 obj.CollisionSound = Util.ReadUUID(reader, "CollisionSound"); 822 obj.CollisionSound = Util.ReadUUID(reader, "CollisionSound");
821 } 823 }
822 824
823 private static void ProcessCollisionSoundVolume(SceneObjectPart obj, XmlTextReader reader) 825 private static void ProcessCollisionSoundVolume(SceneObjectPart obj, XmlReader reader)
824 { 826 {
825 obj.CollisionSoundVolume = reader.ReadElementContentAsFloat("CollisionSoundVolume", String.Empty); 827 obj.CollisionSoundVolume = reader.ReadElementContentAsFloat("CollisionSoundVolume", String.Empty);
826 } 828 }
827 829
828 private static void ProcessMediaUrl(SceneObjectPart obj, XmlTextReader reader) 830 private static void ProcessMediaUrl(SceneObjectPart obj, XmlReader reader)
829 { 831 {
830 obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty); 832 obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty);
831 } 833 }
832 834
833 private static void ProcessAttachedPos(SceneObjectPart obj, XmlTextReader reader) 835 private static void ProcessAttachedPos(SceneObjectPart obj, XmlReader reader)
834 { 836 {
835 obj.AttachedPos = Util.ReadVector(reader, "AttachedPos"); 837 obj.AttachedPos = Util.ReadVector(reader, "AttachedPos");
836 } 838 }
837 839
838 private static void ProcessDynAttrs(SceneObjectPart obj, XmlTextReader reader) 840 private static void ProcessDynAttrs(SceneObjectPart obj, XmlReader reader)
839 { 841 {
840 obj.DynAttrs.ReadXml(reader); 842 obj.DynAttrs.ReadXml(reader);
841 } 843 }
842 844
843 private static void ProcessTextureAnimation(SceneObjectPart obj, XmlTextReader reader) 845 private static void ProcessTextureAnimation(SceneObjectPart obj, XmlReader reader)
844 { 846 {
845 obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty)); 847 obj.TextureAnimation = Convert.FromBase64String(reader.ReadElementContentAsString("TextureAnimation", String.Empty));
846 } 848 }
847 849
848 private static void ProcessParticleSystem(SceneObjectPart obj, XmlTextReader reader) 850 private static void ProcessParticleSystem(SceneObjectPart obj, XmlReader reader)
849 { 851 {
850 obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty)); 852 obj.ParticleSystem = Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty));
851 } 853 }
852 854
853 private static void ProcessPayPrice0(SceneObjectPart obj, XmlTextReader reader) 855 private static void ProcessPayPrice0(SceneObjectPart obj, XmlReader reader)
854 { 856 {
855 obj.PayPrice[0] = (int)reader.ReadElementContentAsInt("PayPrice0", String.Empty); 857 obj.PayPrice[0] = (int)reader.ReadElementContentAsInt("PayPrice0", String.Empty);
856 } 858 }
857 859
858 private static void ProcessPayPrice1(SceneObjectPart obj, XmlTextReader reader) 860 private static void ProcessPayPrice1(SceneObjectPart obj, XmlReader reader)
859 { 861 {
860 obj.PayPrice[1] = (int)reader.ReadElementContentAsInt("PayPrice1", String.Empty); 862 obj.PayPrice[1] = (int)reader.ReadElementContentAsInt("PayPrice1", String.Empty);
861 } 863 }
862 864
863 private static void ProcessPayPrice2(SceneObjectPart obj, XmlTextReader reader) 865 private static void ProcessPayPrice2(SceneObjectPart obj, XmlReader reader)
864 { 866 {
865 obj.PayPrice[2] = (int)reader.ReadElementContentAsInt("PayPrice2", String.Empty); 867 obj.PayPrice[2] = (int)reader.ReadElementContentAsInt("PayPrice2", String.Empty);
866 } 868 }
867 869
868 private static void ProcessPayPrice3(SceneObjectPart obj, XmlTextReader reader) 870 private static void ProcessPayPrice3(SceneObjectPart obj, XmlReader reader)
869 { 871 {
870 obj.PayPrice[3] = (int)reader.ReadElementContentAsInt("PayPrice3", String.Empty); 872 obj.PayPrice[3] = (int)reader.ReadElementContentAsInt("PayPrice3", String.Empty);
871 } 873 }
872 874
873 private static void ProcessPayPrice4(SceneObjectPart obj, XmlTextReader reader) 875 private static void ProcessPayPrice4(SceneObjectPart obj, XmlReader reader)
874 { 876 {
875 obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty); 877 obj.PayPrice[4] = (int)reader.ReadElementContentAsInt("PayPrice4", String.Empty);
876 } 878 }
@@ -878,122 +880,122 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
878 #endregion 880 #endregion
879 881
880 #region TaskInventoryXmlProcessors 882 #region TaskInventoryXmlProcessors
881 private static void ProcessTIAssetID(TaskInventoryItem item, XmlTextReader reader) 883 private static void ProcessTIAssetID(TaskInventoryItem item, XmlReader reader)
882 { 884 {
883 item.AssetID = Util.ReadUUID(reader, "AssetID"); 885 item.AssetID = Util.ReadUUID(reader, "AssetID");
884 } 886 }
885 887
886 private static void ProcessTIBasePermissions(TaskInventoryItem item, XmlTextReader reader) 888 private static void ProcessTIBasePermissions(TaskInventoryItem item, XmlReader reader)
887 { 889 {
888 item.BasePermissions = (uint)reader.ReadElementContentAsInt("BasePermissions", String.Empty); 890 item.BasePermissions = (uint)reader.ReadElementContentAsInt("BasePermissions", String.Empty);
889 } 891 }
890 892
891 private static void ProcessTICreationDate(TaskInventoryItem item, XmlTextReader reader) 893 private static void ProcessTICreationDate(TaskInventoryItem item, XmlReader reader)
892 { 894 {
893 item.CreationDate = (uint)reader.ReadElementContentAsInt("CreationDate", String.Empty); 895 item.CreationDate = (uint)reader.ReadElementContentAsInt("CreationDate", String.Empty);
894 } 896 }
895 897
896 private static void ProcessTICreatorID(TaskInventoryItem item, XmlTextReader reader) 898 private static void ProcessTICreatorID(TaskInventoryItem item, XmlReader reader)
897 { 899 {
898 item.CreatorID = Util.ReadUUID(reader, "CreatorID"); 900 item.CreatorID = Util.ReadUUID(reader, "CreatorID");
899 } 901 }
900 902
901 private static void ProcessTICreatorData(TaskInventoryItem item, XmlTextReader reader) 903 private static void ProcessTICreatorData(TaskInventoryItem item, XmlReader reader)
902 { 904 {
903 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty); 905 item.CreatorData = reader.ReadElementContentAsString("CreatorData", String.Empty);
904 } 906 }
905 907
906 private static void ProcessTIDescription(TaskInventoryItem item, XmlTextReader reader) 908 private static void ProcessTIDescription(TaskInventoryItem item, XmlReader reader)
907 { 909 {
908 item.Description = reader.ReadElementContentAsString("Description", String.Empty); 910 item.Description = reader.ReadElementContentAsString("Description", String.Empty);
909 } 911 }
910 912
911 private static void ProcessTIEveryonePermissions(TaskInventoryItem item, XmlTextReader reader) 913 private static void ProcessTIEveryonePermissions(TaskInventoryItem item, XmlReader reader)
912 { 914 {
913 item.EveryonePermissions = (uint)reader.ReadElementContentAsInt("EveryonePermissions", String.Empty); 915 item.EveryonePermissions = (uint)reader.ReadElementContentAsInt("EveryonePermissions", String.Empty);
914 } 916 }
915 917
916 private static void ProcessTIFlags(TaskInventoryItem item, XmlTextReader reader) 918 private static void ProcessTIFlags(TaskInventoryItem item, XmlReader reader)
917 { 919 {
918 item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty); 920 item.Flags = (uint)reader.ReadElementContentAsInt("Flags", String.Empty);
919 } 921 }
920 922
921 private static void ProcessTIGroupID(TaskInventoryItem item, XmlTextReader reader) 923 private static void ProcessTIGroupID(TaskInventoryItem item, XmlReader reader)
922 { 924 {
923 item.GroupID = Util.ReadUUID(reader, "GroupID"); 925 item.GroupID = Util.ReadUUID(reader, "GroupID");
924 } 926 }
925 927
926 private static void ProcessTIGroupPermissions(TaskInventoryItem item, XmlTextReader reader) 928 private static void ProcessTIGroupPermissions(TaskInventoryItem item, XmlReader reader)
927 { 929 {
928 item.GroupPermissions = (uint)reader.ReadElementContentAsInt("GroupPermissions", String.Empty); 930 item.GroupPermissions = (uint)reader.ReadElementContentAsInt("GroupPermissions", String.Empty);
929 } 931 }
930 932
931 private static void ProcessTIInvType(TaskInventoryItem item, XmlTextReader reader) 933 private static void ProcessTIInvType(TaskInventoryItem item, XmlReader reader)
932 { 934 {
933 item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty); 935 item.InvType = reader.ReadElementContentAsInt("InvType", String.Empty);
934 } 936 }
935 937
936 private static void ProcessTIItemID(TaskInventoryItem item, XmlTextReader reader) 938 private static void ProcessTIItemID(TaskInventoryItem item, XmlReader reader)
937 { 939 {
938 item.ItemID = Util.ReadUUID(reader, "ItemID"); 940 item.ItemID = Util.ReadUUID(reader, "ItemID");
939 } 941 }
940 942
941 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlTextReader reader) 943 private static void ProcessTIOldItemID(TaskInventoryItem item, XmlReader reader)
942 { 944 {
943 item.OldItemID = Util.ReadUUID(reader, "OldItemID"); 945 item.OldItemID = Util.ReadUUID(reader, "OldItemID");
944 } 946 }
945 947
946 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlTextReader reader) 948 private static void ProcessTILastOwnerID(TaskInventoryItem item, XmlReader reader)
947 { 949 {
948 item.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID"); 950 item.LastOwnerID = Util.ReadUUID(reader, "LastOwnerID");
949 } 951 }
950 952
951 private static void ProcessTIName(TaskInventoryItem item, XmlTextReader reader) 953 private static void ProcessTIName(TaskInventoryItem item, XmlReader reader)
952 { 954 {
953 item.Name = reader.ReadElementContentAsString("Name", String.Empty); 955 item.Name = reader.ReadElementContentAsString("Name", String.Empty);
954 } 956 }
955 957
956 private static void ProcessTINextPermissions(TaskInventoryItem item, XmlTextReader reader) 958 private static void ProcessTINextPermissions(TaskInventoryItem item, XmlReader reader)
957 { 959 {
958 item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty); 960 item.NextPermissions = (uint)reader.ReadElementContentAsInt("NextPermissions", String.Empty);
959 } 961 }
960 962
961 private static void ProcessTIOwnerID(TaskInventoryItem item, XmlTextReader reader) 963 private static void ProcessTIOwnerID(TaskInventoryItem item, XmlReader reader)
962 { 964 {
963 item.OwnerID = Util.ReadUUID(reader, "OwnerID"); 965 item.OwnerID = Util.ReadUUID(reader, "OwnerID");
964 } 966 }
965 967
966 private static void ProcessTICurrentPermissions(TaskInventoryItem item, XmlTextReader reader) 968 private static void ProcessTICurrentPermissions(TaskInventoryItem item, XmlReader reader)
967 { 969 {
968 item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty); 970 item.CurrentPermissions = (uint)reader.ReadElementContentAsInt("CurrentPermissions", String.Empty);
969 } 971 }
970 972
971 private static void ProcessTIParentID(TaskInventoryItem item, XmlTextReader reader) 973 private static void ProcessTIParentID(TaskInventoryItem item, XmlReader reader)
972 { 974 {
973 item.ParentID = Util.ReadUUID(reader, "ParentID"); 975 item.ParentID = Util.ReadUUID(reader, "ParentID");
974 } 976 }
975 977
976 private static void ProcessTIParentPartID(TaskInventoryItem item, XmlTextReader reader) 978 private static void ProcessTIParentPartID(TaskInventoryItem item, XmlReader reader)
977 { 979 {
978 item.ParentPartID = Util.ReadUUID(reader, "ParentPartID"); 980 item.ParentPartID = Util.ReadUUID(reader, "ParentPartID");
979 } 981 }
980 982
981 private static void ProcessTIPermsGranter(TaskInventoryItem item, XmlTextReader reader) 983 private static void ProcessTIPermsGranter(TaskInventoryItem item, XmlReader reader)
982 { 984 {
983 item.PermsGranter = Util.ReadUUID(reader, "PermsGranter"); 985 item.PermsGranter = Util.ReadUUID(reader, "PermsGranter");
984 } 986 }
985 987
986 private static void ProcessTIPermsMask(TaskInventoryItem item, XmlTextReader reader) 988 private static void ProcessTIPermsMask(TaskInventoryItem item, XmlReader reader)
987 { 989 {
988 item.PermsMask = reader.ReadElementContentAsInt("PermsMask", String.Empty); 990 item.PermsMask = reader.ReadElementContentAsInt("PermsMask", String.Empty);
989 } 991 }
990 992
991 private static void ProcessTIType(TaskInventoryItem item, XmlTextReader reader) 993 private static void ProcessTIType(TaskInventoryItem item, XmlReader reader)
992 { 994 {
993 item.Type = reader.ReadElementContentAsInt("Type", String.Empty); 995 item.Type = reader.ReadElementContentAsInt("Type", String.Empty);
994 } 996 }
995 997
996 private static void ProcessTIOwnerChanged(TaskInventoryItem item, XmlTextReader reader) 998 private static void ProcessTIOwnerChanged(TaskInventoryItem item, XmlReader reader)
997 { 999 {
998 item.OwnerChanged = Util.ReadBoolean(reader); 1000 item.OwnerChanged = Util.ReadBoolean(reader);
999 } 1001 }
@@ -1001,243 +1003,243 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1001 #endregion 1003 #endregion
1002 1004
1003 #region ShapeXmlProcessors 1005 #region ShapeXmlProcessors
1004 private static void ProcessShpProfileCurve(PrimitiveBaseShape shp, XmlTextReader reader) 1006 private static void ProcessShpProfileCurve(PrimitiveBaseShape shp, XmlReader reader)
1005 { 1007 {
1006 shp.ProfileCurve = (byte)reader.ReadElementContentAsInt("ProfileCurve", String.Empty); 1008 shp.ProfileCurve = (byte)reader.ReadElementContentAsInt("ProfileCurve", String.Empty);
1007 } 1009 }
1008 1010
1009 private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1011 private static void ProcessShpTextureEntry(PrimitiveBaseShape shp, XmlReader reader)
1010 { 1012 {
1011 byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry")); 1013 byte[] teData = Convert.FromBase64String(reader.ReadElementString("TextureEntry"));
1012 shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length); 1014 shp.Textures = new Primitive.TextureEntry(teData, 0, teData.Length);
1013 } 1015 }
1014 1016
1015 private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlTextReader reader) 1017 private static void ProcessShpExtraParams(PrimitiveBaseShape shp, XmlReader reader)
1016 { 1018 {
1017 shp.ExtraParams = Convert.FromBase64String(reader.ReadElementString("ExtraParams")); 1019 shp.ExtraParams = Convert.FromBase64String(reader.ReadElementString("ExtraParams"));
1018 } 1020 }
1019 1021
1020 private static void ProcessShpPathBegin(PrimitiveBaseShape shp, XmlTextReader reader) 1022 private static void ProcessShpPathBegin(PrimitiveBaseShape shp, XmlReader reader)
1021 { 1023 {
1022 shp.PathBegin = (ushort)reader.ReadElementContentAsInt("PathBegin", String.Empty); 1024 shp.PathBegin = (ushort)reader.ReadElementContentAsInt("PathBegin", String.Empty);
1023 } 1025 }
1024 1026
1025 private static void ProcessShpPathCurve(PrimitiveBaseShape shp, XmlTextReader reader) 1027 private static void ProcessShpPathCurve(PrimitiveBaseShape shp, XmlReader reader)
1026 { 1028 {
1027 shp.PathCurve = (byte)reader.ReadElementContentAsInt("PathCurve", String.Empty); 1029 shp.PathCurve = (byte)reader.ReadElementContentAsInt("PathCurve", String.Empty);
1028 } 1030 }
1029 1031
1030 private static void ProcessShpPathEnd(PrimitiveBaseShape shp, XmlTextReader reader) 1032 private static void ProcessShpPathEnd(PrimitiveBaseShape shp, XmlReader reader)
1031 { 1033 {
1032 shp.PathEnd = (ushort)reader.ReadElementContentAsInt("PathEnd", String.Empty); 1034 shp.PathEnd = (ushort)reader.ReadElementContentAsInt("PathEnd", String.Empty);
1033 } 1035 }
1034 1036
1035 private static void ProcessShpPathRadiusOffset(PrimitiveBaseShape shp, XmlTextReader reader) 1037 private static void ProcessShpPathRadiusOffset(PrimitiveBaseShape shp, XmlReader reader)
1036 { 1038 {
1037 shp.PathRadiusOffset = (sbyte)reader.ReadElementContentAsInt("PathRadiusOffset", String.Empty); 1039 shp.PathRadiusOffset = (sbyte)reader.ReadElementContentAsInt("PathRadiusOffset", String.Empty);
1038 } 1040 }
1039 1041
1040 private static void ProcessShpPathRevolutions(PrimitiveBaseShape shp, XmlTextReader reader) 1042 private static void ProcessShpPathRevolutions(PrimitiveBaseShape shp, XmlReader reader)
1041 { 1043 {
1042 shp.PathRevolutions = (byte)reader.ReadElementContentAsInt("PathRevolutions", String.Empty); 1044 shp.PathRevolutions = (byte)reader.ReadElementContentAsInt("PathRevolutions", String.Empty);
1043 } 1045 }
1044 1046
1045 private static void ProcessShpPathScaleX(PrimitiveBaseShape shp, XmlTextReader reader) 1047 private static void ProcessShpPathScaleX(PrimitiveBaseShape shp, XmlReader reader)
1046 { 1048 {
1047 shp.PathScaleX = (byte)reader.ReadElementContentAsInt("PathScaleX", String.Empty); 1049 shp.PathScaleX = (byte)reader.ReadElementContentAsInt("PathScaleX", String.Empty);
1048 } 1050 }
1049 1051
1050 private static void ProcessShpPathScaleY(PrimitiveBaseShape shp, XmlTextReader reader) 1052 private static void ProcessShpPathScaleY(PrimitiveBaseShape shp, XmlReader reader)
1051 { 1053 {
1052 shp.PathScaleY = (byte)reader.ReadElementContentAsInt("PathScaleY", String.Empty); 1054 shp.PathScaleY = (byte)reader.ReadElementContentAsInt("PathScaleY", String.Empty);
1053 } 1055 }
1054 1056
1055 private static void ProcessShpPathShearX(PrimitiveBaseShape shp, XmlTextReader reader) 1057 private static void ProcessShpPathShearX(PrimitiveBaseShape shp, XmlReader reader)
1056 { 1058 {
1057 shp.PathShearX = (byte)reader.ReadElementContentAsInt("PathShearX", String.Empty); 1059 shp.PathShearX = (byte)reader.ReadElementContentAsInt("PathShearX", String.Empty);
1058 } 1060 }
1059 1061
1060 private static void ProcessShpPathShearY(PrimitiveBaseShape shp, XmlTextReader reader) 1062 private static void ProcessShpPathShearY(PrimitiveBaseShape shp, XmlReader reader)
1061 { 1063 {
1062 shp.PathShearY = (byte)reader.ReadElementContentAsInt("PathShearY", String.Empty); 1064 shp.PathShearY = (byte)reader.ReadElementContentAsInt("PathShearY", String.Empty);
1063 } 1065 }
1064 1066
1065 private static void ProcessShpPathSkew(PrimitiveBaseShape shp, XmlTextReader reader) 1067 private static void ProcessShpPathSkew(PrimitiveBaseShape shp, XmlReader reader)
1066 { 1068 {
1067 shp.PathSkew = (sbyte)reader.ReadElementContentAsInt("PathSkew", String.Empty); 1069 shp.PathSkew = (sbyte)reader.ReadElementContentAsInt("PathSkew", String.Empty);
1068 } 1070 }
1069 1071
1070 private static void ProcessShpPathTaperX(PrimitiveBaseShape shp, XmlTextReader reader) 1072 private static void ProcessShpPathTaperX(PrimitiveBaseShape shp, XmlReader reader)
1071 { 1073 {
1072 shp.PathTaperX = (sbyte)reader.ReadElementContentAsInt("PathTaperX", String.Empty); 1074 shp.PathTaperX = (sbyte)reader.ReadElementContentAsInt("PathTaperX", String.Empty);
1073 } 1075 }
1074 1076
1075 private static void ProcessShpPathTaperY(PrimitiveBaseShape shp, XmlTextReader reader) 1077 private static void ProcessShpPathTaperY(PrimitiveBaseShape shp, XmlReader reader)
1076 { 1078 {
1077 shp.PathTaperY = (sbyte)reader.ReadElementContentAsInt("PathTaperY", String.Empty); 1079 shp.PathTaperY = (sbyte)reader.ReadElementContentAsInt("PathTaperY", String.Empty);
1078 } 1080 }
1079 1081
1080 private static void ProcessShpPathTwist(PrimitiveBaseShape shp, XmlTextReader reader) 1082 private static void ProcessShpPathTwist(PrimitiveBaseShape shp, XmlReader reader)
1081 { 1083 {
1082 shp.PathTwist = (sbyte)reader.ReadElementContentAsInt("PathTwist", String.Empty); 1084 shp.PathTwist = (sbyte)reader.ReadElementContentAsInt("PathTwist", String.Empty);
1083 } 1085 }
1084 1086
1085 private static void ProcessShpPathTwistBegin(PrimitiveBaseShape shp, XmlTextReader reader) 1087 private static void ProcessShpPathTwistBegin(PrimitiveBaseShape shp, XmlReader reader)
1086 { 1088 {
1087 shp.PathTwistBegin = (sbyte)reader.ReadElementContentAsInt("PathTwistBegin", String.Empty); 1089 shp.PathTwistBegin = (sbyte)reader.ReadElementContentAsInt("PathTwistBegin", String.Empty);
1088 } 1090 }
1089 1091
1090 private static void ProcessShpPCode(PrimitiveBaseShape shp, XmlTextReader reader) 1092 private static void ProcessShpPCode(PrimitiveBaseShape shp, XmlReader reader)
1091 { 1093 {
1092 shp.PCode = (byte)reader.ReadElementContentAsInt("PCode", String.Empty); 1094 shp.PCode = (byte)reader.ReadElementContentAsInt("PCode", String.Empty);
1093 } 1095 }
1094 1096
1095 private static void ProcessShpProfileBegin(PrimitiveBaseShape shp, XmlTextReader reader) 1097 private static void ProcessShpProfileBegin(PrimitiveBaseShape shp, XmlReader reader)
1096 { 1098 {
1097 shp.ProfileBegin = (ushort)reader.ReadElementContentAsInt("ProfileBegin", String.Empty); 1099 shp.ProfileBegin = (ushort)reader.ReadElementContentAsInt("ProfileBegin", String.Empty);
1098 } 1100 }
1099 1101
1100 private static void ProcessShpProfileEnd(PrimitiveBaseShape shp, XmlTextReader reader) 1102 private static void ProcessShpProfileEnd(PrimitiveBaseShape shp, XmlReader reader)
1101 { 1103 {
1102 shp.ProfileEnd = (ushort)reader.ReadElementContentAsInt("ProfileEnd", String.Empty); 1104 shp.ProfileEnd = (ushort)reader.ReadElementContentAsInt("ProfileEnd", String.Empty);
1103 } 1105 }
1104 1106
1105 private static void ProcessShpProfileHollow(PrimitiveBaseShape shp, XmlTextReader reader) 1107 private static void ProcessShpProfileHollow(PrimitiveBaseShape shp, XmlReader reader)
1106 { 1108 {
1107 shp.ProfileHollow = (ushort)reader.ReadElementContentAsInt("ProfileHollow", String.Empty); 1109 shp.ProfileHollow = (ushort)reader.ReadElementContentAsInt("ProfileHollow", String.Empty);
1108 } 1110 }
1109 1111
1110 private static void ProcessShpScale(PrimitiveBaseShape shp, XmlTextReader reader) 1112 private static void ProcessShpScale(PrimitiveBaseShape shp, XmlReader reader)
1111 { 1113 {
1112 shp.Scale = Util.ReadVector(reader, "Scale"); 1114 shp.Scale = Util.ReadVector(reader, "Scale");
1113 } 1115 }
1114 1116
1115 private static void ProcessShpState(PrimitiveBaseShape shp, XmlTextReader reader) 1117 private static void ProcessShpState(PrimitiveBaseShape shp, XmlReader reader)
1116 { 1118 {
1117 shp.State = (byte)reader.ReadElementContentAsInt("State", String.Empty); 1119 shp.State = (byte)reader.ReadElementContentAsInt("State", String.Empty);
1118 } 1120 }
1119 1121
1120 private static void ProcessShpLastAttach(PrimitiveBaseShape shp, XmlTextReader reader) 1122 private static void ProcessShpLastAttach(PrimitiveBaseShape shp, XmlReader reader)
1121 { 1123 {
1122 shp.LastAttachPoint = (byte)reader.ReadElementContentAsInt("LastAttachPoint", String.Empty); 1124 shp.LastAttachPoint = (byte)reader.ReadElementContentAsInt("LastAttachPoint", String.Empty);
1123 } 1125 }
1124 1126
1125 private static void ProcessShpProfileShape(PrimitiveBaseShape shp, XmlTextReader reader) 1127 private static void ProcessShpProfileShape(PrimitiveBaseShape shp, XmlReader reader)
1126 { 1128 {
1127 shp.ProfileShape = Util.ReadEnum<ProfileShape>(reader, "ProfileShape"); 1129 shp.ProfileShape = Util.ReadEnum<ProfileShape>(reader, "ProfileShape");
1128 } 1130 }
1129 1131
1130 private static void ProcessShpHollowShape(PrimitiveBaseShape shp, XmlTextReader reader) 1132 private static void ProcessShpHollowShape(PrimitiveBaseShape shp, XmlReader reader)
1131 { 1133 {
1132 shp.HollowShape = Util.ReadEnum<HollowShape>(reader, "HollowShape"); 1134 shp.HollowShape = Util.ReadEnum<HollowShape>(reader, "HollowShape");
1133 } 1135 }
1134 1136
1135 private static void ProcessShpSculptTexture(PrimitiveBaseShape shp, XmlTextReader reader) 1137 private static void ProcessShpSculptTexture(PrimitiveBaseShape shp, XmlReader reader)
1136 { 1138 {
1137 shp.SculptTexture = Util.ReadUUID(reader, "SculptTexture"); 1139 shp.SculptTexture = Util.ReadUUID(reader, "SculptTexture");
1138 } 1140 }
1139 1141
1140 private static void ProcessShpSculptType(PrimitiveBaseShape shp, XmlTextReader reader) 1142 private static void ProcessShpSculptType(PrimitiveBaseShape shp, XmlReader reader)
1141 { 1143 {
1142 shp.SculptType = (byte)reader.ReadElementContentAsInt("SculptType", String.Empty); 1144 shp.SculptType = (byte)reader.ReadElementContentAsInt("SculptType", String.Empty);
1143 } 1145 }
1144 1146
1145 private static void ProcessShpFlexiSoftness(PrimitiveBaseShape shp, XmlTextReader reader) 1147 private static void ProcessShpFlexiSoftness(PrimitiveBaseShape shp, XmlReader reader)
1146 { 1148 {
1147 shp.FlexiSoftness = reader.ReadElementContentAsInt("FlexiSoftness", String.Empty); 1149 shp.FlexiSoftness = reader.ReadElementContentAsInt("FlexiSoftness", String.Empty);
1148 } 1150 }
1149 1151
1150 private static void ProcessShpFlexiTension(PrimitiveBaseShape shp, XmlTextReader reader) 1152 private static void ProcessShpFlexiTension(PrimitiveBaseShape shp, XmlReader reader)
1151 { 1153 {
1152 shp.FlexiTension = reader.ReadElementContentAsFloat("FlexiTension", String.Empty); 1154 shp.FlexiTension = reader.ReadElementContentAsFloat("FlexiTension", String.Empty);
1153 } 1155 }
1154 1156
1155 private static void ProcessShpFlexiDrag(PrimitiveBaseShape shp, XmlTextReader reader) 1157 private static void ProcessShpFlexiDrag(PrimitiveBaseShape shp, XmlReader reader)
1156 { 1158 {
1157 shp.FlexiDrag = reader.ReadElementContentAsFloat("FlexiDrag", String.Empty); 1159 shp.FlexiDrag = reader.ReadElementContentAsFloat("FlexiDrag", String.Empty);
1158 } 1160 }
1159 1161
1160 private static void ProcessShpFlexiGravity(PrimitiveBaseShape shp, XmlTextReader reader) 1162 private static void ProcessShpFlexiGravity(PrimitiveBaseShape shp, XmlReader reader)
1161 { 1163 {
1162 shp.FlexiGravity = reader.ReadElementContentAsFloat("FlexiGravity", String.Empty); 1164 shp.FlexiGravity = reader.ReadElementContentAsFloat("FlexiGravity", String.Empty);
1163 } 1165 }
1164 1166
1165 private static void ProcessShpFlexiWind(PrimitiveBaseShape shp, XmlTextReader reader) 1167 private static void ProcessShpFlexiWind(PrimitiveBaseShape shp, XmlReader reader)
1166 { 1168 {
1167 shp.FlexiWind = reader.ReadElementContentAsFloat("FlexiWind", String.Empty); 1169 shp.FlexiWind = reader.ReadElementContentAsFloat("FlexiWind", String.Empty);
1168 } 1170 }
1169 1171
1170 private static void ProcessShpFlexiForceX(PrimitiveBaseShape shp, XmlTextReader reader) 1172 private static void ProcessShpFlexiForceX(PrimitiveBaseShape shp, XmlReader reader)
1171 { 1173 {
1172 shp.FlexiForceX = reader.ReadElementContentAsFloat("FlexiForceX", String.Empty); 1174 shp.FlexiForceX = reader.ReadElementContentAsFloat("FlexiForceX", String.Empty);
1173 } 1175 }
1174 1176
1175 private static void ProcessShpFlexiForceY(PrimitiveBaseShape shp, XmlTextReader reader) 1177 private static void ProcessShpFlexiForceY(PrimitiveBaseShape shp, XmlReader reader)
1176 { 1178 {
1177 shp.FlexiForceY = reader.ReadElementContentAsFloat("FlexiForceY", String.Empty); 1179 shp.FlexiForceY = reader.ReadElementContentAsFloat("FlexiForceY", String.Empty);
1178 } 1180 }
1179 1181
1180 private static void ProcessShpFlexiForceZ(PrimitiveBaseShape shp, XmlTextReader reader) 1182 private static void ProcessShpFlexiForceZ(PrimitiveBaseShape shp, XmlReader reader)
1181 { 1183 {
1182 shp.FlexiForceZ = reader.ReadElementContentAsFloat("FlexiForceZ", String.Empty); 1184 shp.FlexiForceZ = reader.ReadElementContentAsFloat("FlexiForceZ", String.Empty);
1183 } 1185 }
1184 1186
1185 private static void ProcessShpLightColorR(PrimitiveBaseShape shp, XmlTextReader reader) 1187 private static void ProcessShpLightColorR(PrimitiveBaseShape shp, XmlReader reader)
1186 { 1188 {
1187 shp.LightColorR = reader.ReadElementContentAsFloat("LightColorR", String.Empty); 1189 shp.LightColorR = reader.ReadElementContentAsFloat("LightColorR", String.Empty);
1188 } 1190 }
1189 1191
1190 private static void ProcessShpLightColorG(PrimitiveBaseShape shp, XmlTextReader reader) 1192 private static void ProcessShpLightColorG(PrimitiveBaseShape shp, XmlReader reader)
1191 { 1193 {
1192 shp.LightColorG = reader.ReadElementContentAsFloat("LightColorG", String.Empty); 1194 shp.LightColorG = reader.ReadElementContentAsFloat("LightColorG", String.Empty);
1193 } 1195 }
1194 1196
1195 private static void ProcessShpLightColorB(PrimitiveBaseShape shp, XmlTextReader reader) 1197 private static void ProcessShpLightColorB(PrimitiveBaseShape shp, XmlReader reader)
1196 { 1198 {
1197 shp.LightColorB = reader.ReadElementContentAsFloat("LightColorB", String.Empty); 1199 shp.LightColorB = reader.ReadElementContentAsFloat("LightColorB", String.Empty);
1198 } 1200 }
1199 1201
1200 private static void ProcessShpLightColorA(PrimitiveBaseShape shp, XmlTextReader reader) 1202 private static void ProcessShpLightColorA(PrimitiveBaseShape shp, XmlReader reader)
1201 { 1203 {
1202 shp.LightColorA = reader.ReadElementContentAsFloat("LightColorA", String.Empty); 1204 shp.LightColorA = reader.ReadElementContentAsFloat("LightColorA", String.Empty);
1203 } 1205 }
1204 1206
1205 private static void ProcessShpLightRadius(PrimitiveBaseShape shp, XmlTextReader reader) 1207 private static void ProcessShpLightRadius(PrimitiveBaseShape shp, XmlReader reader)
1206 { 1208 {
1207 shp.LightRadius = reader.ReadElementContentAsFloat("LightRadius", String.Empty); 1209 shp.LightRadius = reader.ReadElementContentAsFloat("LightRadius", String.Empty);
1208 } 1210 }
1209 1211
1210 private static void ProcessShpLightCutoff(PrimitiveBaseShape shp, XmlTextReader reader) 1212 private static void ProcessShpLightCutoff(PrimitiveBaseShape shp, XmlReader reader)
1211 { 1213 {
1212 shp.LightCutoff = reader.ReadElementContentAsFloat("LightCutoff", String.Empty); 1214 shp.LightCutoff = reader.ReadElementContentAsFloat("LightCutoff", String.Empty);
1213 } 1215 }
1214 1216
1215 private static void ProcessShpLightFalloff(PrimitiveBaseShape shp, XmlTextReader reader) 1217 private static void ProcessShpLightFalloff(PrimitiveBaseShape shp, XmlReader reader)
1216 { 1218 {
1217 shp.LightFalloff = reader.ReadElementContentAsFloat("LightFalloff", String.Empty); 1219 shp.LightFalloff = reader.ReadElementContentAsFloat("LightFalloff", String.Empty);
1218 } 1220 }
1219 1221
1220 private static void ProcessShpLightIntensity(PrimitiveBaseShape shp, XmlTextReader reader) 1222 private static void ProcessShpLightIntensity(PrimitiveBaseShape shp, XmlReader reader)
1221 { 1223 {
1222 shp.LightIntensity = reader.ReadElementContentAsFloat("LightIntensity", String.Empty); 1224 shp.LightIntensity = reader.ReadElementContentAsFloat("LightIntensity", String.Empty);
1223 } 1225 }
1224 1226
1225 private static void ProcessShpFlexiEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1227 private static void ProcessShpFlexiEntry(PrimitiveBaseShape shp, XmlReader reader)
1226 { 1228 {
1227 shp.FlexiEntry = Util.ReadBoolean(reader); 1229 shp.FlexiEntry = Util.ReadBoolean(reader);
1228 } 1230 }
1229 1231
1230 private static void ProcessShpLightEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1232 private static void ProcessShpLightEntry(PrimitiveBaseShape shp, XmlReader reader)
1231 { 1233 {
1232 shp.LightEntry = Util.ReadBoolean(reader); 1234 shp.LightEntry = Util.ReadBoolean(reader);
1233 } 1235 }
1234 1236
1235 private static void ProcessShpSculptEntry(PrimitiveBaseShape shp, XmlTextReader reader) 1237 private static void ProcessShpSculptEntry(PrimitiveBaseShape shp, XmlReader reader)
1236 { 1238 {
1237 shp.SculptEntry = Util.ReadBoolean(reader); 1239 shp.SculptEntry = Util.ReadBoolean(reader);
1238 } 1240 }
1239 1241
1240 private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlTextReader reader) 1242 private static void ProcessShpMedia(PrimitiveBaseShape shp, XmlReader reader)
1241 { 1243 {
1242 string value = reader.ReadElementContentAsString("Media", String.Empty); 1244 string value = reader.ReadElementContentAsString("Media", String.Empty);
1243 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value); 1245 shp.Media = PrimitiveBaseShape.MediaList.FromXml(value);
@@ -1589,7 +1591,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1589 } 1591 }
1590 } 1592 }
1591 1593
1592 public static SceneObjectPart Xml2ToSOP(XmlTextReader reader) 1594 public static SceneObjectPart Xml2ToSOP(XmlReader reader)
1593 { 1595 {
1594 SceneObjectPart obj = new SceneObjectPart(); 1596 SceneObjectPart obj = new SceneObjectPart();
1595 1597
@@ -1610,7 +1612,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1610 return obj; 1612 return obj;
1611 } 1613 }
1612 1614
1613 public static TaskInventoryDictionary ReadTaskInventory(XmlTextReader reader, string name) 1615 public static TaskInventoryDictionary ReadTaskInventory(XmlReader reader, string name)
1614 { 1616 {
1615 TaskInventoryDictionary tinv = new TaskInventoryDictionary(); 1617 TaskInventoryDictionary tinv = new TaskInventoryDictionary();
1616 1618
@@ -1651,7 +1653,7 @@ namespace OpenSim.Region.Framework.Scenes.Serialization
1651 /// <param name="name">The name of the xml element containing the shape</param> 1653 /// <param name="name">The name of the xml element containing the shape</param>
1652 /// <param name="errors">a list containing the failing node names. If no failures then null.</param> 1654 /// <param name="errors">a list containing the failing node names. If no failures then null.</param>
1653 /// <returns>The shape parsed</returns> 1655 /// <returns>The shape parsed</returns>
1654 public static PrimitiveBaseShape ReadShape(XmlTextReader reader, string name, out List<string> errorNodeNames) 1656 public static PrimitiveBaseShape ReadShape(XmlReader reader, string name, out List<string> errorNodeNames)
1655 { 1657 {
1656 List<string> internalErrorNodeNames = null; 1658 List<string> internalErrorNodeNames = null;
1657 1659
diff --git a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
index f2595c8..0927c4f 100644
--- a/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
+++ b/OpenSim/Region/OptionalModules/World/SceneCommands/SceneCommandsModule.cs
@@ -30,6 +30,7 @@ using System.Collections.Generic;
30using System.Linq; 30using System.Linq;
31using System.Reflection; 31using System.Reflection;
32using System.Text; 32using System.Text;
33using System.Threading;
33using log4net; 34using log4net;
34using Mono.Addins; 35using Mono.Addins;
35using Nini.Config; 36using Nini.Config;
@@ -93,42 +94,44 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
93 "Debug", this, "debug scene get", 94 "Debug", this, "debug scene get",
94 "debug scene get", 95 "debug scene get",
95 "List current scene options.", 96 "List current scene options.",
96 "active - if false then main scene update and maintenance loops are suspended.\n" 97 "active - if false then main scene update and maintenance loops are suspended.\n"
97 + "animations - if true then extra animations debug information is logged.\n" 98 + "animations - if true then extra animations debug information is logged.\n"
98 + "appear-refresh - if true then appearance is resent to other avatars every 60 seconds.\n" 99 + "appear-refresh - if true then appearance is resent to other avatars every 60 seconds.\n"
99 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n" 100 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
100 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 101 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
101 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 102 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
102 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n" 103 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
103 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n" 104 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n"
104 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n" 105 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
105 + "collisions - if false then collisions with other objects are turned off.\n" 106 + "collisions - if false then collisions with other objects are turned off.\n"
106 + "pbackup - if false then periodic scene backup is turned off.\n" 107 + "pbackup - if false then periodic scene backup is turned off.\n"
107 + "physics - if false then all physics objects are non-physical.\n" 108 + "physics - if false then all physics objects are non-physical.\n"
108 + "scripting - if false then no scripting operations happen.\n" 109 + "scripting - if false then no scripting operations happen.\n"
109 + "teleport - if true then some extra teleport debug information is logged.\n" 110 + "teleport - if true then some extra teleport debug information is logged.\n"
110 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.", 111 + "update-on-timer - If true then the scene is updated via a timer. If false then a thread with sleep is used.\n"
112 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
111 HandleDebugSceneGetCommand); 113 HandleDebugSceneGetCommand);
112 114
113 scene.AddCommand( 115 scene.AddCommand(
114 "Debug", this, "debug scene set", 116 "Debug", this, "debug scene set",
115 "debug scene set active|collisions|pbackup|physics|scripting|teleport|updates true|false", 117 "debug scene set <param> <value>",
116 "Turn on scene debugging options.", 118 "Turn on scene debugging options.",
117 "active - if false then main scene update and maintenance loops are suspended.\n" 119 "active - if false then main scene update and maintenance loops are suspended.\n"
118 + "animations - if true then extra animations debug information is logged.\n" 120 + "animations - if true then extra animations debug information is logged.\n"
119 + "appear-refresh - if true then appearance is resent to other avatars every 60 seconds.\n" 121 + "appear-refresh - if true then appearance is resent to other avatars every 60 seconds.\n"
120 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n" 122 + "child-repri - how far an avatar must move in meters before we update the position of its child agents in neighbouring regions.\n"
121 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 123 + "client-pos-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
122 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n" 124 + "client-rot-upd - the tolerance before clients are updated with new rotation information for an avatar.\n"
123 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n" 125 + "client-vel-upd - the tolerance before clients are updated with new velocity information for an avatar.\n"
124 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n" 126 + "root-upd-per - if greater than 1, terse updates are only sent to root agents other than the originator on every n updates.\n"
125 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n" 127 + "child-upd-per - if greater than 1, terse updates are only sent to child agents on every n updates.\n"
126 + "collisions - if false then collisions with other objects are turned off.\n" 128 + "collisions - if false then collisions with other objects are turned off.\n"
127 + "pbackup - if false then periodic scene backup is turned off.\n" 129 + "pbackup - if false then periodic scene backup is turned off.\n"
128 + "physics - if false then all physics objects are non-physical.\n" 130 + "physics - if false then all physics objects are non-physical.\n"
129 + "scripting - if false then no scripting operations happen.\n" 131 + "scripting - if false then no scripting operations happen.\n"
130 + "teleport - if true then some extra teleport debug information is logged.\n" 132 + "teleport - if true then some extra teleport debug information is logged.\n"
131 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.", 133 + "update-on-timer - If true then the scene is updated via a timer. If false then a thread with sleep is used.\n"
134 + "updates - if true then any frame which exceeds double the maximum desired frame time is logged.",
132 HandleDebugSceneSetCommand); 135 HandleDebugSceneSetCommand);
133 } 136 }
134 137
@@ -163,6 +166,7 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
163 cdl.AddRow("physics", m_scene.PhysicsEnabled); 166 cdl.AddRow("physics", m_scene.PhysicsEnabled);
164 cdl.AddRow("scripting", m_scene.ScriptsEnabled); 167 cdl.AddRow("scripting", m_scene.ScriptsEnabled);
165 cdl.AddRow("teleport", m_scene.DebugTeleporting); 168 cdl.AddRow("teleport", m_scene.DebugTeleporting);
169 cdl.AddRow("update-on-timer", m_scene.UpdateOnTimer);
166 cdl.AddRow("updates", m_scene.DebugUpdates); 170 cdl.AddRow("updates", m_scene.DebugUpdates);
167 171
168 MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name); 172 MainConsole.Instance.OutputFormat("Scene {0} options:", m_scene.Name);
@@ -304,6 +308,21 @@ namespace OpenSim.Region.OptionalModules.Avatar.Attachments
304 m_scene.DebugTeleporting = enableTeleportDebugging; 308 m_scene.DebugTeleporting = enableTeleportDebugging;
305 } 309 }
306 310
311 if (options.ContainsKey("update-on-timer"))
312 {
313 bool enableUpdateOnTimer;
314 if (bool.TryParse(options["update-on-timer"], out enableUpdateOnTimer))
315 {
316 m_scene.UpdateOnTimer = enableUpdateOnTimer;
317 m_scene.Active = false;
318
319 while (m_scene.IsRunning)
320 Thread.Sleep(20);
321
322 m_scene.Active = true;
323 }
324 }
325
307 if (options.ContainsKey("updates")) 326 if (options.ContainsKey("updates"))
308 { 327 {
309 bool enableUpdateDebugging; 328 bool enableUpdateDebugging;
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 50e4804..5d7fc9d 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -1377,12 +1377,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1377 } 1377 }
1378 1378
1379 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB) 1379 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB) == ScriptBaseClass.STATUS_BLOCK_GRAB)
1380 { 1380 m_host.BlockGrab = value != 0;
1381 if (value != 0) 1381
1382 m_host.SetBlockGrab(true); 1382 if ((status & ScriptBaseClass.STATUS_BLOCK_GRAB_OBJECT) == ScriptBaseClass.STATUS_BLOCK_GRAB_OBJECT)
1383 else 1383 m_host.ParentGroup.BlockGrabOverride = value != 0;
1384 m_host.SetBlockGrab(false);
1385 }
1386 1384
1387 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE) 1385 if ((status & ScriptBaseClass.STATUS_DIE_AT_EDGE) == ScriptBaseClass.STATUS_DIE_AT_EDGE)
1388 { 1386 {
@@ -1443,10 +1441,10 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
1443 return 0; 1441 return 0;
1444 1442
1445 case ScriptBaseClass.STATUS_BLOCK_GRAB: 1443 case ScriptBaseClass.STATUS_BLOCK_GRAB:
1446 if (m_host.GetBlockGrab()) 1444 return m_host.BlockGrab ? 1 : 0;
1447 return 1; 1445
1448 else 1446 case ScriptBaseClass.STATUS_BLOCK_GRAB_OBJECT:
1449 return 0; 1447 return m_host.ParentGroup.BlockGrabOverride ? 1 : 0;
1450 1448
1451 case ScriptBaseClass.STATUS_DIE_AT_EDGE: 1449 case ScriptBaseClass.STATUS_DIE_AT_EDGE:
1452 if (m_host.GetDieAtEdge()) 1450 if (m_host.GetDieAtEdge())
@@ -11315,20 +11313,43 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
11315 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z)); 11313 ret.Add(new LSL_Vector(obj.AbsolutePosition.X, obj.AbsolutePosition.Y, obj.AbsolutePosition.Z));
11316 break; 11314 break;
11317 case ScriptBaseClass.OBJECT_ROT: 11315 case ScriptBaseClass.OBJECT_ROT:
11316 Quaternion rot = Quaternion.Identity;
11317
11318 if (obj.ParentGroup.IsAttachment)
11318 { 11319 {
11319 Quaternion rot = Quaternion.Identity; 11320 ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar);
11320 11321
11322 if (sp != null)
11323 rot = sp.GetWorldRotation();
11324 }
11325 else
11326 {
11321 if (obj.ParentGroup.RootPart == obj) 11327 if (obj.ParentGroup.RootPart == obj)
11322 rot = obj.ParentGroup.GroupRotation; 11328 rot = obj.ParentGroup.GroupRotation;
11323 else 11329 else
11324 rot = obj.GetWorldRotation(); 11330 rot = obj.GetWorldRotation();
11325
11326 LSL_Rotation objrot = new LSL_Rotation(rot);
11327 ret.Add(objrot);
11328 } 11331 }
11332
11333 LSL_Rotation objrot = new LSL_Rotation(rot);
11334 ret.Add(objrot);
11335
11329 break; 11336 break;
11330 case ScriptBaseClass.OBJECT_VELOCITY: 11337 case ScriptBaseClass.OBJECT_VELOCITY:
11331 ret.Add(new LSL_Vector(obj.Velocity)); 11338 Vector3 vel = Vector3.Zero;
11339
11340 if (obj.ParentGroup.IsAttachment)
11341 {
11342 ScenePresence sp = World.GetScenePresence(obj.ParentGroup.AttachedAvatar);
11343
11344 if (sp != null)
11345 vel = sp.Velocity;
11346 }
11347 else
11348 {
11349 vel = obj.Velocity;
11350 }
11351
11352 ret.Add(vel);
11332 break; 11353 break;
11333 case ScriptBaseClass.OBJECT_OWNER: 11354 case ScriptBaseClass.OBJECT_OWNER:
11334 ret.Add(new LSL_String(obj.OwnerID.ToString())); 11355 ret.Add(new LSL_String(obj.OwnerID.ToString()));
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
index 7d80dcb..a96cd16 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/LSL_Constants.cs
@@ -48,6 +48,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
48 public const int STATUS_DIE_AT_EDGE = 128; 48 public const int STATUS_DIE_AT_EDGE = 128;
49 public const int STATUS_RETURN_AT_EDGE = 256; 49 public const int STATUS_RETURN_AT_EDGE = 256;
50 public const int STATUS_CAST_SHADOWS = 512; 50 public const int STATUS_CAST_SHADOWS = 512;
51 public const int STATUS_BLOCK_GRAB_OBJECT = 1024;
51 52
52 public const int AGENT = 1; 53 public const int AGENT = 1;
53 public const int AGENT_BY_LEGACY_NAME = 1; 54 public const int AGENT_BY_LEGACY_NAME = 1;