28 using System.Collections.Generic;
33 using NUnit.Framework;
35 using OpenSim.Framework;
36 using OpenSim.Region.Framework.Scenes;
37 using OpenSim.Region.Framework.Scenes.Serialization;
38 using OpenSim.Tests.Common;
39 using OpenMetaverse.StructuredData;
46 private const string ObjectRootPartStubXml =
49 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
50 <AllowedDrop>false</AllowedDrop>
51 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
52 <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
53 <InventorySerial>1</InventorySerial>
55 <ObjectFlags>0</ObjectFlags>
56 <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
57 <LocalId>2698615125</LocalId>
58 <Name>PrimMyRide</Name>
59 <Material>0</Material>
60 <PassTouches>false</PassTouches>
61 <RegionHandle>1099511628032000</RegionHandle>
62 <ScriptAccessPin>0</ScriptAccessPin>
63 <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
64 <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
65 <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
66 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
67 <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
68 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
69 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
76 <ClickAction>0</ClickAction>
78 <ProfileCurve>1</ProfileCurve>
79 <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
80 <ExtraParams>AA==</ExtraParams>
81 <PathBegin>0</PathBegin>
82 <PathCurve>16</PathCurve>
84 <PathRadiusOffset>0</PathRadiusOffset>
85 <PathRevolutions>0</PathRevolutions>
86 <PathScaleX>100</PathScaleX>
87 <PathScaleY>100</PathScaleY>
88 <PathShearX>0</PathShearX>
89 <PathShearY>0</PathShearY>
90 <PathSkew>0</PathSkew>
91 <PathTaperX>0</PathTaperX>
92 <PathTaperY>0</PathTaperY>
93 <PathTwist>0</PathTwist>
94 <PathTwistBegin>0</PathTwistBegin>
96 <ProfileBegin>0</ProfileBegin>
97 <ProfileEnd>0</ProfileEnd>
98 <ProfileHollow>0</ProfileHollow>
99 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
101 <ProfileShape>Square</ProfileShape>
102 <HollowShape>Same</HollowShape>
103 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
104 <SculptType>0</SculptType><SculptData />
105 <FlexiSoftness>0</FlexiSoftness>
106 <FlexiTension>0</FlexiTension>
107 <FlexiDrag>0</FlexiDrag>
108 <FlexiGravity>0</FlexiGravity>
109 <FlexiWind>0</FlexiWind>
110 <FlexiForceX>0</FlexiForceX>
111 <FlexiForceY>0</FlexiForceY>
112 <FlexiForceZ>0</FlexiForceZ>
113 <LightColorR>0</LightColorR>
114 <LightColorG>0</LightColorG>
115 <LightColorB>0</LightColorB>
116 <LightColorA>1</LightColorA>
117 <LightRadius>0</LightRadius>
118 <LightCutoff>0</LightCutoff>
119 <LightFalloff>0</LightFalloff>
120 <LightIntensity>1</LightIntensity>
121 <FlexiEntry>false</FlexiEntry>
122 <LightEntry>false</LightEntry>
123 <SculptEntry>false</SculptEntry>
125 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
126 <UpdateFlag>0</UpdateFlag>
127 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
128 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
129 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
130 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
131 <ParentID>0</ParentID>
132 <CreationDate>1211330445</CreationDate>
133 <Category>0</Category>
134 <SalePrice>0</SalePrice>
135 <ObjectSaleType>0</ObjectSaleType>
136 <OwnershipCost>0</OwnershipCost>
137 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
138 <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
139 <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
140 <BaseMask>2147483647</BaseMask>
141 <OwnerMask>2147483647</OwnerMask>
142 <GroupMask>0</GroupMask>
143 <EveryoneMask>0</EveryoneMask>
144 <NextOwnerMask>2147483647</NextOwnerMask>
146 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
147 <CollisionSoundVolume>0</CollisionSoundVolume>
151 <key>MyNamespace</key>
155 <key>the answer</key>
156 <integer>42</integer>
165 private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml +
168 </SceneObjectGroup>";
170 private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml +
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>
198 <LinkNum>253</LinkNum>
199 <ClickAction>0</ClickAction>
201 <ProfileCurve>5</ProfileCurve>
202 <TextureEntry>Vw3dpvgTRUOiIUOGsnpWlAB/f38AAAAAgL8AAACAPwAAAAAAAAAF4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</TextureEntry>
203 <ExtraParams>AA==</ExtraParams>
204 <PathBegin>0</PathBegin>
205 <PathCurve>32</PathCurve>
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>
219 <ProfileBegin>0</ProfileBegin>
220 <ProfileEnd>0</ProfileEnd>
221 <ProfileHollow>0</ProfileHollow>
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>
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>
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>
273 <PayPrice0>-2</PayPrice0>
274 <PayPrice1>-2</PayPrice1>
275 <PayPrice2>-2</PayPrice2>
276 <PayPrice3>-2</PayPrice3>
277 <PayPrice4>-2</PayPrice4>
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>
305 <LinkNum>252</LinkNum>
306 <ClickAction>0</ClickAction>
308 <ProfileCurve>0</ProfileCurve>
309 <TextureEntry>Vw3dpvgTRUOiIUOGsnpWlAB/f38AAAAAgL8AAACAPwAAAAAAAAAF4ABAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</TextureEntry>
310 <ExtraParams>AA==</ExtraParams>
311 <PathBegin>0</PathBegin>
312 <PathCurve>32</PathCurve>
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>
326 <ProfileBegin>0</ProfileBegin>
327 <ProfileEnd>0</ProfileEnd>
328 <ProfileHollow>0</ProfileHollow>
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>
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>
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>
380 <PayPrice0>-2</PayPrice0>
381 <PayPrice1>-2</PayPrice1>
382 <PayPrice2>-2</PayPrice2>
383 <PayPrice3>-2</PayPrice3>
384 <PayPrice4>-2</PayPrice4>
388 </SceneObjectGroup>";
390 private const string ObjectWithBadFloatsXml =
@"
393 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
394 <AllowedDrop>false</AllowedDrop>
395 <CreatorID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></CreatorID>
396 <FolderID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></FolderID>
397 <InventorySerial>1</InventorySerial>
399 <ObjectFlags>0</ObjectFlags>
400 <UUID><Guid>e6a5a05e-e8cc-4816-8701-04165e335790</Guid></UUID>
401 <LocalId>2698615125</LocalId>
402 <Name>NaughtyPrim</Name>
403 <Material>0</Material>
404 <PassTouches>false</PassTouches>
405 <RegionHandle>1099511628032000</RegionHandle>
406 <ScriptAccessPin>0</ScriptAccessPin>
407 <GroupPosition><X>147.23</X><Y>92.698</Y><Z>22.78084</Z></GroupPosition>
408 <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
409 <RotationOffset><X>-4.371139E-08</X><Y>-1</Y><Z>-4.371139E-08</Z><W>0</W></RotationOffset>
410 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
411 <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
412 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
413 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
420 <ClickAction>0</ClickAction>
422 <ProfileCurve>1</ProfileCurve>
423 <TextureEntry>AAAAAAAAERGZmQAAAAAABQCVlZUAAAAAQEAAAABAQAAAAAAAAAAAAAAAAAAAAA==</TextureEntry>
424 <ExtraParams>AA==</ExtraParams>
425 <PathBegin>0</PathBegin>
426 <PathCurve>16</PathCurve>
428 <PathRadiusOffset>0</PathRadiusOffset>
429 <PathRevolutions>0</PathRevolutions>
430 <PathScaleX>100</PathScaleX>
431 <PathScaleY>100</PathScaleY>
432 <PathShearX>0</PathShearX>
433 <PathShearY>0</PathShearY>
434 <PathSkew>0</PathSkew>
435 <PathTaperX>0</PathTaperX>
436 <PathTaperY>0</PathTaperY>
437 <PathTwist>0</PathTwist>
438 <PathTwistBegin>0</PathTwistBegin>
440 <ProfileBegin>0</ProfileBegin>
441 <ProfileEnd>0</ProfileEnd>
442 <ProfileHollow>0</ProfileHollow>
443 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
445 <ProfileShape>Square</ProfileShape>
446 <HollowShape>Same</HollowShape>
447 <SculptTexture><Guid>00000000-0000-0000-0000-000000000000</Guid></SculptTexture>
448 <SculptType>0</SculptType><SculptData />
449 <FlexiSoftness>0</FlexiSoftness>
450 <FlexiTension>0,5</FlexiTension>
451 <FlexiDrag>yo mamma</FlexiDrag>
452 <FlexiGravity>0</FlexiGravity>
453 <FlexiWind>0</FlexiWind>
454 <FlexiForceX>0</FlexiForceX>
455 <FlexiForceY>0</FlexiForceY>
456 <FlexiForceZ>0</FlexiForceZ>
457 <LightColorR>0</LightColorR>
458 <LightColorG>0</LightColorG>
459 <LightColorB>0</LightColorB>
460 <LightColorA>1</LightColorA>
461 <LightRadius>0</LightRadius>
462 <LightCutoff>0</LightCutoff>
463 <LightFalloff>0</LightFalloff>
464 <LightIntensity>1</LightIntensity>
465 <FlexiEntry>false</FlexiEntry>
466 <LightEntry>false</LightEntry>
467 <SculptEntry>false</SculptEntry>
469 <Scale><X>10</X><Y>10</Y><Z>0.5</Z></Scale>
470 <UpdateFlag>0</UpdateFlag>
471 <SitTargetOrientation><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientation>
472 <SitTargetPosition><X>0</X><Y>0</Y><Z>0</Z></SitTargetPosition>
473 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
474 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>0</Z><W>1</W></SitTargetOrientationLL>
475 <ParentID>0</ParentID>
476 <CreationDate>1211330445</CreationDate>
477 <Category>0</Category>
478 <SalePrice>0</SalePrice>
479 <ObjectSaleType>0</ObjectSaleType>
480 <OwnershipCost>0</OwnershipCost>
481 <GroupID><Guid>00000000-0000-0000-0000-000000000000</Guid></GroupID>
482 <OwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></OwnerID>
483 <LastOwnerID><Guid>a6dacf01-4636-4bb9-8a97-30609438af9d</Guid></LastOwnerID>
484 <BaseMask>2147483647</BaseMask>
485 <OwnerMask>2147483647</OwnerMask>
486 <GroupMask>0</GroupMask>
487 <EveryoneMask>0</EveryoneMask>
488 <NextOwnerMask>2147483647</NextOwnerMask>
490 <CollisionSound><Guid>00000000-0000-0000-0000-000000000000</Guid></CollisionSound>
491 <CollisionSoundVolume>0</CollisionSoundVolume>
495 </SceneObjectGroup>";
497 private const string ObjectWithNoPartsXml2 =
@"
499 <SceneObjectPart xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"">
500 <CreatorID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></CreatorID>
501 <FolderID><UUID>9be68fdd-f740-4a0f-9675-dfbbb536b946</UUID></FolderID>
502 <InventorySerial>0</InventorySerial>
504 <ObjectFlags>0</ObjectFlags>
505 <UUID><UUID>9be68fdd-f740-4a0f-9675-dfbbb536b946</UUID></UUID>
506 <LocalId>720005</LocalId>
508 <Material>0</Material>
509 <RegionHandle>1099511628032000</RegionHandle>
510 <ScriptAccessPin>0</ScriptAccessPin>
511 <GroupPosition><X>153.9854</X><Y>121.4908</Y><Z>62.21781</Z></GroupPosition>
512 <OffsetPosition><X>0</X><Y>0</Y><Z>0</Z></OffsetPosition>
513 <RotationOffset><X>0</X><Y>0</Y><Z>0</Z><W>1</W></RotationOffset>
514 <Velocity><X>0</X><Y>0</Y><Z>0</Z></Velocity>
515 <RotationalVelocity><X>0</X><Y>0</Y><Z>0</Z></RotationalVelocity>
516 <AngularVelocity><X>0</X><Y>0</Y><Z>0</Z></AngularVelocity>
517 <Acceleration><X>0</X><Y>0</Y><Z>0</Z></Acceleration>
524 <ClickAction>0</ClickAction>
526 <PathBegin>0</PathBegin>
527 <PathCurve>16</PathCurve>
529 <PathRadiusOffset>0</PathRadiusOffset>
530 <PathRevolutions>0</PathRevolutions>
531 <PathScaleX>200</PathScaleX>
532 <PathScaleY>200</PathScaleY>
533 <PathShearX>0</PathShearX>
534 <PathShearY>0</PathShearY>
535 <PathSkew>0</PathSkew>
536 <PathTaperX>0</PathTaperX>
537 <PathTaperY>0</PathTaperY>
538 <PathTwist>0</PathTwist>
539 <PathTwistBegin>0</PathTwistBegin>
541 <ProfileBegin>0</ProfileBegin>
542 <ProfileEnd>0</ProfileEnd>
543 <ProfileHollow>0</ProfileHollow>
544 <Scale><X>1.283131</X><Y>5.903858</Y><Z>4.266288</Z></Scale>
546 <ProfileShape>Circle</ProfileShape>
547 <HollowShape>Same</HollowShape>
548 <ProfileCurve>0</ProfileCurve>
549 <TextureEntry>iVVnRyTLQ+2SC0fK7RVGXwJ6yc/SU4RDA5nhJbLUw3R1AAAAAAAAaOw8QQOhPSRAAKE9JEAAAAAAAAAAAAAAAAAAAAA=</TextureEntry>
550 <ExtraParams>AA==</ExtraParams>
552 <Scale><X>1.283131</X><Y>5.903858</Y><Z>4.266288</Z></Scale>
553 <UpdateFlag>0</UpdateFlag>
554 <SitTargetOrientation><w>0</w><x>0</x><y>0</y><z>1</z></SitTargetOrientation>
555 <SitTargetPosition><x>0</x><y>0</y><z>0</z></SitTargetPosition>
556 <SitTargetPositionLL><X>0</X><Y>0</Y><Z>0</Z></SitTargetPositionLL>
557 <SitTargetOrientationLL><X>0</X><Y>0</Y><Z>1</Z><W>0</W></SitTargetOrientationLL>
558 <ParentID>0</ParentID>
559 <CreationDate>1216066902</CreationDate>
560 <Category>0</Category>
561 <SalePrice>0</SalePrice>
562 <ObjectSaleType>0</ObjectSaleType>
563 <OwnershipCost>0</OwnershipCost>
564 <GroupID><UUID>00000000-0000-0000-0000-000000000000</UUID></GroupID>
565 <OwnerID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></OwnerID>
566 <LastOwnerID><UUID>b46ef588-411e-4a8b-a284-d7dcfe8e74ef</UUID></LastOwnerID>
567 <BaseMask>2147483647</BaseMask>
568 <OwnerMask>2147483647</OwnerMask>
569 <GroupMask>0</GroupMask>
570 <EveryoneMask>0</EveryoneMask>
571 <NextOwnerMask>2147483647</NextOwnerMask>
576 <key>MyNamespace</key>
580 <key>last words</key>
581 <string>Rosebud</string>
587 <SitTargetAvatar><UUID>00000000-0000-0000-0000-000000000000</UUID></SitTargetAvatar>
590 </SceneObjectGroup>";
600 SceneHelpers.SetupSceneModules(m_scene, m_serialiserModule);
606 TestHelpers.InMethod();
607 TestHelpers.EnableLogging();
609 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithNoOtherPartsXml);
612 Assert.That(rootPart.UUID, Is.EqualTo(
new UUID(
"e6a5a05e-e8cc-4816-8701-04165e335790")));
613 Assert.That(rootPart.CreatorID, Is.EqualTo(
new UUID(
"a6dacf01-4636-4bb9-8a97-30609438af9d")));
614 Assert.That(rootPart.Name, Is.EqualTo(
"PrimMyRide"));
615 OSDMap store = rootPart.DynAttrs.GetStore(
"MyNamespace",
"MyStore");
616 Assert.AreEqual(42, store[
"the answer"].AsInteger());
624 TestHelpers.InMethod();
625 TestHelpers.EnableLogging();
627 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithOtherPartsXml);
629 Assert.AreEqual(3, so.Parts.Length);
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());
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"));
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"));
663 TestHelpers.InMethod();
666 SceneObjectGroup so = SceneObjectSerializer.FromOriginalXmlFormat(ObjectWithBadFloatsXml);
669 Assert.That(rootPart.UUID, Is.EqualTo(
new UUID(
"e6a5a05e-e8cc-4816-8701-04165e335790")));
670 Assert.That(rootPart.CreatorID, Is.EqualTo(
new UUID(
"a6dacf01-4636-4bb9-8a97-30609438af9d")));
671 Assert.That(rootPart.Name, Is.EqualTo(
"NaughtyPrim"));
675 Assert.That(rootPart.GroupPosition.X, Is.EqualTo(147.23f));
677 Assert.That(rootPart.Shape.PathCurve, Is.EqualTo(16));
680 Assert.That(rootPart.Shape.FlexiTension, Is.EqualTo(0));
681 Assert.That(rootPart.Shape.FlexiDrag, Is.EqualTo(0));
689 TestHelpers.InMethod();
692 string rpName =
"My Little Donkey";
693 UUID rpUuid = UUID.Parse(
"00000000-0000-0000-0000-000000000964");
694 UUID rpCreatorId = UUID.Parse(
"00000000-0000-0000-0000-000000000915");
703 rp.CreatorID = rpCreatorId;
706 string daNamespace =
"MyNamespace";
707 string daStoreName =
"MyStore";
708 string daKey =
"foo";
709 string daValue =
"bar";
711 myStore.Add(daKey, daValue);
712 rp.DynAttrs =
new DAMap();
713 rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore);
718 m_scene.AddSceneObject(so);
720 string xml = SceneObjectSerializer.ToOriginalXmlFormat(so);
722 XmlTextReader xtr =
new XmlTextReader(
new StringReader(xml));
723 xtr.ReadStartElement(
"SceneObjectGroup");
724 xtr.ReadStartElement(
"RootPart");
725 xtr.ReadStartElement(
"SceneObjectPart");
727 UUID uuid = UUID.Zero;
729 UUID creatorId = UUID.Zero;
732 while (xtr.Read() && xtr.Name !=
"SceneObjectPart")
734 if (xtr.NodeType != XmlNodeType.Element)
740 xtr.ReadStartElement(
"UUID");
743 uuid = UUID.Parse(xtr.ReadElementString(
"UUID"));
744 xtr.ReadEndElement();
749 name = xtr.ReadElementContentAsString();
752 xtr.ReadStartElement(
"CreatorID");
753 creatorId = UUID.Parse(xtr.ReadElementString(
"UUID"));
754 xtr.ReadEndElement();
763 xtr.ReadEndElement();
764 xtr.ReadEndElement();
765 xtr.ReadStartElement(
"OtherParts");
766 xtr.ReadEndElement();
770 Assert.That(uuid, Is.EqualTo(rpUuid));
771 Assert.That(name, Is.EqualTo(rpName));
772 Assert.That(creatorId, Is.EqualTo(rpCreatorId));
773 Assert.NotNull(daMap);
774 Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString());
780 TestHelpers.InMethod();
783 SceneObjectGroup so = m_serialiserModule.DeserializeGroupFromXml2(ObjectWithNoPartsXml2);
786 Assert.That(rootPart.UUID, Is.EqualTo(
new UUID(
"9be68fdd-f740-4a0f-9675-dfbbb536b946")));
787 Assert.That(rootPart.CreatorID, Is.EqualTo(
new UUID(
"b46ef588-411e-4a8b-a284-d7dcfe8e74ef")));
788 Assert.That(rootPart.Name, Is.EqualTo(
"PrimFun"));
789 OSDMap store = rootPart.DynAttrs.GetStore(
"MyNamespace",
"MyStore");
790 Assert.AreEqual(
"Rosebud", store[
"last words"].AsString());
798 TestHelpers.InMethod();
801 string rpName =
"My Little Pony";
802 UUID rpUuid = UUID.Parse(
"00000000-0000-0000-0000-000000000064");
803 UUID rpCreatorId = UUID.Parse(
"00000000-0000-0000-0000-000000000015");
812 rp.CreatorID = rpCreatorId;
815 string daNamespace =
"MyNamespace";
816 string daStoreName =
"MyStore";
817 string daKey =
"foo";
818 string daValue =
"bar";
820 myStore.Add(daKey, daValue);
821 rp.DynAttrs =
new DAMap();
822 rp.DynAttrs.SetStore(daNamespace, daStoreName, myStore);
827 m_scene.AddSceneObject(so);
829 Dictionary<string, object>
options =
new Dictionary<string, object>();
830 options[
"old-guids"] =
true;
831 string xml2 = m_serialiserModule.SerializeGroupToXml2(so,
options);
833 XmlTextReader xtr =
new XmlTextReader(
new StringReader(xml2));
834 xtr.ReadStartElement(
"SceneObjectGroup");
835 xtr.ReadStartElement(
"SceneObjectPart");
837 UUID uuid = UUID.Zero;
839 UUID creatorId = UUID.Zero;
842 while (xtr.Read() && xtr.Name !=
"SceneObjectPart")
844 if (xtr.NodeType != XmlNodeType.Element)
850 xtr.ReadStartElement(
"UUID");
851 uuid = UUID.Parse(xtr.ReadElementString(
"Guid"));
852 xtr.ReadEndElement();
855 name = xtr.ReadElementContentAsString();
858 xtr.ReadStartElement(
"CreatorID");
859 creatorId = UUID.Parse(xtr.ReadElementString(
"Guid"));
860 xtr.ReadEndElement();
869 xtr.ReadEndElement();
870 xtr.ReadStartElement(
"OtherParts");
871 xtr.ReadEndElement();
875 Assert.That(uuid, Is.EqualTo(rpUuid));
876 Assert.That(name, Is.EqualTo(rpName));
877 Assert.That(creatorId, Is.EqualTo(rpCreatorId));
878 Assert.NotNull(daMap);
879 Assert.AreEqual(daValue, daMap.GetStore(daNamespace, daStoreName)[daKey].AsString());
OpenMetaverse.StructuredData.OSDMap OSDMap
A scene object group is conceptually an object in the scene. The object is constituted of SceneObject...
void TestDeserializeXml2()
void TestDeserializeXmlObjectWithNoOtherParts()
This class stores and retrieves dynamic attributes.
Helpers for setting up scenes.
void TestDeserializeXmlObjectWithOtherParts()
Interactive OpenSim region server
SerialiserModule m_serialiserModule
void TestDeserializeBadFloatsXml()