aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Console/CommandConsole.cs9
-rw-r--r--OpenSim/Framework/Console/LocalConsole.cs4
-rw-r--r--OpenSim/Framework/Console/MockConsole.cs4
-rw-r--r--OpenSim/Framework/Console/RemoteConsole.cs1
-rw-r--r--OpenSim/Framework/IClientAPI.cs2
-rw-r--r--OpenSim/Framework/ICommandConsole.cs6
-rw-r--r--OpenSim/Framework/Monitoring/Watchdog.cs31
-rw-r--r--OpenSim/Framework/Serialization/External/LandDataSerializer.cs22
-rw-r--r--OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs85
9 files changed, 120 insertions, 44 deletions
diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs
index 87bdacd..bd23d1c 100644
--- a/OpenSim/Framework/Console/CommandConsole.cs
+++ b/OpenSim/Framework/Console/CommandConsole.cs
@@ -678,6 +678,8 @@ namespace OpenSim.Framework.Console
678 { 678 {
679// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 679// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
680 680
681 public event OnOutputDelegate OnOutput;
682
681 public ICommands Commands { get; private set; } 683 public ICommands Commands { get; private set; }
682 684
683 public CommandConsole(string defaultPrompt) : base(defaultPrompt) 685 public CommandConsole(string defaultPrompt) : base(defaultPrompt)
@@ -697,6 +699,13 @@ namespace OpenSim.Framework.Console
697 Output(s); 699 Output(s);
698 } 700 }
699 701
702 protected void FireOnOutput(string text)
703 {
704 OnOutputDelegate onOutput = OnOutput;
705 if (onOutput != null)
706 onOutput(text);
707 }
708
700 /// <summary> 709 /// <summary>
701 /// Display a command prompt on the console and wait for user input 710 /// Display a command prompt on the console and wait for user input
702 /// </summary> 711 /// </summary>
diff --git a/OpenSim/Framework/Console/LocalConsole.cs b/OpenSim/Framework/Console/LocalConsole.cs
index f65813b..d41481f 100644
--- a/OpenSim/Framework/Console/LocalConsole.cs
+++ b/OpenSim/Framework/Console/LocalConsole.cs
@@ -319,6 +319,8 @@ namespace OpenSim.Framework.Console
319 319
320 public override void Output(string text, string level) 320 public override void Output(string text, string level)
321 { 321 {
322 FireOnOutput(text);
323
322 lock (m_commandLine) 324 lock (m_commandLine)
323 { 325 {
324 if (m_cursorYPosition == -1) 326 if (m_cursorYPosition == -1)
@@ -509,4 +511,4 @@ namespace OpenSim.Framework.Console
509 } 511 }
510 } 512 }
511 } 513 }
512} \ No newline at end of file 514}
diff --git a/OpenSim/Framework/Console/MockConsole.cs b/OpenSim/Framework/Console/MockConsole.cs
index 4d8751f..b489f93 100644
--- a/OpenSim/Framework/Console/MockConsole.cs
+++ b/OpenSim/Framework/Console/MockConsole.cs
@@ -40,6 +40,8 @@ namespace OpenSim.Framework.Console
40 /// </summary> 40 /// </summary>
41 public class MockConsole : ICommandConsole 41 public class MockConsole : ICommandConsole
42 { 42 {
43 public event OnOutputDelegate OnOutput;
44
43 private MockCommands m_commands = new MockCommands(); 45 private MockCommands m_commands = new MockCommands();
44 46
45 public ICommands Commands { get { return m_commands; } } 47 public ICommands Commands { get { return m_commands; } }
@@ -76,4 +78,4 @@ namespace OpenSim.Framework.Console
76 public string[] Resolve(string[] cmd) { return null; } 78 public string[] Resolve(string[] cmd) { return null; }
77 public XmlElement GetXml(XmlDocument doc) { return null; } 79 public XmlElement GetXml(XmlDocument doc) { return null; }
78 } 80 }
79} \ No newline at end of file 81}
diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs
index e04ca1e..50eb173 100644
--- a/OpenSim/Framework/Console/RemoteConsole.cs
+++ b/OpenSim/Framework/Console/RemoteConsole.cs
@@ -100,6 +100,7 @@ namespace OpenSim.Framework.Console
100 m_LineNumber++; 100 m_LineNumber++;
101 m_Scrollback.Add(String.Format("{0}", m_LineNumber)+":"+level+":"+text); 101 m_Scrollback.Add(String.Format("{0}", m_LineNumber)+":"+level+":"+text);
102 } 102 }
103 FireOnOutput(text.Trim());
103 System.Console.WriteLine(text.Trim()); 104 System.Console.WriteLine(text.Trim());
104 } 105 }
105 106
diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs
index b1f41b8..6be2bd7 100644
--- a/OpenSim/Framework/IClientAPI.cs
+++ b/OpenSim/Framework/IClientAPI.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Framework
126 public delegate void ObjectDrop(uint localID, IClientAPI remoteClient); 126 public delegate void ObjectDrop(uint localID, IClientAPI remoteClient);
127 127
128 public delegate void UpdatePrimFlags( 128 public delegate void UpdatePrimFlags(
129 uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom,ExtraPhysicsData PhysData, IClientAPI remoteClient); 129 uint localID, bool UsePhysics, bool IsTemporary, bool IsPhantom, ExtraPhysicsData PhysData, IClientAPI remoteClient);
130 130
131 public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient); 131 public delegate void UpdatePrimTexture(uint localID, byte[] texture, IClientAPI remoteClient);
132 132
diff --git a/OpenSim/Framework/ICommandConsole.cs b/OpenSim/Framework/ICommandConsole.cs
index ca0ff93..8cd20da 100644
--- a/OpenSim/Framework/ICommandConsole.cs
+++ b/OpenSim/Framework/ICommandConsole.cs
@@ -74,8 +74,12 @@ namespace OpenSim.Framework
74 XmlElement GetXml(XmlDocument doc); 74 XmlElement GetXml(XmlDocument doc);
75 } 75 }
76 76
77 public delegate void OnOutputDelegate(string message);
78
77 public interface ICommandConsole : IConsole 79 public interface ICommandConsole : IConsole
78 { 80 {
81 event OnOutputDelegate OnOutput;
82
79 ICommands Commands { get; } 83 ICommands Commands { get; }
80 84
81 /// <summary> 85 /// <summary>
@@ -87,4 +91,4 @@ namespace OpenSim.Framework
87 91
88 string ReadLine(string p, bool isCommand, bool e); 92 string ReadLine(string p, bool isCommand, bool e);
89 } 93 }
90} \ No newline at end of file 94}
diff --git a/OpenSim/Framework/Monitoring/Watchdog.cs b/OpenSim/Framework/Monitoring/Watchdog.cs
index e4db964..b709baa 100644
--- a/OpenSim/Framework/Monitoring/Watchdog.cs
+++ b/OpenSim/Framework/Monitoring/Watchdog.cs
@@ -97,6 +97,32 @@ namespace OpenSim.Framework.Monitoring
97 /// /summary> 97 /// /summary>
98 public static event Action<ThreadWatchdogInfo> OnWatchdogTimeout; 98 public static event Action<ThreadWatchdogInfo> OnWatchdogTimeout;
99 99
100 /// <summary>
101 /// Is this watchdog active?
102 /// </summary>
103 public static bool Enabled
104 {
105 get { return m_enabled; }
106 set
107 {
108// m_log.DebugFormat("[MEMORY WATCHDOG]: Setting MemoryWatchdog.Enabled to {0}", value);
109
110 if (value == m_enabled)
111 return;
112
113 m_enabled = value;
114
115 if (m_enabled)
116 {
117 // Set now so we don't get alerted on the first run
118 LastWatchdogThreadTick = Environment.TickCount & Int32.MaxValue;
119 }
120
121 m_watchdogTimer.Enabled = m_enabled;
122 }
123 }
124 private static bool m_enabled;
125
100 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); 126 private static readonly ILog m_log = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
101 private static Dictionary<int, ThreadWatchdogInfo> m_threads; 127 private static Dictionary<int, ThreadWatchdogInfo> m_threads;
102 private static System.Timers.Timer m_watchdogTimer; 128 private static System.Timers.Timer m_watchdogTimer;
@@ -115,11 +141,6 @@ namespace OpenSim.Framework.Monitoring
115 m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS); 141 m_watchdogTimer = new System.Timers.Timer(WATCHDOG_INTERVAL_MS);
116 m_watchdogTimer.AutoReset = false; 142 m_watchdogTimer.AutoReset = false;
117 m_watchdogTimer.Elapsed += WatchdogTimerElapsed; 143 m_watchdogTimer.Elapsed += WatchdogTimerElapsed;
118
119 // Set now so we don't get alerted on the first run
120 LastWatchdogThreadTick = Environment.TickCount & Int32.MaxValue;
121
122 m_watchdogTimer.Start();
123 } 144 }
124 145
125 /// <summary> 146 /// <summary>
diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
index a64f01c..709b516 100644
--- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
+++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs
@@ -93,6 +93,8 @@ namespace OpenSim.Framework.Serialization.External
93 "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL")); 93 "MediaURL", (ld, xtr) => ld.MediaURL = xtr.ReadElementString("MediaURL"));
94 m_ldProcessors.Add( 94 m_ldProcessors.Add(
95 "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL")); 95 "MusicURL", (ld, xtr) => ld.MusicURL = xtr.ReadElementString("MusicURL"));
96 m_ldProcessors.Add(
97 "OwnerID", (ld, xtr) => ld.OwnerID = UUID.Parse(xtr.ReadElementString("OwnerID")));
96 98
97 m_ldProcessors.Add( 99 m_ldProcessors.Add(
98 "ParcelAccessList", ProcessParcelAccessList); 100 "ParcelAccessList", ProcessParcelAccessList);
@@ -186,7 +188,16 @@ namespace OpenSim.Framework.Serialization.External
186 return landData; 188 return landData;
187 } 189 }
188 190
189 public static string Serialize(LandData landData) 191 /// <summary>
192 /// Serialize land data
193 /// </summary>
194 /// <param name='landData'></param>
195 /// <param name='options'>
196 /// Serialization options.
197 /// Can be null if there are no options.
198 /// "wipe-owners" will write UUID.Zero rather than the ownerID so that a later reload loads all parcels with the estate owner as the owner
199 /// </param>
200 public static string Serialize(LandData landData, Dictionary<string, object> options)
190 { 201 {
191 StringWriter sw = new StringWriter(); 202 StringWriter sw = new StringWriter();
192 XmlTextWriter xtw = new XmlTextWriter(sw); 203 XmlTextWriter xtw = new XmlTextWriter(sw);
@@ -215,7 +226,14 @@ namespace OpenSim.Framework.Serialization.External
215 xtw.WriteElementString("MediaID", landData.MediaID.ToString()); 226 xtw.WriteElementString("MediaID", landData.MediaID.ToString());
216 xtw.WriteElementString("MediaURL", landData.MediaURL); 227 xtw.WriteElementString("MediaURL", landData.MediaURL);
217 xtw.WriteElementString("MusicURL", landData.MusicURL); 228 xtw.WriteElementString("MusicURL", landData.MusicURL);
218 xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); 229
230 UUID ownerIdToWrite;
231 if (options != null && options.ContainsKey("wipe-owners"))
232 ownerIdToWrite = UUID.Zero;
233 else
234 ownerIdToWrite = landData.OwnerID;
235
236 xtw.WriteElementString("OwnerID", ownerIdToWrite.ToString());
219 237
220 xtw.WriteStartElement("ParcelAccessList"); 238 xtw.WriteStartElement("ParcelAccessList");
221 foreach (LandAccessEntry pal in landData.ParcelAccessList) 239 foreach (LandAccessEntry pal in landData.ParcelAccessList)
diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
index b8ed9e1..8b9756b 100644
--- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
+++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs
@@ -42,22 +42,23 @@ namespace OpenSim.Framework.Serialization.Tests
42 private LandData land; 42 private LandData land;
43 private LandData landWithParcelAccessList; 43 private LandData landWithParcelAccessList;
44 44
45 private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; 45// private static string preSerialized = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList />\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
46 private static string preSerializedWithParcelAccessList = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>"; 46 private static string preSerializedWithParcelAccessList
47 = "<?xml version=\"1.0\" encoding=\"utf-16\"?>\n<LandData>\n <Area>128</Area>\n <AuctionID>0</AuctionID>\n <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>\n <Category>10</Category>\n <ClaimDate>0</ClaimDate>\n <ClaimPrice>0</ClaimPrice>\n <GlobalID>54ff9641-dd40-4a2c-b1f1-47dd3af24e50</GlobalID>\n <GroupID>d740204e-bbbf-44aa-949d-02c7d739f6a5</GroupID>\n <IsGroupOwned>False</IsGroupOwned>\n <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=</Bitmap>\n <Description>land data to test LandDataSerializer</Description>\n <Flags>536870944</Flags>\n <LandingType>2</LandingType>\n <Name>LandDataSerializerTest Land</Name>\n <Status>0</Status>\n <LocalID>0</LocalID>\n <MediaAutoScale>1</MediaAutoScale>\n <MediaID>d4452578-2f25-4b97-a81b-819af559cfd7</MediaID>\n <MediaURL>http://videos.opensimulator.org/bumblebee.mp4</MediaURL>\n <MusicURL />\n <OwnerID>1b8eedf9-6d15-448b-8015-24286f1756bf</OwnerID>\n <ParcelAccessList>\n <ParcelAccessEntry>\n <AgentID>62d65d45-c91a-4f77-862c-46557d978b6c</AgentID>\n <Time>0</Time>\n <AccessList>2</AccessList>\n </ParcelAccessEntry>\n <ParcelAccessEntry>\n <AgentID>ec2a8d18-2378-4fe0-8b68-2a31b57c481e</AgentID>\n <Time>0</Time>\n <AccessList>1</AccessList>\n </ParcelAccessEntry>\n </ParcelAccessList>\n <PassHours>0</PassHours>\n <PassPrice>0</PassPrice>\n <SalePrice>0</SalePrice>\n <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>\n <UserLocation>&lt;0, 0, 0&gt;</UserLocation>\n <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>\n <Dwell>0</Dwell>\n <OtherCleanTime>0</OtherCleanTime>\n</LandData>";
47 48
48 [SetUp] 49 [SetUp]
49 public void setup() 50 public void setup()
50 { 51 {
51 // setup LandData object 52 // setup LandData object
52 this.land = new LandData(); 53 this.land = new LandData();
53 this.land.AABBMax = new Vector3(0, 0, 0); 54 this.land.AABBMax = new Vector3(1, 2, 3);
54 this.land.AABBMin = new Vector3(128, 128, 128); 55 this.land.AABBMin = new Vector3(129, 130, 131);
55 this.land.Area = 128; 56 this.land.Area = 128;
56 this.land.AuctionID = 0; 57 this.land.AuctionID = 4;
57 this.land.AuthBuyerID = new UUID(); 58 this.land.AuthBuyerID = new UUID("7176df0c-6c50-45db-8a37-5e78be56a0cd");
58 this.land.Category = ParcelCategory.Residential; 59 this.land.Category = ParcelCategory.Residential;
59 this.land.ClaimDate = 0; 60 this.land.ClaimDate = 1;
60 this.land.ClaimPrice = 0; 61 this.land.ClaimPrice = 2;
61 this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50"); 62 this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50");
62 this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5"); 63 this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5");
63 this.land.Description = "land data to test LandDataSerializer"; 64 this.land.Description = "land data to test LandDataSerializer";
@@ -65,7 +66,7 @@ namespace OpenSim.Framework.Serialization.Tests
65 this.land.LandingType = (byte)LandingType.Direct; 66 this.land.LandingType = (byte)LandingType.Direct;
66 this.land.Name = "LandDataSerializerTest Land"; 67 this.land.Name = "LandDataSerializerTest Land";
67 this.land.Status = ParcelStatus.Leased; 68 this.land.Status = ParcelStatus.Leased;
68 this.land.LocalID = 0; 69 this.land.LocalID = 1;
69 this.land.MediaAutoScale = (byte)0x01; 70 this.land.MediaAutoScale = (byte)0x01;
70 this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7"); 71 this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7");
71 this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4"; 72 this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4";
@@ -90,26 +91,26 @@ namespace OpenSim.Framework.Serialization.Tests
90 /// <summary> 91 /// <summary>
91 /// Test the LandDataSerializer.Serialize() method 92 /// Test the LandDataSerializer.Serialize() method
92 /// </summary> 93 /// </summary>
93 [Test] 94// [Test]
94 public void LandDataSerializerSerializeTest() 95// public void LandDataSerializerSerializeTest()
95 { 96// {
96 TestHelpers.InMethod(); 97// TestHelpers.InMethod();
97 98//
98 string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n"); 99// string serialized = LandDataSerializer.Serialize(this.land).Replace("\r\n", "\n");
99 Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); 100// Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string");
100 101//
101 // adding a simple boolean variable because resharper nUnit integration doesn't like this 102// // adding a simple boolean variable because resharper nUnit integration doesn't like this
102 // XML data in the Assert.That statement. Not sure why. 103// // XML data in the Assert.That statement. Not sure why.
103 bool result = (serialized == preSerialized); 104// bool result = (serialized == preSerialized);
104 Assert.That(result, "result of Serialize LandData does not match expected result"); 105// Assert.That(result, "result of Serialize LandData does not match expected result");
105 106//
106 string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n"); 107// string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList).Replace("\r\n", "\n");
107 Assert.That(serializedWithParcelAccessList.Length > 0, 108// Assert.That(serializedWithParcelAccessList.Length > 0,
108 "Serialize(LandData) returned empty string for LandData object with ParcelAccessList"); 109// "Serialize(LandData) returned empty string for LandData object with ParcelAccessList");
109 result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList); 110// result = (serializedWithParcelAccessList == preSerializedWithParcelAccessList);
110 Assert.That(result, 111// Assert.That(result,
111 "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list"); 112// "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list");
112 } 113// }
113 114
114 /// <summary> 115 /// <summary>
115 /// Test the LandDataSerializer.Deserialize() method 116 /// Test the LandDataSerializer.Deserialize() method
@@ -120,10 +121,28 @@ namespace OpenSim.Framework.Serialization.Tests
120 TestHelpers.InMethod(); 121 TestHelpers.InMethod();
121// log4net.Config.XmlConfigurator.Configure(); 122// log4net.Config.XmlConfigurator.Configure();
122 123
123 LandData ld = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized); 124 LandData ld = LandDataSerializer.Deserialize(LandDataSerializer.Serialize(this.land, null));
124 Assert.That(ld != null, "Deserialize(string) returned null"); 125 Assert.That(ld, Is.Not.Null, "Deserialize(string) returned null");
125 Assert.That(ld.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID"); 126// Assert.That(ld.AABBMax, Is.EqualTo(land.AABBMax));
126 Assert.That(ld.Name == this.land.Name, "Reified LandData.Name != original LandData.Name"); 127// Assert.That(ld.AABBMin, Is.EqualTo(land.AABBMin));
128 Assert.That(ld.Area, Is.EqualTo(land.Area));
129 Assert.That(ld.AuctionID, Is.EqualTo(land.AuctionID));
130 Assert.That(ld.AuthBuyerID, Is.EqualTo(land.AuthBuyerID));
131 Assert.That(ld.Category, Is.EqualTo(land.Category));
132 Assert.That(ld.ClaimDate, Is.EqualTo(land.ClaimDate));
133 Assert.That(ld.ClaimPrice, Is.EqualTo(land.ClaimPrice));
134 Assert.That(ld.GlobalID, Is.EqualTo(land.GlobalID), "Reified LandData.GlobalID != original LandData.GlobalID");
135 Assert.That(ld.GroupID, Is.EqualTo(land.GroupID));
136 Assert.That(ld.Description, Is.EqualTo(land.Description));
137 Assert.That(ld.Flags, Is.EqualTo(land.Flags));
138 Assert.That(ld.LandingType, Is.EqualTo(land.LandingType));
139 Assert.That(ld.Name, Is.EqualTo(land.Name), "Reified LandData.Name != original LandData.Name");
140 Assert.That(ld.Status, Is.EqualTo(land.Status));
141 Assert.That(ld.LocalID, Is.EqualTo(land.LocalID));
142 Assert.That(ld.MediaAutoScale, Is.EqualTo(land.MediaAutoScale));
143 Assert.That(ld.MediaID, Is.EqualTo(land.MediaID));
144 Assert.That(ld.MediaURL, Is.EqualTo(land.MediaURL));
145 Assert.That(ld.OwnerID, Is.EqualTo(land.OwnerID));
127 } 146 }
128 147
129 [Test] 148 [Test]