29 using System.Collections.Generic;
31 using OpenMetaverse.StructuredData;
32 using NUnit.Framework;
33 using OpenSim.Framework;
34 using OpenSim.Framework.Serialization.External;
35 using OpenSim.Tests.Common;
37 namespace OpenSim.Framework.Serialization.Tests
42 private string m_serializedRs =
@"<?xml version=""1.0"" encoding=""utf-16""?>
45 <AllowDamage>True</AllowDamage>
46 <AllowLandResell>True</AllowLandResell>
47 <AllowLandJoinDivide>True</AllowLandJoinDivide>
48 <BlockFly>True</BlockFly>
49 <BlockLandShowInSearch>True</BlockLandShowInSearch>
50 <BlockTerraform>True</BlockTerraform>
51 <DisableCollisions>True</DisableCollisions>
52 <DisablePhysics>True</DisablePhysics>
53 <DisableScripts>True</DisableScripts>
54 <MaturityRating>1</MaturityRating>
55 <RestrictPushing>True</RestrictPushing>
56 <AgentLimit>40</AgentLimit>
57 <ObjectBonus>1.4</ObjectBonus>
60 <Texture1>00000000-0000-0000-0000-000000000020</Texture1>
61 <Texture2>00000000-0000-0000-0000-000000000040</Texture2>
62 <Texture3>00000000-0000-0000-0000-000000000060</Texture3>
63 <Texture4>00000000-0000-0000-0000-000000000080</Texture4>
64 <ElevationLowSW>1.9</ElevationLowSW>
65 <ElevationLowNW>15.9</ElevationLowNW>
66 <ElevationLowSE>49</ElevationLowSE>
67 <ElevationLowNE>45.3</ElevationLowNE>
68 <ElevationHighSW>2.1</ElevationHighSW>
69 <ElevationHighNW>4.5</ElevationHighNW>
70 <ElevationHighSE>9.2</ElevationHighSE>
71 <ElevationHighNE>19.2</ElevationHighNE>
74 <WaterHeight>23</WaterHeight>
75 <TerrainRaiseLimit>17.9</TerrainRaiseLimit>
76 <TerrainLowerLimit>0.4</TerrainLowerLimit>
77 <UseEstateSun>True</UseEstateSun>
78 <FixedSun>true</FixedSun>
79 <SunPosition>12</SunPosition>
82 <TelehubObject>00000000-0000-0000-0000-111111111111</TelehubObject>
83 <SpawnPoint>1,-2,0.33</SpawnPoint>
94 m_rs.AllowDamage =
true;
95 m_rs.AllowLandJoinDivide =
true;
96 m_rs.AllowLandResell =
true;
98 m_rs.BlockShowInSearch =
true;
99 m_rs.BlockTerraform =
true;
100 m_rs.DisableCollisions =
true;
101 m_rs.DisablePhysics =
true;
102 m_rs.DisableScripts =
true;
103 m_rs.Elevation1NW = 15.9;
104 m_rs.Elevation1NE = 45.3;
105 m_rs.Elevation1SE = 49;
106 m_rs.Elevation1SW = 1.9;
107 m_rs.Elevation2NW = 4.5;
108 m_rs.Elevation2NE = 19.2;
109 m_rs.Elevation2SE = 9.2;
110 m_rs.Elevation2SW = 2.1;
111 m_rs.FixedSun =
true;
112 m_rs.SunPosition = 12.0;
113 m_rs.ObjectBonus = 1.4;
114 m_rs.RestrictPushing =
true;
115 m_rs.TerrainLowerLimit = 0.4;
116 m_rs.TerrainRaiseLimit = 17.9;
117 m_rs.TerrainTexture1 = UUID.Parse(
"00000000-0000-0000-0000-000000000020");
118 m_rs.TerrainTexture2 = UUID.Parse(
"00000000-0000-0000-0000-000000000040");
119 m_rs.TerrainTexture3 = UUID.Parse(
"00000000-0000-0000-0000-000000000060");
120 m_rs.TerrainTexture4 = UUID.Parse(
"00000000-0000-0000-0000-000000000080");
121 m_rs.UseEstateSun =
true;
122 m_rs.WaterHeight = 23;
123 m_rs.TelehubObject = UUID.Parse(
"00000000-0000-0000-0000-111111111111");
124 m_rs.AddSpawnPoint(SpawnPoint.Parse(
"1,-2,0.33"));
130 TestHelpers.InMethod();
133 RegionSettings deserRs = RegionSettingsSerializer.Deserialize(m_serializedRs);
134 Assert.That(deserRs, Is.Not.Null);
135 Assert.That(deserRs.TerrainTexture2, Is.EqualTo(m_rs.TerrainTexture2));
136 Assert.That(deserRs.DisablePhysics, Is.EqualTo(m_rs.DisablePhysics));
137 Assert.That(deserRs.TerrainLowerLimit, Is.EqualTo(m_rs.TerrainLowerLimit));
138 Assert.That(deserRs.TelehubObject, Is.EqualTo(m_rs.TelehubObject));
139 Assert.That(deserRs.SpawnPoints()[0].ToString(), Is.EqualTo(m_rs.SpawnPoints()[0].ToString()));
OpenSim.Framework.RegionSettings RegionSettings
void TestRegionSettingsDeserialize()