From 6461243e7c780d79244184a8d4b100303f4cda27 Mon Sep 17 00:00:00 2001 From: Melanie Date: Thu, 17 Sep 2009 23:55:06 +0100 Subject: Remove the methods for full inventory fetch from the connector. Remove tests for the old, removed asset handlers --- .../Servers/Tests/GetAssetStreamHandlerTests.cs | 135 --------------------- 1 file changed, 135 deletions(-) delete mode 100644 OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs b/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs deleted file mode 100644 index be3f518..0000000 --- a/OpenSim/Framework/Servers/Tests/GetAssetStreamHandlerTests.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System; -using System.Collections.Generic; -using System.Net; -using System.Text; -using HttpServer; -using NUnit.Framework; -using OpenSim.Data; -using OpenSim.Framework.Servers.HttpServer; -using OpenSim.Tests.Common; -using OpenSim.Tests.Common.Mock; -using OpenSim.Tests.Common.Setup; - -namespace OpenSim.Framework.Servers.Tests -{ - [TestFixture] - public class GetAssetStreamHandlerTests - { - private const string ASSETS_PATH = "/assets"; - - [Test] - public void TestConstructor() - { - TestHelper.InMethod(); - - // GetAssetStreamHandler handler = - new GetAssetStreamHandler(null); - } - - [Test] - public void TestGetParams() - { - TestHelper.InMethod(); - - GetAssetStreamHandler handler = new GetAssetStreamHandler(null); - BaseRequestHandlerTestHelper.BaseTestGetParams(handler, ASSETS_PATH); - } - - [Test] - public void TestSplitParams() - { - TestHelper.InMethod(); - - GetAssetStreamHandler handler = new GetAssetStreamHandler(null); - BaseRequestHandlerTestHelper.BaseTestSplitParams(handler, ASSETS_PATH); - } - - [Test] - public void TestHandleNoParams() - { - TestHelper.InMethod(); - - GetAssetStreamHandler handler = new GetAssetStreamHandler(null); - - BaseRequestHandlerTestHelper.BaseTestHandleNoParams(handler, ASSETS_PATH); - } - - [Test] - public void TestHandleMalformedGuid() - { - TestHelper.InMethod(); - - GetAssetStreamHandler handler = new GetAssetStreamHandler(null); - - BaseRequestHandlerTestHelper.BaseTestHandleMalformedGuid(handler, ASSETS_PATH); - } - - [Test] - public void TestHandleFetchMissingAsset() - { - GetAssetStreamHandler handler; - OSHttpResponse response; - CreateTestEnvironment(out handler, out response); - - GetAssetStreamHandlerTestHelpers.BaseFetchMissingAsset(handler, response); - } - - [Test] - public void TestHandleFetchExistingAssetData() - { - GetAssetStreamHandler handler; - OSHttpResponse response; - AssetBase asset = CreateTestEnvironment(out handler, out response); - - GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetDataTest(asset, handler, response); - } - - [Test] - public void TestHandleFetchExistingAssetXml() - { - GetAssetStreamHandler handler; - OSHttpResponse response; - AssetBase asset = CreateTestEnvironment(out handler, out response); - - GetAssetStreamHandlerTestHelpers.BaseFetchExistingAssetXmlTest(asset, handler, response); - } - - private static AssetBase CreateTestEnvironment(out GetAssetStreamHandler handler, out OSHttpResponse response) - { - AssetBase asset = GetAssetStreamHandlerTestHelpers.CreateCommonTestResources(out response); - - IAssetDataPlugin assetDataPlugin = new TestAssetDataPlugin(); - handler = new GetAssetStreamHandler(assetDataPlugin); - - assetDataPlugin.StoreAsset(asset); - return asset; - } - } -} -- cgit v1.1 From 2d9d25b367cd6a33747d2b647abfe57ede97e805 Mon Sep 17 00:00:00 2001 From: Melanie Date: Sat, 19 Sep 2009 17:33:57 +0100 Subject: Add the skeleton of the authentication connector and the forms data requester --- .../HttpServer/SynchronousRestFormsRequester.cs | 95 ++++++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs new file mode 100644 index 0000000..0f0c790 --- /dev/null +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs @@ -0,0 +1,95 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.IO; +using System.Net; +using System.Text; +using System.Xml; +using System.Xml.Serialization; + +namespace OpenSim.Framework.Servers.HttpServer +{ + public class SynchronousRestFormsRequester + { + /// + /// Perform a synchronous REST request. + /// + /// + /// + /// + /// + /// + /// Thrown if we encounter a network issue while posting + /// the request. You'll want to make sure you deal with this as they're not uncommon + public static string MakeRequest(string verb, string requestUrl, string obj) + { + WebRequest request = WebRequest.Create(requestUrl); + request.Method = verb; + + if ((verb == "POST") || (verb == "PUT")) + { + request.ContentType = "text/www-form-urlencoded"; + + MemoryStream buffer = new MemoryStream(); + + using (StreamWriter writer = new StreamWriter(buffer)) + { + writer.WriteLine(obj); + writer.Flush(); + } + + int length = (int) buffer.Length; + request.ContentLength = length; + + Stream requestStream = request.GetRequestStream(); + requestStream.Write(buffer.ToArray(), 0, length); + } + + string respstring = String.Empty; + + try + { + using (WebResponse resp = request.GetResponse()) + { + if (resp.ContentLength > 0) + { + using (StreamReader reader = new StreamReader(resp.GetResponseStream())) + { + respstring = reader.ReadToEnd(); + } + } + } + } + catch (System.InvalidOperationException) + { + // This is what happens when there is invalid XML + } + return respstring; + } + } +} -- cgit v1.1 From 2a1b5e3540692eb90ccb943fb0aec08c14e9445b Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 14:14:22 +0100 Subject: A small fix for remote console to accommodate PollServiceArgs behavior a bit better --- OpenSim/Framework/Console/RemoteConsole.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 67bff4c..a005e20 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -197,7 +197,7 @@ namespace OpenSim.Framework.Console string uri = "/ReadResponses/" + sessionID.ToString() + "/"; - m_Server.AddPollServiceHTTPHandler(uri, HandleHttpCloseSession, + m_Server.AddPollServiceHTTPHandler(uri, HandleHttpPoll, new PollServiceEventArgs(HasEvents, GetEvents, NoEvents, sessionID)); @@ -230,6 +230,11 @@ namespace OpenSim.Framework.Console return reply; } + private Hashtable HandleHttpPoll(Hashtable request) + { + return new Hashtable(); + } + private Hashtable HandleHttpCloseSession(Hashtable request) { DoExpire(); -- cgit v1.1 From 04170521f081bf009bf15f76451b119dc280a438 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 14:59:31 +0100 Subject: Add a UUID param to NoEvents in PollServiceEventArgs to make it more generic --- OpenSim/Framework/Console/RemoteConsole.cs | 6 +++--- OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | 2 +- OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs | 2 +- OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index a005e20..5a18b94 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -393,12 +393,12 @@ namespace OpenSim.Framework.Console lock (m_Connections) { if (!m_Connections.ContainsKey(sessionID)) - return NoEvents(); + return NoEvents(UUID.Zero); c = m_Connections[sessionID]; } c.last = System.Environment.TickCount; if (c.lastLineSeen >= m_LineNumber) - return NoEvents(); + return NoEvents(UUID.Zero); Hashtable result = new Hashtable(); @@ -440,7 +440,7 @@ namespace OpenSim.Framework.Console return result; } - private Hashtable NoEvents() + private Hashtable NoEvents(UUID id) { Hashtable result = new Hashtable(); diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index fed490e..ed387d1 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -34,7 +34,7 @@ namespace OpenSim.Framework.Servers.HttpServer public delegate Hashtable GetEventsMethod(UUID pId, string request); - public delegate Hashtable NoEventsMethod(); + public delegate Hashtable NoEventsMethod(UUID pId); public class PollServiceEventArgs : EventArgs { diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index 4020190..db80f1d 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -130,7 +130,7 @@ namespace OpenSim.Framework.Servers.HttpServer foreach (object o in m_requests) { PollServiceHttpRequest req = (PollServiceHttpRequest) o; - m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); + m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); } m_requests.Clear(); diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 41fb376..1e8706c 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs @@ -112,7 +112,7 @@ namespace OpenSim.Framework.Servers.HttpServer { if ((Environment.TickCount - req.RequestTime) > m_timeout) { - m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(), + m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); } else -- cgit v1.1 From bc9e4cfd961e6ed0184165e4f3cbb770b47a8dff Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 18:11:40 +0100 Subject: Add a RequestID (UUID.Random()) to the PollRequest and pass it to all even hander delegates. --- OpenSim/Framework/Console/RemoteConsole.cs | 10 +++++----- OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | 6 +++--- OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs | 3 +++ .../Framework/Servers/HttpServer/PollServiceRequestManager.cs | 2 +- .../Framework/Servers/HttpServer/PollServiceWorkerThread.cs | 6 +++--- 5 files changed, 15 insertions(+), 12 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 5a18b94..76276a5 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -370,7 +370,7 @@ namespace OpenSim.Framework.Console } } - private bool HasEvents(UUID sessionID) + private bool HasEvents(UUID RequestID, UUID sessionID) { ConsoleConnection c = null; @@ -386,19 +386,19 @@ namespace OpenSim.Framework.Console return false; } - private Hashtable GetEvents(UUID sessionID, string request) + private Hashtable GetEvents(UUID RequestID, UUID sessionID, string request) { ConsoleConnection c = null; lock (m_Connections) { if (!m_Connections.ContainsKey(sessionID)) - return NoEvents(UUID.Zero); + return NoEvents(RequestID, UUID.Zero); c = m_Connections[sessionID]; } c.last = System.Environment.TickCount; if (c.lastLineSeen >= m_LineNumber) - return NoEvents(UUID.Zero); + return NoEvents(RequestID, UUID.Zero); Hashtable result = new Hashtable(); @@ -440,7 +440,7 @@ namespace OpenSim.Framework.Console return result; } - private Hashtable NoEvents(UUID id) + private Hashtable NoEvents(UUID RequestID, UUID id) { Hashtable result = new Hashtable(); diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index ed387d1..61cb8aa 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -30,11 +30,11 @@ using System.Collections; using OpenMetaverse; namespace OpenSim.Framework.Servers.HttpServer { - public delegate bool HasEventsMethod(UUID pId); + public delegate bool HasEventsMethod(UUID requestID, UUID pId); - public delegate Hashtable GetEventsMethod(UUID pId, string request); + public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId, string request); - public delegate Hashtable NoEventsMethod(UUID pId); + public delegate Hashtable NoEventsMethod(UUID requestID, UUID pId); public class PollServiceEventArgs : EventArgs { diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs index ff7c1e8..553a7eb 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceHttpRequest.cs @@ -27,6 +27,7 @@ using System; using HttpServer; +using OpenMetaverse; namespace OpenSim.Framework.Servers.HttpServer { @@ -37,12 +38,14 @@ namespace OpenSim.Framework.Servers.HttpServer public readonly IHttpClientContext HttpContext; public readonly IHttpRequest Request; public readonly int RequestTime; + public readonly UUID RequestID; public PollServiceHttpRequest(PollServiceEventArgs pPollServiceArgs, IHttpClientContext pHttpContext, IHttpRequest pRequest) { PollServiceArgs = pPollServiceArgs; HttpContext = pHttpContext; Request = pRequest; RequestTime = System.Environment.TickCount; + RequestID = UUID.Random(); } } } diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs index db80f1d..1c54581 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceRequestManager.cs @@ -130,7 +130,7 @@ namespace OpenSim.Framework.Servers.HttpServer foreach (object o in m_requests) { PollServiceHttpRequest req = (PollServiceHttpRequest) o; - m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); + m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request), req.HttpContext)); } m_requests.Clear(); diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs index 1e8706c..ce32443 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceWorkerThread.cs @@ -100,11 +100,11 @@ namespace OpenSim.Framework.Servers.HttpServer PollServiceHttpRequest req = m_request.Dequeue(); try { - if (req.PollServiceArgs.HasEvents(req.PollServiceArgs.Id)) + if (req.PollServiceArgs.HasEvents(req.RequestID, req.PollServiceArgs.Id)) { StreamReader str = new StreamReader(req.Request.Body); - Hashtable responsedata = req.PollServiceArgs.GetEvents(req.PollServiceArgs.Id, str.ReadToEnd()); + Hashtable responsedata = req.PollServiceArgs.GetEvents(req.RequestID, req.PollServiceArgs.Id, str.ReadToEnd()); m_server.DoHTTPGruntWork(responsedata, new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); } @@ -112,7 +112,7 @@ namespace OpenSim.Framework.Servers.HttpServer { if ((Environment.TickCount - req.RequestTime) > m_timeout) { - m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.PollServiceArgs.Id), + m_server.DoHTTPGruntWork(req.PollServiceArgs.NoEvents(req.RequestID, req.PollServiceArgs.Id), new OSHttpResponse(new HttpResponse(req.HttpContext, req.Request),req.HttpContext)); } else -- cgit v1.1 From 390137d540b9ae39eba3ba9136bd49d5e992bc5f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 21 Sep 2009 11:05:01 -0700 Subject: Added grid handler and grid remote connector. --- OpenSim/Framework/RegionInfo.cs | 62 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 3896a6e..afd50a9 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -26,6 +26,7 @@ */ using System; +using System.Collections.Generic; using System.Net; using System.Net.Sockets; using System.Xml; @@ -197,6 +198,67 @@ namespace OpenSim.Framework { return m_internalEndPoint.Port; } + + public Dictionary ToKeyValuePairs() + { + Dictionary kvp = new Dictionary(); + kvp["uuid"] = RegionID.ToString(); + kvp["locX"] = RegionLocX.ToString(); + kvp["locY"] = RegionLocY.ToString(); + kvp["external_ip_address"] = ExternalEndPoint.Address.ToString(); + kvp["external_port"] = ExternalEndPoint.Port.ToString(); + kvp["external_host_name"] = ExternalHostName; + kvp["http_port"] = HttpPort.ToString(); + kvp["internal_ip_address"] = InternalEndPoint.Address.ToString(); + kvp["internal_port"] = InternalEndPoint.Port.ToString(); + kvp["alternate_ports"] = m_allow_alternate_ports.ToString(); + kvp["server_uri"] = ServerURI; + + return kvp; + } + + public SimpleRegionInfo(Dictionary kvp) + { + if ((kvp["external_ip_address"] != null) && (kvp["external_port"] != null)) + { + int port = 0; + Int32.TryParse((string)kvp["external_port"], out port); + IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["external_ip_address"]), port); + ExternalEndPoint = ep; + } + else + ExternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); + + if (kvp["external_host_name"] != null) + ExternalHostName = (string)kvp["external_host_name"]; + + if (kvp["http_port"] != null) + { + UInt32 port = 0; + UInt32.TryParse((string)kvp["http_port"], out port); + HttpPort = port; + } + + if ((kvp["internal_ip_address"] != null) && (kvp["internal_port"] != null)) + { + int port = 0; + Int32.TryParse((string)kvp["internal_port"], out port); + IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)kvp["internal_ip_address"]), port); + InternalEndPoint = ep; + } + else + InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), 0); + + if (kvp["alternate_ports"] != null) + { + bool alts = false; + Boolean.TryParse((string)kvp["alternate_ports"], out alts); + m_allow_alternate_ports = alts; + } + + if (kvp["server_uri"] != null) + ServerURI = (string)kvp["server_uri"]; + } } public class RegionInfo : SimpleRegionInfo -- cgit v1.1 From 69b76acce1abc87dbeafa6d0773637682ce4e1d4 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 19:46:29 +0100 Subject: Make the poll service handler call the handler method on incoming requests. --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 39 +++++++++++++++++----- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 771ae05..b73557f 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -260,7 +260,9 @@ namespace OpenSim.Framework.Servers.HttpServer PollServiceEventArgs psEvArgs; if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) { + OSHttpRequest req = new OSHttpRequest(context, request); + HandleRequest(req, null); m_PollServiceManager.Enqueue(new PollServiceHttpRequest(psEvArgs, context, request)); //DoHTTPGruntWork(psEvArgs.NoEvents(),new OSHttpResponse(new HttpResponse(context, request))); } @@ -332,19 +334,26 @@ namespace OpenSim.Framework.Servers.HttpServer // probability event; if a request is matched it is normally expected to be // handled //m_log.Debug("[BASE HTTP SERVER]: Handling Request" + request.RawUrl); - IHttpAgentHandler agentHandler; - if (TryGetAgentHandler(request, response, out agentHandler)) + // If the response is null, then we're not going to respond here. This case + // triggers when we're at the head of a HTTP poll + // + if (response != null) { - if (HandleAgentRequest(agentHandler, request, response)) + IHttpAgentHandler agentHandler; + + if (TryGetAgentHandler(request, response, out agentHandler)) { - return; + if (HandleAgentRequest(agentHandler, request, response)) + { + return; + } } - } + //response.KeepAlive = true; + response.SendChunked = false; + } IRequestHandler requestHandler; - //response.KeepAlive = true; - response.SendChunked = false; string path = request.RawUrl; string handlerKey = GetHandlerKey(request.HttpMethod, path); @@ -357,7 +366,9 @@ namespace OpenSim.Framework.Servers.HttpServer // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. byte[] buffer = null; - response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. + if (response != null) + response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. + if (requestHandler is IStreamedRequestHandler) { @@ -411,7 +422,12 @@ namespace OpenSim.Framework.Servers.HttpServer //m_log.Warn("[HTTP]: " + requestBody); } - DoHTTPGruntWork(HTTPRequestHandler.Handle(path, keysvals), response); + // If we're not responding, we dont' care about the reply + // + if (response == null) + HTTPRequestHandler.Handle(path, keysvals); + else + DoHTTPGruntWork(HTTPRequestHandler.Handle(path, keysvals), response); return; } else @@ -426,6 +442,11 @@ namespace OpenSim.Framework.Servers.HttpServer } } + // The handler has run and we're not yet ready to respond, bail + // + if (response == null) + return; + request.InputStream.Close(); // HTTP IN support. The script engine taes it from here -- cgit v1.1 From 61aaf3532ae0de94ea39ee7dc4b13a31cd149b40 Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 20:10:26 +0100 Subject: Add X-PollServiceID pseudo-header to the request handling for polls --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index b73557f..5a7f20a 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -262,8 +262,10 @@ namespace OpenSim.Framework.Servers.HttpServer { OSHttpRequest req = new OSHttpRequest(context, request); + PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); + req.Headers["X-PollServiceID"] = psreq.RequestID.ToString(); HandleRequest(req, null); - m_PollServiceManager.Enqueue(new PollServiceHttpRequest(psEvArgs, context, request)); + m_PollServiceManager.Enqueue(psreq); //DoHTTPGruntWork(psEvArgs.NoEvents(),new OSHttpResponse(new HttpResponse(context, request))); } else -- cgit v1.1 From b6b8a18d377999e02c65cdc5d0188d530dc1498b Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 21 Sep 2009 20:21:01 +0100 Subject: Add the headers collection to the keysvals for HTT requests --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 5a7f20a..5d83e34 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -417,6 +417,7 @@ namespace OpenSim.Framework.Servers.HttpServer // } keysvals.Add("requestbody", requestBody); + keysvals.Add("headers",headervals); if (keysvals.Contains("method")) { //m_log.Warn("[HTTP]: Contains Method"); -- cgit v1.1 From 06871d51dd47cd59185e2123f8235b4d79aee02c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 22 Sep 2009 05:13:50 +0100 Subject: Disable the handler execution for poll services until the ramifications can be studied --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 5d83e34..5c9fa9b 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -260,11 +260,11 @@ namespace OpenSim.Framework.Servers.HttpServer PollServiceEventArgs psEvArgs; if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) { - OSHttpRequest req = new OSHttpRequest(context, request); +// OSHttpRequest req = new OSHttpRequest(context, request); PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); - req.Headers["X-PollServiceID"] = psreq.RequestID.ToString(); - HandleRequest(req, null); +// req.Headers["X-PollServiceID"] = psreq.RequestID.ToString(); +// HandleRequest(req, null); m_PollServiceManager.Enqueue(psreq); //DoHTTPGruntWork(psEvArgs.NoEvents(),new OSHttpResponse(new HttpResponse(context, request))); } -- cgit v1.1 From c5be401d46dfbb1e47927b4123130c43c6a054b5 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 22 Sep 2009 05:24:22 +0100 Subject: Remove support for executing a handler on poll. It caused other issues --- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 38 +++++++--------------- 1 file changed, 11 insertions(+), 27 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 5c9fa9b..0198960 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -337,24 +337,19 @@ namespace OpenSim.Framework.Servers.HttpServer // handled //m_log.Debug("[BASE HTTP SERVER]: Handling Request" + request.RawUrl); - // If the response is null, then we're not going to respond here. This case - // triggers when we're at the head of a HTTP poll - // - if (response != null) - { - IHttpAgentHandler agentHandler; + IHttpAgentHandler agentHandler; - if (TryGetAgentHandler(request, response, out agentHandler)) + if (TryGetAgentHandler(request, response, out agentHandler)) + { + if (HandleAgentRequest(agentHandler, request, response)) { - if (HandleAgentRequest(agentHandler, request, response)) - { - return; - } + return; } - - //response.KeepAlive = true; - response.SendChunked = false; } + + //response.KeepAlive = true; + response.SendChunked = false; + IRequestHandler requestHandler; string path = request.RawUrl; @@ -368,8 +363,7 @@ namespace OpenSim.Framework.Servers.HttpServer // Okay, so this is bad, but should be considered temporary until everything is IStreamHandler. byte[] buffer = null; - if (response != null) - response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. + response.ContentType = requestHandler.ContentType; // Lets do this defaulting before in case handler has varying content type. if (requestHandler is IStreamedRequestHandler) @@ -425,12 +419,7 @@ namespace OpenSim.Framework.Servers.HttpServer //m_log.Warn("[HTTP]: " + requestBody); } - // If we're not responding, we dont' care about the reply - // - if (response == null) - HTTPRequestHandler.Handle(path, keysvals); - else - DoHTTPGruntWork(HTTPRequestHandler.Handle(path, keysvals), response); + DoHTTPGruntWork(HTTPRequestHandler.Handle(path, keysvals), response); return; } else @@ -445,11 +434,6 @@ namespace OpenSim.Framework.Servers.HttpServer } } - // The handler has run and we're not yet ready to respond, bail - // - if (response == null) - return; - request.InputStream.Close(); // HTTP IN support. The script engine taes it from here -- cgit v1.1 From dafe5bf05f6d85d4140a0b733f0fbf9a5c43cf37 Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 22 Sep 2009 06:19:02 +0100 Subject: Completely remove the prior implementation of the request event handling on poll handlers. Introduce a new delegate on the PollServiceEventArgs that allow access to the request headers and body. --- OpenSim/Framework/Console/RemoteConsole.cs | 2 +- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 78 +++++++++++----------- .../Servers/HttpServer/PollServiceEventArgs.cs | 5 +- 3 files changed, 45 insertions(+), 40 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Console/RemoteConsole.cs b/OpenSim/Framework/Console/RemoteConsole.cs index 76276a5..c27072c 100644 --- a/OpenSim/Framework/Console/RemoteConsole.cs +++ b/OpenSim/Framework/Console/RemoteConsole.cs @@ -198,7 +198,7 @@ namespace OpenSim.Framework.Console string uri = "/ReadResponses/" + sessionID.ToString() + "/"; m_Server.AddPollServiceHTTPHandler(uri, HandleHttpPoll, - new PollServiceEventArgs(HasEvents, GetEvents, NoEvents, + new PollServiceEventArgs(null, HasEvents, GetEvents, NoEvents, sessionID)); XmlDocument xmldoc = new XmlDocument(); diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 0198960..db87958 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -256,17 +256,51 @@ namespace OpenSim.Framework.Servers.HttpServer IHttpClientContext context = (IHttpClientContext)source; IHttpRequest request = args.Request; - PollServiceEventArgs psEvArgs; + if (TryGetPollServiceHTTPHandler(request.UriPath.ToString(), out psEvArgs)) { -// OSHttpRequest req = new OSHttpRequest(context, request); - PollServiceHttpRequest psreq = new PollServiceHttpRequest(psEvArgs, context, request); -// req.Headers["X-PollServiceID"] = psreq.RequestID.ToString(); -// HandleRequest(req, null); + + if (psEvArgs.Request != null) + { + OSHttpRequest req = new OSHttpRequest(context, request); + + Stream requestStream = req.InputStream; + + Encoding encoding = Encoding.UTF8; + StreamReader reader = new StreamReader(requestStream, encoding); + + string requestBody = reader.ReadToEnd(); + + Hashtable keysvals = new Hashtable(); + Hashtable headervals = new Hashtable(); + + string[] querystringkeys = req.QueryString.AllKeys; + string[] rHeaders = req.Headers.AllKeys; + + keysvals.Add("body", requestBody); + keysvals.Add("uri", req.RawUrl); + keysvals.Add("content-type", req.ContentType); + keysvals.Add("http-method", req.HttpMethod); + + foreach (string queryname in querystringkeys) + { + keysvals.Add(queryname, req.QueryString[queryname]); + } + + foreach (string headername in rHeaders) + { + headervals[headername] = req.Headers[headername]; + } + + keysvals.Add("headers",headervals); + keysvals.Add("querystringkeys", querystringkeys); + + psEvArgs.Request(psreq.RequestID, keysvals); + } + m_PollServiceManager.Enqueue(psreq); - //DoHTTPGruntWork(psEvArgs.NoEvents(),new OSHttpResponse(new HttpResponse(context, request))); } else { @@ -279,48 +313,16 @@ namespace OpenSim.Framework.Servers.HttpServer { OSHttpRequest req = new OSHttpRequest(context, request); OSHttpResponse resp = new OSHttpResponse(new HttpResponse(context, request),context); - //resp.KeepAlive = req.KeepAlive; - //m_log.Info("[Debug BASE HTTP SERVER]: Got Request"); - //HttpServerContextObj objstate= new HttpServerContextObj(req,resp); - //ThreadPool.QueueUserWorkItem(new WaitCallback(ConvertIHttpClientContextToOSHttp), (object)objstate); HandleRequest(req, resp); } public void ConvertIHttpClientContextToOSHttp(object stateinfo) { HttpServerContextObj objstate = (HttpServerContextObj)stateinfo; - //OSHttpRequest request = new OSHttpRequest(objstate.context,objstate.req); - //OSHttpResponse resp = new OSHttpResponse(new HttpServer.HttpResponse(objstate.context, objstate.req)); OSHttpRequest request = objstate.oreq; OSHttpResponse resp = objstate.oresp; - //OSHttpResponse resp = new OSHttpResponse(new HttpServer.HttpResponse(objstate.context, objstate.req)); - - /* - request.AcceptTypes = objstate.req.AcceptTypes; - request.ContentLength = (long)objstate.req.ContentLength; - request.Headers = objstate.req.Headers; - request.HttpMethod = objstate.req.Method; - request.InputStream = objstate.req.Body; - foreach (string str in request.Headers) - { - if (str.ToLower().Contains("content-type: ")) - { - request.ContentType = str.Substring(13, str.Length - 13); - break; - } - } - //request.KeepAlive = objstate.req. - foreach (HttpServer.HttpInput httpinput in objstate.req.QueryString) - { - request.QueryString.Add(httpinput.Name, httpinput[httpinput.Name]); - } - - //request.Query = objstate.req.//objstate.req.QueryString; - //foreach ( - //request.QueryString = objstate.req.QueryString; - */ HandleRequest(request,resp); } diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 61cb8aa..7ed9e5c 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -30,6 +30,7 @@ using System.Collections; using OpenMetaverse; namespace OpenSim.Framework.Servers.HttpServer { + public delegate void RequestMethod(UUID requestID, Hashtable request); public delegate bool HasEventsMethod(UUID requestID, UUID pId); public delegate Hashtable GetEventsMethod(UUID requestID, UUID pId, string request); @@ -41,9 +42,11 @@ namespace OpenSim.Framework.Servers.HttpServer public HasEventsMethod HasEvents; public GetEventsMethod GetEvents; public NoEventsMethod NoEvents; + public RequestMethod Request; public UUID Id; - public PollServiceEventArgs(HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId) + public PollServiceEventArgs(RequestMethod Request, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId) { + Request = Request; HasEvents = pHasEvents; GetEvents = pGetEvents; NoEvents = pNoEvents; -- cgit v1.1 From 97c18caa766e2dd72b152b78827ef554f2054f8c Mon Sep 17 00:00:00 2001 From: Melanie Date: Tue, 22 Sep 2009 17:04:34 +0100 Subject: Thank you, Intari, for a patch that implements the missing pieces of Http-in and makes the host name for URL generation configurable. Applied with changes: llGetSimulatorHostname was not changed, because the change breaks existing behavior and carries a data exposure risk. That value needs to be configurable, the proposed fixed change is not acceptable. --- OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs index 7ed9e5c..9d512c6 100644 --- a/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs +++ b/OpenSim/Framework/Servers/HttpServer/PollServiceEventArgs.cs @@ -44,9 +44,9 @@ namespace OpenSim.Framework.Servers.HttpServer public NoEventsMethod NoEvents; public RequestMethod Request; public UUID Id; - public PollServiceEventArgs(RequestMethod Request, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId) + public PollServiceEventArgs(RequestMethod pRequest, HasEventsMethod pHasEvents, GetEventsMethod pGetEvents, NoEventsMethod pNoEvents,UUID pId) { - Request = Request; + Request = pRequest; HasEvents = pHasEvents; GetEvents = pGetEvents; NoEvents = pNoEvents; -- cgit v1.1 From ffd30b8ac31bc408316079ba86076bf9e984a8be Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 14:46:05 -0700 Subject: Moved RegionName from RegionInfo to SimpleRegionInfo. --- OpenSim/Framework/RegionInfo.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index afd50a9..0dc35a5 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -64,6 +64,13 @@ namespace OpenSim.Framework } protected string m_serverURI; + public string RegionName + { + get { return m_regionName; } + set { m_regionName = value; } + } + protected string m_regionName = String.Empty; + protected bool Allow_Alternate_Ports; public bool m_allow_alternate_ports; protected string m_externalHostName; @@ -284,7 +291,6 @@ namespace OpenSim.Framework public UUID originRegionID = UUID.Zero; public string proxyUrl = ""; public int ProxyOffset = 0; - public string RegionName = String.Empty; public string regionSecret = UUID.Random().ToString(); public string osSecret; -- cgit v1.1 From 882d2c9cc399c4c7d1809702104ce94c9c2c7b17 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Tue, 22 Sep 2009 20:25:00 -0700 Subject: Added hg console commands to the module. Added the IN connector module for link-region and corresponding handler to be used in the regions only. No service as such is needed. This will replace the current link-region machinery. Compiles but not tested. --- OpenSim/Framework/RegionInfo.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 0dc35a5..cee1d4b 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -108,6 +108,7 @@ namespace OpenSim.Framework public SimpleRegionInfo(RegionInfo ConvertFrom) { + m_regionName = ConvertFrom.RegionName; m_regionLocX = ConvertFrom.RegionLocX; m_regionLocY = ConvertFrom.RegionLocY; m_internalEndPoint = ConvertFrom.InternalEndPoint; -- cgit v1.1 From 03438f7d449a09e28dcb1543b2075d70b2573ffc Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 23 Sep 2009 16:24:26 +0100 Subject: minor: remove double initialization of user appearance module in Grid.UserServer.Main --- OpenSim/Framework/Communications/Services/LoginService.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index bf59f8e..a6cd918 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs @@ -1221,11 +1221,13 @@ namespace OpenSim.Framework.Communications.Services { return Util.CreateUnknownUserErrorResponse(); } + UUID.TryParse((string)requestData["session_id"], out guess_sid); if (guess_sid == UUID.Zero) { return Util.CreateUnknownUserErrorResponse(); } + if (m_userManager.VerifySession(guess_aid, guess_sid)) { authed = "TRUE"; @@ -1243,6 +1245,5 @@ namespace OpenSim.Framework.Communications.Services response.Value = responseData; return response; } - } -} +} \ No newline at end of file -- cgit v1.1 From 71a4b02c7e9a2587759fd40092d1bdcfef648eff Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Thu, 24 Sep 2009 20:56:01 +1000 Subject: * Minor commit, added two new math utility functions. --- OpenSim/Framework/Util.cs | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 58344f3..45b5a10 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -70,6 +70,39 @@ namespace OpenSim.Framework public static readonly Regex UUIDPattern = new Regex("^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"); + /// + /// Linear interpolates B<->C using percent A + /// + /// + /// + /// + /// + public static double lerp(double a, double b, double c) + { + return (b*a) + (c*(1 - a)); + } + + /// + /// Bilinear Interpolate, see Lerp but for 2D using 'percents' X & Y. + /// Layout: + /// A B + /// C D + /// A<->C = Y + /// C<->D = X + /// + /// + /// + /// + /// + /// + /// + /// + public static double lerp2D(double x, double y, double a, double b, double c, double d) + { + return lerp(y, lerp(x, a, b), lerp(x, c, d)); + } + + /// /// Well known UUID for the blank texture used in the Linden SL viewer version 1.20 (and hopefully onwards) /// -- cgit v1.1 From 7870152d23db4cb6f5834d4921fac17feb717220 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Sep 2009 14:54:12 +0100 Subject: Allow load/save iar password checks to be done in grid mode This should allow load/save iar to work for grid mode as long as the grid user service is later than this revision Grid services of earlier revisions will always erroneously report incorrect password. This will be addressed shortly. --- OpenSim/Framework/Communications/IUserService.cs | 16 +++++++++-- .../Communications/Tests/Cache/AssetCacheTests.cs | 5 ++++ .../Framework/Communications/UserManagerBase.cs | 32 +++++++++++++++++++--- 3 files changed, 47 insertions(+), 6 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 725225d..15c5a96 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -98,7 +98,7 @@ namespace OpenSim.Framework.Communications /// The agent that who's friends list is being updated /// The agent that is getting or loosing permissions /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects - void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); + void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); /// /// Logs off a user on the user server @@ -137,9 +137,21 @@ namespace OpenSim.Framework.Communications // But since Scenes only have IUserService references, I'm placing it here for now. bool VerifySession(UUID userID, UUID sessionID); + /// + /// Authenticate a user by their password. + /// + /// + /// This is used by callers outside the login process that want to + /// verify a user who has given their password. + /// + /// This should probably also be in IAuthentication but is here for the same reasons as VerifySession() is + /// + /// + /// + /// + bool AuthenticateUserByPassword(UUID userID, string password); // Temporary Hack until we move everything to the new service model void SetInventoryService(IInventoryService invService); - } } diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs index ac0dc6d..a757282 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs @@ -149,6 +149,11 @@ namespace OpenSim.Framework.Communications.Tests { throw new NotImplementedException(); } + + public virtual bool AuthenticateUserByPassword(UUID userID, string password) + { + throw new NotImplementedException(); + } } } } diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 58174a0..1abd733 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -44,7 +44,8 @@ namespace OpenSim.Framework.Communications /// /// Base class for user management (create, read, etc) /// - public abstract class UserManagerBase : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication + public abstract class UserManagerBase + : IUserService, IUserAdminService, IAvatarService, IMessagingService, IAuthentication { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); @@ -93,9 +94,9 @@ namespace OpenSim.Framework.Communications public void AddPlugin(string provider, string connect) { m_plugins.AddRange(DataPluginFactory.LoadDataPlugins(provider, connect)); - } + } - #region UserProfile + #region UserProfile public virtual void AddTemporaryUserProfile(UserProfileData userProfile) { @@ -891,7 +892,10 @@ namespace OpenSim.Framework.Communications if (userProfile != null && userProfile.CurrentAgent != null) { - m_log.DebugFormat("[USER AUTH]: Verifying session {0} for {1}; current session {2}", sessionID, userID, userProfile.CurrentAgent.SessionID); + m_log.DebugFormat( + "[USER AUTH]: Verifying session {0} for {1}; current session {2}", + sessionID, userID, userProfile.CurrentAgent.SessionID); + if (userProfile.CurrentAgent.SessionID == sessionID) { return true; @@ -901,6 +905,26 @@ namespace OpenSim.Framework.Communications return false; } + public virtual bool AuthenticateUserByPassword(UUID userID, string password) + { +// m_log.DebugFormat("[USER AUTH]: Authenticating user {0} given password {1}", userID, password); + + UserProfileData userProfile = GetUserProfile(userID); + + if (null == userProfile) + return false; + + string md5PasswordHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + userProfile.PasswordSalt); + +// m_log.DebugFormat( +// "[USER AUTH]: Submitted hash {0}, stored hash {1}", md5PasswordHash, userProfile.PasswordHash); + + if (md5PasswordHash == userProfile.PasswordHash) + return true; + else + return false; + } + #endregion } } -- cgit v1.1 From e67341f24c3706be09d2c0c5d2d4ddeba1ddd089 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 24 Sep 2009 15:02:55 +0100 Subject: minor: replace xmlprc 'no method found' magic number with constant from xmlrpc library --- OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index db87958..01990fa 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -736,8 +736,11 @@ namespace OpenSim.Framework.Servers.HttpServer else { xmlRpcResponse = new XmlRpcResponse(); + // Code set in accordance with http://xmlrpc-epi.sourceforge.net/specs/rfc.fault_codes.php - xmlRpcResponse.SetFault(-32601, String.Format("Requested method [{0}] not found", methodName)); + xmlRpcResponse.SetFault( + XmlRpcErrorCodes.SERVER_ERROR_METHOD, + String.Format("Requested method [{0}] not found", methodName)); } responseString = XmlRpcResponseSerializer.Singleton.Serialize(xmlRpcResponse); @@ -757,6 +760,7 @@ namespace OpenSim.Framework.Servers.HttpServer response.SendChunked = false; response.ContentLength64 = buf.Length; response.ContentEncoding = Encoding.UTF8; + try { response.OutputStream.Write(buf, 0, buf.Length); -- cgit v1.1 From dd3d52ae1faefbca85e2fe8d8cea67f7db4005ac Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Thu, 24 Sep 2009 13:33:58 -0700 Subject: Added test GridClient, which allowed me to remove a few bugs out of the new code. --- OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index 0f0c790..ebb2691 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs @@ -56,14 +56,14 @@ namespace OpenSim.Framework.Servers.HttpServer request.ContentType = "text/www-form-urlencoded"; MemoryStream buffer = new MemoryStream(); - + int length = 0; using (StreamWriter writer = new StreamWriter(buffer)) { writer.WriteLine(obj); writer.Flush(); + length = (int)buffer.Length; } - int length = (int) buffer.Length; request.ContentLength = length; Stream requestStream = request.GetRequestStream(); -- cgit v1.1 From 5757afe7665543e8b3ed4a322a7d6e095dafcdb3 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 07:48:21 -0700 Subject: First pass at the heart surgery for grid services. Compiles and runs minimally. A few bugs to catch now. --- OpenSim/Framework/Communications/Clients/RegionClient.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Clients/RegionClient.cs b/OpenSim/Framework/Communications/Clients/RegionClient.cs index 73e2db0..3419ce2 100644 --- a/OpenSim/Framework/Communications/Clients/RegionClient.cs +++ b/OpenSim/Framework/Communications/Clients/RegionClient.cs @@ -35,6 +35,8 @@ using System.Text; using OpenMetaverse; using OpenMetaverse.StructuredData; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; + using log4net; namespace OpenSim.Framework.Communications.Clients @@ -43,7 +45,7 @@ namespace OpenSim.Framework.Communications.Clients { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - public bool DoCreateChildAgentCall(RegionInfo region, AgentCircuitData aCircuit, string authKey, out string reason) + public bool DoCreateChildAgentCall(GridRegion region, AgentCircuitData aCircuit, string authKey, out string reason) { reason = String.Empty; @@ -166,7 +168,7 @@ namespace OpenSim.Framework.Communications.Clients } - public bool DoChildAgentUpdateCall(RegionInfo region, IAgentData cAgentData) + public bool DoChildAgentUpdateCall(GridRegion region, IAgentData cAgentData) { // Eventually, we want to use a caps url instead of the agentID string uri = string.Empty; @@ -260,7 +262,7 @@ namespace OpenSim.Framework.Communications.Clients return true; } - public bool DoRetrieveRootAgentCall(RegionInfo region, UUID id, out IAgentData agent) + public bool DoRetrieveRootAgentCall(GridRegion region, UUID id, out IAgentData agent) { agent = null; // Eventually, we want to use a caps url instead of the agentID @@ -348,7 +350,7 @@ namespace OpenSim.Framework.Communications.Clients } - public bool DoCloseAgentCall(RegionInfo region, UUID id) + public bool DoCloseAgentCall(GridRegion region, UUID id) { string uri = string.Empty; try @@ -391,7 +393,7 @@ namespace OpenSim.Framework.Communications.Clients return true; } - public bool DoCreateObjectCall(RegionInfo region, ISceneObject sog, string sogXml2, bool allowScriptCrossing) + public bool DoCreateObjectCall(GridRegion region, ISceneObject sog, string sogXml2, bool allowScriptCrossing) { ulong regionHandle = GetRegionHandle(region.RegionHandle); string uri @@ -474,7 +476,7 @@ namespace OpenSim.Framework.Communications.Clients } - public bool DoCreateObjectCall(RegionInfo region, UUID userID, UUID itemID) + public bool DoCreateObjectCall(GridRegion region, UUID userID, UUID itemID) { ulong regionHandle = GetRegionHandle(region.RegionHandle); string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/object/" + UUID.Zero + "/" + regionHandle.ToString() + "/"; @@ -646,7 +648,7 @@ namespace OpenSim.Framework.Communications.Clients return false; } - public virtual void SendUserInformation(RegionInfo regInfo, AgentCircuitData aCircuit) + public virtual void SendUserInformation(GridRegion regInfo, AgentCircuitData aCircuit) { } -- cgit v1.1 From 632bb7126277b6e8b524b76fb181a079b51adcf4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 08:49:48 -0700 Subject: Fixed MapBlocks bug, wrong order of arguments. First version that seems completely functional. Also fixed the notification of the message server in standalone -- that server doesn't usually exist. --- OpenSim/Framework/NetworkServersInfo.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index 3b00af3..7e66742 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs @@ -102,8 +102,7 @@ namespace OpenSim.Framework ConfigSettings.DefaultInventoryServerHttpPort.ToString()); secureInventoryServer = config.Configs["Network"].GetBoolean("secure_inventory_server", true); - MessagingURL = config.Configs["Network"].GetString("messaging_server_url", - "http://127.0.0.1:" + ConfigSettings.DefaultMessageServerHttpPort); + MessagingURL = config.Configs["Network"].GetString("messaging_server_url", string.Empty); } } } -- cgit v1.1 From f4bf581b96347b8d7f115eca74fa84a644eb729c Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 21:00:51 -0700 Subject: Moved all HG1 operations to HGGridConnector.cs and HypergridServerConnector.cs/HypergridServiceConnector.cs, away from Region.Communications and HGNetworkServersInfo. Fixed small bugs with hyperlinked regions' map positions. --- OpenSim/Framework/Util.cs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 45b5a10..a28a617 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -1203,6 +1203,32 @@ namespace OpenSim.Framework return found.ToArray(); } + public static string ServerURI(string uri) + { + if (uri == string.Empty) + return string.Empty; + + // Get rid of eventual slashes at the end + uri = uri.TrimEnd('/'); + + IPAddress ipaddr1 = null; + string port1 = ""; + try + { + ipaddr1 = Util.GetHostFromURL(uri); + } + catch { } + + try + { + port1 = uri.Split(new char[] { ':' })[2]; + } + catch { } + + // We tried our best to convert the domain names to IP addresses + return (ipaddr1 != null) ? "http://" + ipaddr1.ToString() + ":" + port1 : uri; + } + #region FireAndForget Threading Pattern public static void FireAndForget(System.Threading.WaitCallback callback) -- cgit v1.1 From 68e40a87cafcab580ab484956f187068c098e84e Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sat, 26 Sep 2009 21:29:54 -0700 Subject: Poof! on LocalBackend. CommsManager.GridServices deleted. --- OpenSim/Framework/Communications/CommunicationsManager.cs | 5 ----- 1 file changed, 5 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index e9a6adb..9f377a6 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -59,11 +59,6 @@ namespace OpenSim.Framework.Communications } protected IMessagingService m_messageService; - public IGridServices GridService - { - get { return m_gridService; } - } - protected IGridServices m_gridService; public UserProfileCacheService UserProfileCacheService { -- cgit v1.1 From 5d09c53a1a42b38e1ee35cfbb5571d70b75380f4 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 27 Sep 2009 10:14:10 -0700 Subject: Unpacking the mess with OtherRegionUp, so we can have a real cache of the neighbours in the grid service modules. --- OpenSim/Framework/IRegionCommsListener.cs | 3 --- OpenSim/Framework/IScene.cs | 2 +- OpenSim/Framework/RegionCommsListener.cs | 13 ------------- 3 files changed, 1 insertion(+), 17 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/IRegionCommsListener.cs b/OpenSim/Framework/IRegionCommsListener.cs index ba4c616..307c6bc 100644 --- a/OpenSim/Framework/IRegionCommsListener.cs +++ b/OpenSim/Framework/IRegionCommsListener.cs @@ -46,8 +46,6 @@ namespace OpenSim.Framework public delegate bool CloseAgentConnection(UUID agentID); - public delegate bool RegionUp(RegionInfo region); - public delegate bool ChildAgentUpdate(ChildAgentDataUpdate cAgentData); public delegate void LogOffUser(UUID agentID, UUID regionSecret, string message); @@ -65,7 +63,6 @@ namespace OpenSim.Framework event AcknowledgePrimCross OnAcknowledgePrimCrossed; event UpdateNeighbours OnNeighboursUpdate; event CloseAgentConnection OnCloseAgentConnection; - event RegionUp OnRegionUp; event ChildAgentUpdate OnChildAgentUpdate; event LogOffUser OnLogOffUser; event GetLandData OnGetLandData; diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index 2e2c703..d61e08c 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs @@ -74,7 +74,7 @@ namespace OpenSim.Framework void CloseAllAgents(uint circuitcode); void Restart(int seconds); - bool OtherRegionUp(RegionInfo thisRegion); + //RegionInfo OtherRegionUp(RegionInfo thisRegion); string GetSimulatorVersion(); diff --git a/OpenSim/Framework/RegionCommsListener.cs b/OpenSim/Framework/RegionCommsListener.cs index 016c78c..90200d6 100644 --- a/OpenSim/Framework/RegionCommsListener.cs +++ b/OpenSim/Framework/RegionCommsListener.cs @@ -47,7 +47,6 @@ namespace OpenSim.Framework private ExpectUserDelegate handlerExpectUser = null; // OnExpectUser private UpdateNeighbours handlerNeighboursUpdate = null; // OnNeighboursUpdate; private PrimCrossing handlerPrimCrossingIntoRegion = null; // OnPrimCrossingIntoRegion; - private RegionUp handlerRegionUp = null; // OnRegionUp; private LogOffUser handlerLogOffUser = null; private GetLandData handlerGetLandData = null; @@ -62,7 +61,6 @@ namespace OpenSim.Framework public event AcknowledgeAgentCross OnAcknowledgeAgentCrossed; public event AcknowledgePrimCross OnAcknowledgePrimCrossed; public event CloseAgentConnection OnCloseAgentConnection; - public event RegionUp OnRegionUp; public event ChildAgentUpdate OnChildAgentUpdate; public event LogOffUser OnLogOffUser; public event GetLandData OnGetLandData; @@ -108,17 +106,6 @@ namespace OpenSim.Framework return false; } - public virtual bool TriggerRegionUp(RegionInfo region) - { - handlerRegionUp = OnRegionUp; - if (handlerRegionUp != null) - { - handlerRegionUp(region); - return true; - } - return false; - } - public virtual bool TriggerChildAgentUpdate(ChildAgentDataUpdate cAgentData) { handlerChildAgentUpdate = OnChildAgentUpdate; -- cgit v1.1 From 0f05bbb4a20224492febf17604fa23ef2486fa1a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 05:54:37 -0700 Subject: Deleted some files that aren't being used anymore. --- OpenSim/Framework/Communications/IGridServices.cs | 92 ----------------------- OpenSim/Framework/Communications/IHyperlink.cs | 38 ---------- 2 files changed, 130 deletions(-) delete mode 100644 OpenSim/Framework/Communications/IGridServices.cs delete mode 100644 OpenSim/Framework/Communications/IHyperlink.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/IGridServices.cs b/OpenSim/Framework/Communications/IGridServices.cs deleted file mode 100644 index 6365919..0000000 --- a/OpenSim/Framework/Communications/IGridServices.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -using System.Collections.Generic; -using OpenMetaverse; - -namespace OpenSim.Framework.Communications -{ - public interface IGridServices - { - string gdebugRegionName { get; set; } - - /// - /// If true, then regions will accept logins from the user service. If false, then they will not. - /// - bool RegionLoginsEnabled { get; set; } - - /// - /// Register a region with the grid service. - /// - /// - /// - /// Thrown if region registration failed - RegionCommsListener RegisterRegion(RegionInfo regionInfos); - - /// - /// Deregister a region with the grid service. - /// - /// - /// - /// Thrown if region deregistration failed - bool DeregisterRegion(RegionInfo regionInfo); - - /// - /// Get information about the regions neighbouring the given co-ordinates. - /// - /// - /// - /// - List RequestNeighbours(uint x, uint y); - - RegionInfo RequestNeighbourInfo(ulong regionHandle); - RegionInfo RequestNeighbourInfo(UUID regionID); - RegionInfo RequestNeighbourInfo(string name); - RegionInfo RequestNeighbourInfo(string host, uint port); - - RegionInfo RequestClosestRegion(string regionName); - Dictionary GetGridSettings(); - List RequestNeighbourMapBlocks(int minX, int minY, int maxX, int maxY); - // not complete yet, only contains the fields needed for ParcelInfoReqeust - LandData RequestLandData(ulong regionHandle, uint x, uint y); - - /// - /// Get information about regions starting with the provided name. - /// - /// - /// The name to match against. - /// - /// - /// The maximum number of results to return. - /// - /// - /// A list of s of regions with matching name. If the - /// grid-server couldn't be contacted or returned an error, return null. - /// - List RequestNamedRegions(string name, int maxNumber); - } -} diff --git a/OpenSim/Framework/Communications/IHyperlink.cs b/OpenSim/Framework/Communications/IHyperlink.cs deleted file mode 100644 index 5057386..0000000 --- a/OpenSim/Framework/Communications/IHyperlink.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -namespace OpenSim.Framework.Communications -{ - public interface IHyperlink - { - bool IsHyperlinkRegion(ulong handle); - RegionInfo GetHyperlinkRegion(ulong handle); - ulong FindRegionHandle(ulong handle); - bool SendUserInformation(RegionInfo region, AgentCircuitData aCircuit); - void AdjustUserInformation(AgentCircuitData aCircuit); - } -} -- cgit v1.1 From 69da82b39fbb9952e29f57ff08f731b14f969f04 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 06:44:57 -0700 Subject: Bug fix in SynchronousRestFormsRequester -- Write instead of WriteLine, which was causing an extra \n to be written into the buffer. --- OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs index ebb2691..a0d4008 100644 --- a/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/SynchronousRestFormsRequester.cs @@ -59,11 +59,11 @@ namespace OpenSim.Framework.Servers.HttpServer int length = 0; using (StreamWriter writer = new StreamWriter(buffer)) { - writer.WriteLine(obj); + writer.Write(obj); writer.Flush(); - length = (int)buffer.Length; } + length = (int)obj.Length; request.ContentLength = length; Stream requestStream = request.GetRequestStream(); -- cgit v1.1 From 7cd03abab54c697fc24dc871f96ddfea78daeb9c Mon Sep 17 00:00:00 2001 From: Melanie Date: Mon, 28 Sep 2009 18:41:21 +0100 Subject: Bump main version to 0.6.8-Dev --- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 6f9b00c..d06adb5 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -29,7 +29,7 @@ namespace OpenSim { public class VersionInfo { - private const string VERSION_NUMBER = "0.6.6"; + private const string VERSION_NUMBER = "0.6.8"; private const Flavour VERSION_FLAVOUR = Flavour.Dev; public enum Flavour -- cgit v1.1 From 77f5e41631aa102044d523786ab4a03a2d56c980 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 29 Sep 2009 21:21:37 +0900 Subject: Remove empty CheckSumServer.cs file. --- OpenSim/Framework/Servers/CheckSumServer.cs | 26 -------------------------- 1 file changed, 26 deletions(-) delete mode 100644 OpenSim/Framework/Servers/CheckSumServer.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Servers/CheckSumServer.cs b/OpenSim/Framework/Servers/CheckSumServer.cs deleted file mode 100644 index ad5281d..0000000 --- a/OpenSim/Framework/Servers/CheckSumServer.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Contributors, http://opensimulator.org/ - * See CONTRIBUTORS.TXT for a full list of copyright holders. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSimulator Project nor the - * names of its contributors may be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY - * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -- cgit v1.1 From 1006a2254c733655bf11d3cf25e41d1b43bd5f6a Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 30 Sep 2009 13:36:03 +0100 Subject: Make create user to the Right Thing with regard to salting user passwords --- OpenSim/Framework/Communications/UserManagerBase.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 1abd733..86238b1 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -650,15 +650,17 @@ namespace OpenSim.Framework.Communications public virtual UUID AddUser( string firstName, string lastName, string password, string email, uint regX, uint regY, UUID SetUUID) { - string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + String.Empty); UserProfileData user = new UserProfileData(); + + user.PasswordSalt = Util.Md5Hash(UUID.Random().ToString()); + string md5PasswdHash = Util.Md5Hash(Util.Md5Hash(password) + ":" + user.PasswordSalt); + user.HomeLocation = new Vector3(128, 128, 100); user.ID = SetUUID; user.FirstName = firstName; user.SurName = lastName; user.PasswordHash = md5PasswdHash; - user.PasswordSalt = String.Empty; user.Created = Util.UnixTimeSinceEpoch(); user.HomeLookAt = new Vector3(100, 100, 100); user.HomeRegionX = regX; -- cgit v1.1 From 33515c75e44421df58a97058a6281eb96e0e50fd Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Tue, 29 Sep 2009 09:07:00 +0200 Subject: adding LandDataSerializer (not connected anywhere, work-in-progress) [hi, there, justin!] --- .../Serialization/External/LandDataSerializer.cs | 185 +++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 OpenSim/Framework/Serialization/External/LandDataSerializer.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs new file mode 100644 index 0000000..6bfae41 --- /dev/null +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -0,0 +1,185 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System; +using System.Collections.Generic; +using System.IO; +using System.Text; +using System.Xml; +using OpenMetaverse; +using OpenSim.Framework; + +namespace OpenSim.Framework.Serialization.External +{ + /// + /// Serialize and deserialize LandData as an external format. + /// + public class LandDataSerializer + { + protected static UTF8Encoding m_utf8Encoding = new UTF8Encoding(); + + /// + /// Reify/deserialize landData + /// + /// + /// + /// + public static LandData Deserialize(byte[] serializedLandData) + { + return Deserialize(m_utf8Encoding.GetString(serializedLandData, 0, serializedLandData.Length)); + } + + /// + /// Reify/deserialize landData + /// + /// + /// + /// + public static LandData Deserialize(string serializedLandData) + { + LandData landData = new LandData(); + + StringReader sr = new StringReader(serializedLandData); + XmlTextReader xtr = new XmlTextReader(sr); + + xtr.ReadStartElement("LandData"); + + landData.Area = Convert.ToInt32( xtr.ReadElementString("Area")); + landData.AuctionID = Convert.ToUInt32( xtr.ReadElementString("AuctionID")); + landData.AuthBuyerID = UUID.Parse( xtr.ReadElementString("AuthBuyerID")); + landData.Category = (ParcelCategory)Convert.ToSByte( xtr.ReadElementString("Category")); + landData.ClaimDate = Convert.ToInt32( xtr.ReadElementString("ClaimDate")); + landData.ClaimPrice = Convert.ToInt32( xtr.ReadElementString("ClaimPrice")); + landData.GlobalID = UUID.Parse( xtr.ReadElementString("GlobalID")); + landData.GroupID = UUID.Parse( xtr.ReadElementString("GroupID")); + landData.IsGroupOwned = Convert.ToBoolean( xtr.ReadElementString("IsGroupOwned")); + landData.Bitmap = Convert.FromBase64String( xtr.ReadElementString("Bitmap")); + landData.Description = xtr.ReadElementString("Description"); + landData.Flags = Convert.ToUInt32( xtr.ReadElementString("Flags")); + landData.LandingType = Convert.ToByte( xtr.ReadElementString("LandingType")); + landData.Name = xtr.ReadElementString("Name"); + landData.Status = (ParcelStatus)Convert.ToSByte( xtr.ReadElementString("Status")); + landData.LocalID = Convert.ToInt32( xtr.ReadElementString("LocalID")); + landData.MediaAutoScale = Convert.ToByte( xtr.ReadElementString("MediaAutoScale")); + landData.MediaID = UUID.Parse( xtr.ReadElementString("MediaID")); + landData.MediaURL = xtr.ReadElementString("MediaURL"); + landData.MusicURL = xtr.ReadElementString("MusicURL"); + landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID")); + + landData.ParcelAccessList = new List(); + xtr.ReadStartElement("ParcelAccessList"); + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) + { + ParcelManager.ParcelAccessEntry pae; + + xtr.ReadStartElement("ParcelAccessEntry"); + pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); + pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); + pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); + xtr.ReadEndElement(); + + landData.ParcelAccessList.Add(pae); + } + xtr.ReadEndElement(); + + landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours")); + landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice")); + landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice")); + landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); + landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); + landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); + landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell")); + landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); + + xtr.ReadEndElement(); + + xtr.Close(); + sr.Close(); + + return landData; + } + + public static string Serialize(LandData landData) + { + StringWriter sw = new StringWriter(); + XmlTextWriter xtw = new XmlTextWriter(sw); + xtw.Formatting = Formatting.Indented; + + xtw.WriteStartDocument(); + xtw.WriteStartElement("LandData"); + + xtw.WriteElementString("Area", landData.Area.ToString()); + xtw.WriteElementString("AuctionID", landData.AuctionID.ToString()); + xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); + xtw.WriteElementString("Category", landData.Category.ToString()); + xtw.WriteElementString("ClaimDate", landData.ClaimDate.ToString()); + xtw.WriteElementString("ClaimPrice", landData.ClaimPrice.ToString()); + xtw.WriteElementString("GlobalID", landData.GlobalID.ToString()); + xtw.WriteElementString("GroupID", landData.GroupID.ToString()); + xtw.WriteElementString("IsGroupOwned", landData.IsGroupOwned.ToString()); + xtw.WriteElementString("Bitmap", landData.Bitmap.ToString()); + xtw.WriteElementString("Description", landData.Description); + xtw.WriteElementString("Flags", landData.Flags.ToString()); + xtw.WriteElementString("LandingType", landData.LandingType.ToString()); + xtw.WriteElementString("Name", landData.Name); + xtw.WriteElementString("Status", landData.Status.ToString()); + xtw.WriteElementString("LocalID", landData.LocalID.ToString()); + xtw.WriteElementString("MediaAutoScale", landData.MediaAutoScale.ToString()); + xtw.WriteElementString("MediaID", landData.MediaID.ToString()); + xtw.WriteElementString("MediaURL", landData.MediaURL.ToString()); + xtw.WriteElementString("MusicURL", landData.MusicURL.ToString()); + xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); + + xtw.WriteStartElement("ParcelAccessList"); + foreach(ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList) + { + xtw.WriteStartElement("ParcelAccessEntry"); + xtw.WriteElementString("AgentID", pal.AgentID.ToString()); + xtw.WriteElementString("Time", pal.Time.ToString()); + xtw.WriteElementString("AccessList", pal.Flags.ToString()); + xtw.WriteEndElement(); + } + xtw.WriteEndElement(); + + xtw.WriteElementString("PassHours", landData.PassHours.ToString()); + xtw.WriteElementString("PassPrice", landData.PassPrice.ToString()); + xtw.WriteElementString("SalePrice", landData.SalePrice.ToString()); + xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString()); + xtw.WriteElementString("UserLocation", landData.UserLocation.ToString()); + xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString()); + xtw.WriteElementString("Dwell", landData.Dwell.ToString()); + xtw.WriteElementString("OtherCleanTime", landData.OtherCleanTime.ToString()); + + xtw.WriteEndElement(); + + xtw.Close(); + sw.Close(); + + return sw.ToString(); + } + } +} -- cgit v1.1 From ee205e7e812e170f670e690a4e0fa9caa652f226 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 01:00:09 +0900 Subject: Formatting cleanup. --- OpenSim/Framework/AvatarWearable.cs | 2 +- OpenSim/Framework/Capabilities/CapsUtil.cs | 2 +- OpenSim/Framework/Client/IClientIM.cs | 2 +- OpenSim/Framework/ClientManager.cs | 4 +-- OpenSim/Framework/CnmMemoryCache.cs | 40 +++++++++++----------- OpenSim/Framework/CnmSynchronizedCache.cs | 26 +++++++------- .../Communications/Cache/CachedUserInfo.cs | 8 ++--- .../Cache/UserProfileCacheService.cs | 34 +++++++++--------- .../Communications/CommunicationsManager.cs | 4 +-- OpenSim/Framework/Communications/IAvatarService.cs | 2 +- .../Framework/Communications/IUserAdminService.cs | 2 +- OpenSim/Framework/Communications/IUserService.cs | 6 ++-- .../Osp/OspInventoryWrapperPlugin.cs | 6 ++-- .../Framework/Communications/Osp/OspResolver.cs | 12 +++---- .../Communications/Services/LoginService.cs | 2 +- .../Communications/TemporaryUserProfilePlugin.cs | 4 +-- .../Communications/Tests/Cache/AssetCacheTests.cs | 4 +-- .../Tests/Cache/UserProfileCacheServiceTests.cs | 12 +++---- .../Communications/Tests/LoginServiceTests.cs | 2 +- .../Framework/Communications/UserManagerBase.cs | 8 ++--- OpenSim/Framework/Console/CommandConsole.cs | 10 +++--- OpenSim/Framework/GridConfig.cs | 6 ++-- OpenSim/Framework/IAssetCache.cs | 22 ++++++------ OpenSim/Framework/IClientAPI.cs | 6 ++-- OpenSim/Framework/ICnmCache.cs | 24 ++++++------- OpenSim/Framework/IScene.cs | 2 +- OpenSim/Framework/ISceneObject.cs | 2 +- OpenSim/Framework/InventoryFolderBase.cs | 2 +- OpenSim/Framework/InventoryFolderImpl.cs | 2 +- OpenSim/Framework/InventoryItemBase.cs | 40 +++++++++++----------- OpenSim/Framework/InventoryNodeBase.cs | 12 +++---- OpenSim/Framework/NetworkServersInfo.cs | 2 +- OpenSim/Framework/RegionInfo.cs | 2 +- .../External/RegionSettingsSerializer.cs | 6 ++-- .../External/UserProfileSerializer.cs | 4 +-- OpenSim/Framework/Servers/BaseOpenSimServer.cs | 12 +++---- .../HttpServer/AsynchronousRestObjectRequester.cs | 2 +- .../Framework/Servers/HttpServer/BaseHttpServer.cs | 22 ++++++------ .../Servers/HttpServer/Interfaces/IHttpServer.cs | 2 +- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- OpenSim/Framework/SimStats.cs | 14 ++++---- OpenSim/Framework/TaskInventoryDictionary.cs | 2 +- OpenSim/Framework/ThreadTracker.cs | 6 ++-- OpenSim/Framework/UserConfig.cs | 2 +- OpenSim/Framework/UserProfileData.cs | 2 +- OpenSim/Framework/Util.cs | 6 ++-- 46 files changed, 198 insertions(+), 198 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/AvatarWearable.cs b/OpenSim/Framework/AvatarWearable.cs index 5071594..4a5253c 100644 --- a/OpenSim/Framework/AvatarWearable.cs +++ b/OpenSim/Framework/AvatarWearable.cs @@ -59,7 +59,7 @@ namespace OpenSim.Framework // Body defaultWearables[0].ItemID = new UUID("66c41e39-38f9-f75a-024e-585989bfaba9"); - defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); + defaultWearables[0].AssetID = new UUID("66c41e39-38f9-f75a-024e-585989bfab73"); // Skin defaultWearables[1].ItemID = new UUID("77c41e39-38f9-f75a-024e-585989bfabc9"); diff --git a/OpenSim/Framework/Capabilities/CapsUtil.cs b/OpenSim/Framework/Capabilities/CapsUtil.cs index 46dbd3d..0334e4b 100644 --- a/OpenSim/Framework/Capabilities/CapsUtil.cs +++ b/OpenSim/Framework/Capabilities/CapsUtil.cs @@ -28,7 +28,7 @@ using OpenMetaverse; namespace OpenSim.Framework.Capabilities -{ +{ /// /// Capabilities utility methods /// diff --git a/OpenSim/Framework/Client/IClientIM.cs b/OpenSim/Framework/Client/IClientIM.cs index 81b1d9e..3df86d0 100644 --- a/OpenSim/Framework/Client/IClientIM.cs +++ b/OpenSim/Framework/Client/IClientIM.cs @@ -57,7 +57,7 @@ namespace OpenSim.Framework.Client // Porting Guide from old IM // SendIM(...) // Loses FromAgentSession - this should be added by implementers manually. - // + // public interface IClientIM { diff --git a/OpenSim/Framework/ClientManager.cs b/OpenSim/Framework/ClientManager.cs index db532e0..094a3ff 100644 --- a/OpenSim/Framework/ClientManager.cs +++ b/OpenSim/Framework/ClientManager.cs @@ -177,9 +177,9 @@ namespace OpenSim.Framework } public void ViewerEffectHandler(IClientAPI sender, List args) - { + { // TODO: don't create new blocks if recycling an old packet - List effectBlock = new List(); + List effectBlock = new List(); for (int i = 0; i < args.Count; i++) { ViewerEffectPacket.EffectBlock effect = new ViewerEffectPacket.EffectBlock(); diff --git a/OpenSim/Framework/CnmMemoryCache.cs b/OpenSim/Framework/CnmMemoryCache.cs index db91801..92af331 100644 --- a/OpenSim/Framework/CnmMemoryCache.cs +++ b/OpenSim/Framework/CnmMemoryCache.cs @@ -70,7 +70,7 @@ namespace OpenSim.Framework /// /// How many operations between time checks. - /// + /// private const int DefaultOperationsBetweenTimeChecks = 40; /// @@ -168,7 +168,7 @@ namespace OpenSim.Framework private int m_version; /// - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// public CnmMemoryCache() : this(DefaultMaxSize) @@ -277,7 +277,7 @@ namespace OpenSim.Framework /// protected virtual void AddToNewGeneration(int bucketIndex, TKey key, TValue value, long size) { - // Add to newest generation + // Add to newest generation if (!m_newGeneration.Set(bucketIndex, key, value, size)) { // Failed to add new generation @@ -311,7 +311,7 @@ namespace OpenSim.Framework /// Bucket index is remainder when element key's hash value is divided by bucket count. /// /// - /// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2. + /// For example: key's hash is 72, bucket count is 5, element's bucket index is 72 % 5 = 2. /// /// protected virtual int GetBucketIndex(TKey key) @@ -367,7 +367,7 @@ namespace OpenSim.Framework /// private void RecycleGenerations() { - // Rotate old generation to new generation, new generation to old generation + // Rotate old generation to new generation, new generation to old generation IGeneration temp = m_newGeneration; m_newGeneration = m_oldGeneration; m_newGeneration.Clear(); @@ -522,7 +522,7 @@ namespace OpenSim.Framework /// /// Index of first element's in element chain. /// - /// + /// /// -1 if there is no element in bucket; otherwise first element's index in the element chain. /// /// @@ -692,7 +692,7 @@ namespace OpenSim.Framework /// /// /// 0 if element is free; otherwise larger than 0. - /// + /// public long Size; /// @@ -771,7 +771,7 @@ namespace OpenSim.Framework /// /// /// The enumerator has reach end of collection or is not called. - /// + /// public KeyValuePair Current { get @@ -1405,10 +1405,10 @@ namespace OpenSim.Framework /// When adding an new element to that is limiting total size of elements, /// will remove less recently used elements until it can fit an new element. /// - /// + /// /// /// - /// + /// /// /// public bool IsSizeLimited @@ -1438,7 +1438,7 @@ namespace OpenSim.Framework } /// - /// Gets a value indicating whether elements stored to have limited inactivity time. + /// Gets a value indicating whether elements stored to have limited inactivity time. /// /// /// if the has a fixed total size of elements; @@ -1449,7 +1449,7 @@ namespace OpenSim.Framework /// or methods in , then element is automatically removed from /// the cache. Depending on implementation of the , some of the elements may /// stay longer in cache. - /// + /// /// /// /// @@ -1503,7 +1503,7 @@ namespace OpenSim.Framework /// /// /// - /// + /// public long MaxElementSize { get { return m_maxElementSize; } @@ -1517,7 +1517,7 @@ namespace OpenSim.Framework /// /// Maximal allowed total size for elements stored to . /// - /// + /// /// /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. /// @@ -1562,10 +1562,10 @@ namespace OpenSim.Framework /// When adding an new element to that is limiting total size of elements, /// will remove less recently used elements until it can fit an new element. /// - /// + /// /// /// - /// + /// /// /// public long Size @@ -1576,9 +1576,9 @@ namespace OpenSim.Framework /// /// Gets an object that can be used to synchronize access to the . /// - /// + /// /// An object that can be used to synchronize access to the . - /// + /// /// /// /// To get synchronized (thread safe) access to , use @@ -1630,7 +1630,7 @@ namespace OpenSim.Framework /// /// /// Depending on implementation, some of expired elements - /// may stay longer than in the cache. + /// may stay longer than in the cache. /// /// /// @@ -1810,7 +1810,7 @@ namespace OpenSim.Framework /// /// /// if the contains an element with - /// the specified key; otherwise, . + /// the specified key; otherwise, . /// /// /// The key whose to get. diff --git a/OpenSim/Framework/CnmSynchronizedCache.cs b/OpenSim/Framework/CnmSynchronizedCache.cs index c09900e..2bafbe9 100644 --- a/OpenSim/Framework/CnmSynchronizedCache.cs +++ b/OpenSim/Framework/CnmSynchronizedCache.cs @@ -142,7 +142,7 @@ namespace OpenSim.Framework /// /// /// The enumerator has reach end of collection or is not called. - /// + /// public KeyValuePair Current { get { return m_enumerator.Current; } @@ -327,10 +327,10 @@ namespace OpenSim.Framework /// When adding an new element to that is limiting total size of elements, /// will remove less recently used elements until it can fit an new element. /// - /// + /// /// /// - /// + /// /// /// public bool IsSizeLimited @@ -366,7 +366,7 @@ namespace OpenSim.Framework } /// - /// Gets a value indicating whether elements stored to have limited inactivity time. + /// Gets a value indicating whether elements stored to have limited inactivity time. /// /// /// if the has a fixed total size of elements; @@ -377,7 +377,7 @@ namespace OpenSim.Framework /// or methods in , then element is automatically removed from /// the cache. Depending on implementation of the , some of the elements may /// stay longer in cache. - /// + /// /// /// /// @@ -440,7 +440,7 @@ namespace OpenSim.Framework /// /// /// - /// + /// public long MaxElementSize { get @@ -458,7 +458,7 @@ namespace OpenSim.Framework /// /// Maximal allowed total size for elements stored to . /// - /// + /// /// /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. /// @@ -507,10 +507,10 @@ namespace OpenSim.Framework /// When adding an new element to that is limiting total size of elements, /// will remove less recently used elements until it can fit an new element. /// - /// + /// /// /// - /// + /// /// /// public long Size @@ -527,9 +527,9 @@ namespace OpenSim.Framework /// /// Gets an object that can be used to synchronize access to the . /// - /// + /// /// An object that can be used to synchronize access to the . - /// + /// /// /// /// To get synchronized (thread safe) access to , use @@ -584,7 +584,7 @@ namespace OpenSim.Framework /// /// /// Depending on implementation, some of expired elements - /// may stay longer than in the cache. + /// may stay longer than in the cache. /// /// /// @@ -704,7 +704,7 @@ namespace OpenSim.Framework /// /// /// if the contains an element with - /// the specified key; otherwise, . + /// the specified key; otherwise, . /// /// /// The key whose to get. diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 238810a..8c39ca8 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -55,7 +55,7 @@ namespace OpenSim.Framework.Communications.Cache /// Stores user profile and inventory data received from backend services for a particular user. /// public class CachedUserInfo - { + { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); //// @@ -190,7 +190,7 @@ namespace OpenSim.Framework.Communications.Cache resolvedFolders.Add(folder); resolvedFolderDictionary[folder.ID] = folder; parentFolder.AddChildFolder(folder); - } + } } } // foreach (folder in pendingCategorizationFolders[parentFolder.ID]) @@ -422,7 +422,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// FIXME: We call add new inventory folder because in the data layer, we happen to use an SQL REPLACE /// so this will work to rename an existing folder. Needless to say, to rely on this is very confusing, - /// and needs to be changed. + /// and needs to be changed. /// /// /// @@ -500,7 +500,7 @@ namespace OpenSim.Framework.Communications.Cache InventoryFolderImpl oldParentFolder = RootFolder.FindFolder(folder.ParentID); if (oldParentFolder != null) - { + { oldParentFolder.RemoveChildFolder(folderID); parentFolder.AddChildFolder(folder); } diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 7f1c7e9..2a1da50 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -60,7 +60,7 @@ namespace OpenSim.Framework.Communications.Cache /// User profiles indexed by name /// private readonly Dictionary m_userProfilesByName - = new Dictionary(); + = new Dictionary(); /// /// The root library folder. @@ -125,26 +125,26 @@ namespace OpenSim.Framework.Communications.Cache /// /// If the user isn't in cache then the user is requested from the profile service. /// - /// null if no user details are found + /// null if no user details are found public CachedUserInfo GetUserDetails(string fname, string lname) { lock (m_userProfilesByName) - { + { CachedUserInfo userInfo; - if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo)) + if (m_userProfilesByName.TryGetValue(string.Format(NAME_FORMAT, fname, lname), out userInfo)) { return userInfo; - } + } else - { + { UserProfileData userProfile = m_commsManager.UserService.GetUserProfile(fname, lname); if (userProfile != null) - return AddToCaches(userProfile); + return AddToCaches(userProfile); else return null; - } + } } } @@ -185,20 +185,20 @@ namespace OpenSim.Framework.Communications.Cache // probably by making sure that the update doesn't use the UserCacheInfo.UserProfile directly (possibly via // returning a read only class from the cache). // public bool StoreProfile(UserProfileData userProfile) -// { +// { // lock (m_userProfilesById) -// { +// { // CachedUserInfo userInfo = GetUserDetails(userProfile.ID); -// +// // if (userInfo != null) // { -// userInfo.m_userProfile = userProfile; +// userInfo.m_userProfile = userProfile; // m_commsManager.UserService.UpdateUserProfile(userProfile); -// +// // return true; // } // } -// +// // return false; // } @@ -220,7 +220,7 @@ namespace OpenSim.Framework.Communications.Cache } } - return createdUserInfo; + return createdUserInfo; } /// @@ -234,7 +234,7 @@ namespace OpenSim.Framework.Communications.Cache { if (m_userProfilesById.ContainsKey(userId)) { - CachedUserInfo userInfo = m_userProfilesById[userId]; + CachedUserInfo userInfo = m_userProfilesById[userId]; m_userProfilesById.Remove(userId); lock (m_userProfilesByName) @@ -244,7 +244,7 @@ namespace OpenSim.Framework.Communications.Cache return true; } - } + } return false; } diff --git a/OpenSim/Framework/Communications/CommunicationsManager.cs b/OpenSim/Framework/Communications/CommunicationsManager.cs index 9f377a6..2410f31 100644 --- a/OpenSim/Framework/Communications/CommunicationsManager.cs +++ b/OpenSim/Framework/Communications/CommunicationsManager.cs @@ -90,8 +90,8 @@ namespace OpenSim.Framework.Communications public IUserAdminService UserAdminService { get { return m_userAdminService; } - } - protected IUserAdminService m_userAdminService; + } + protected IUserAdminService m_userAdminService; /// /// Constructor diff --git a/OpenSim/Framework/Communications/IAvatarService.cs b/OpenSim/Framework/Communications/IAvatarService.cs index 4afc58f..760aa62 100644 --- a/OpenSim/Framework/Communications/IAvatarService.cs +++ b/OpenSim/Framework/Communications/IAvatarService.cs @@ -42,7 +42,7 @@ namespace OpenSim.Framework.Communications /// Update avatar appearance information /// /// - /// + /// void UpdateUserAppearance(UUID user, AvatarAppearance appearance); } } diff --git a/OpenSim/Framework/Communications/IUserAdminService.cs b/OpenSim/Framework/Communications/IUserAdminService.cs index 15b989d..423b49b 100644 --- a/OpenSim/Framework/Communications/IUserAdminService.cs +++ b/OpenSim/Framework/Communications/IUserAdminService.cs @@ -66,6 +66,6 @@ namespace OpenSim.Framework.Communications /// /// /// true if the update was successful, false otherwise - bool ResetUserPassword(string firstName, string lastName, string newPassword); + bool ResetUserPassword(string firstName, string lastName, string newPassword); } } diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 15c5a96..2872e5e 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -98,7 +98,7 @@ namespace OpenSim.Framework.Communications /// The agent that who's friends list is being updated /// The agent that is getting or loosing permissions /// A uint bit vector for set perms that the friend being added has; 0 = none, 1=This friend can see when they sign on, 2 = map, 4 edit objects - void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); + void UpdateUserFriendPerms(UUID friendlistowner, UUID friend, uint perms); /// /// Logs off a user on the user server @@ -130,7 +130,7 @@ namespace OpenSim.Framework.Communications /// /// A List of FriendListItems that contains info about the user's friends. /// Always returns a list even if the user has no friends - /// + /// List GetUserFriendList(UUID friendlistowner); // This probably shouldn't be here, it belongs to IAuthentication @@ -149,7 +149,7 @@ namespace OpenSim.Framework.Communications /// /// /// - bool AuthenticateUserByPassword(UUID userID, string password); + bool AuthenticateUserByPassword(UUID userID, string password); // Temporary Hack until we move everything to the new service model void SetInventoryService(IInventoryService invService); diff --git a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs index 98d0e0f..e96c5e8 100644 --- a/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs +++ b/OpenSim/Framework/Communications/Osp/OspInventoryWrapperPlugin.cs @@ -47,7 +47,7 @@ namespace OpenSim.Framework.Communications.Osp public string Name { get { return "OspInventoryWrapperPlugin"; } } public string Version { get { return "0.1"; } } - public void Initialise() {} + public void Initialise() {} public void Initialise(string connect) {} public void Dispose() {} @@ -80,9 +80,9 @@ namespace OpenSim.Framework.Communications.Osp } protected InventoryItemBase PostProcessItem(InventoryItemBase item) - { + { item.CreatorIdAsUuid = OspResolver.ResolveOspa(item.CreatorId, m_commsManager); - return item; + return item; } public List getFolderHierarchy(UUID parentID) { return m_wrappedPlugin.getFolderHierarchy(parentID); } diff --git a/OpenSim/Framework/Communications/Osp/OspResolver.cs b/OpenSim/Framework/Communications/Osp/OspResolver.cs index e98317a..32f0efc 100644 --- a/OpenSim/Framework/Communications/Osp/OspResolver.cs +++ b/OpenSim/Framework/Communications/Osp/OspResolver.cs @@ -33,13 +33,13 @@ using OpenSim.Framework; using OpenSim.Framework.Communications.Cache; namespace OpenSim.Framework.Communications.Osp -{ +{ /// /// Resolves OpenSim Profile Anchors (OSPA). An OSPA is a string used to provide information for /// identifying user profiles or supplying a simple name if no profile is available. /// public class OspResolver - { + { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public const string OSPA_PREFIX = "ospa:"; @@ -73,7 +73,7 @@ namespace OpenSim.Framework.Communications.Osp { return OSPA_PREFIX + OSPA_NAME_KEY + OSPA_PAIR_SEPARATOR + firstName + OSPA_NAME_VALUE_SEPARATOR + lastName; - } + } /// /// Resolve an osp string into the most suitable internal OpenSim identifier. @@ -89,13 +89,13 @@ namespace OpenSim.Framework.Communications.Osp /// is returned. /// public static UUID ResolveOspa(string ospa, CommunicationsManager commsManager) - { + { if (!ospa.StartsWith(OSPA_PREFIX)) return UUID.Zero; m_log.DebugFormat("[OSP RESOLVER]: Resolving {0}", ospa); - string ospaMeat = ospa.Substring(OSPA_PREFIX.Length); + string ospaMeat = ospa.Substring(OSPA_PREFIX.Length); string[] ospaTuples = ospaMeat.Split(OSPA_TUPLE_SEPARATOR_ARRAY); foreach (string tuple in ospaTuples) @@ -162,7 +162,7 @@ namespace OpenSim.Framework.Communications.Osp tempUserProfile.ID = HashName(tempUserProfile.Name); m_log.DebugFormat( - "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID); + "[OSP RESOLVER]: Adding temporary user profile for {0} {1}", tempUserProfile.Name, tempUserProfile.ID); commsManager.UserService.AddTemporaryUserProfile(tempUserProfile); return tempUserProfile.ID; diff --git a/OpenSim/Framework/Communications/Services/LoginService.cs b/OpenSim/Framework/Communications/Services/LoginService.cs index a6cd918..922cd49 100644 --- a/OpenSim/Framework/Communications/Services/LoginService.cs +++ b/OpenSim/Framework/Communications/Services/LoginService.cs @@ -1072,7 +1072,7 @@ namespace OpenSim.Framework.Communications.Services /// /// /// - /// true if the region was successfully contacted, false otherwise + /// true if the region was successfully contacted, false otherwise protected abstract bool PrepareLoginToRegion( RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint client); diff --git a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs index 43f1440..d56211f 100644 --- a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs +++ b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs @@ -33,7 +33,7 @@ using OpenMetaverse; using OpenSim.Data; namespace OpenSim.Framework.Communications -{ +{ /// /// Plugin for managing temporary user profiles. /// @@ -45,7 +45,7 @@ namespace OpenSim.Framework.Communications public string Name { get { return "TemporaryUserProfilePlugin"; } } public string Version { get { return "0.1"; } } - public void Initialise() {} + public void Initialise() {} public void Initialise(string connect) {} public void Dispose() {} diff --git a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs index a757282..caaebd7 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/AssetCacheTests.cs @@ -152,8 +152,8 @@ namespace OpenSim.Framework.Communications.Tests public virtual bool AuthenticateUserByPassword(UUID userID, string password) { - throw new NotImplementedException(); - } + throw new NotImplementedException(); + } } } } diff --git a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs index e5d8895..830c877 100644 --- a/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/Cache/UserProfileCacheServiceTests.cs @@ -133,7 +133,7 @@ namespace OpenSim.Framework.Communications.Tests timedOut = true; lock (this) - { + { UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); Monitor.Wait(this, 60000); } @@ -150,7 +150,7 @@ namespace OpenSim.Framework.Communications.Tests CachedUserInfo userInfo; lock (this) - { + { userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); Monitor.Wait(this, 60000); } @@ -171,7 +171,7 @@ namespace OpenSim.Framework.Communications.Tests CachedUserInfo userInfo; lock (this) - { + { userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); Monitor.Wait(this, 60000); } @@ -206,7 +206,7 @@ namespace OpenSim.Framework.Communications.Tests CachedUserInfo userInfo; lock (this) - { + { userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); Monitor.Wait(this, 60000); } @@ -271,7 +271,7 @@ namespace OpenSim.Framework.Communications.Tests CachedUserInfo userInfo; lock (this) - { + { userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); Monitor.Wait(this, 60000); } @@ -311,7 +311,7 @@ namespace OpenSim.Framework.Communications.Tests CachedUserInfo userInfo; lock (this) - { + { userInfo = UserProfileTestUtils.CreateUserWithInventory(myScene.CommsManager, InventoryReceived); Monitor.Wait(this, 60000); } diff --git a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs index 0a9d2ae..e891d9c 100644 --- a/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs +++ b/OpenSim/Framework/Communications/Tests/LoginServiceTests.cs @@ -318,7 +318,7 @@ namespace OpenSim.Framework.Communications.Tests { TestHelper.InMethod(); - //Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()"); + //Console.WriteLine("Starting T023_TestAuthenticatedLoginAlreadyLoggedIn()"); //log4net.Config.XmlConfigurator.Configure(); string error_already_logged = "You appear to be already logged in. " + diff --git a/OpenSim/Framework/Communications/UserManagerBase.cs b/OpenSim/Framework/Communications/UserManagerBase.cs index 86238b1..bf4f331 100644 --- a/OpenSim/Framework/Communications/UserManagerBase.cs +++ b/OpenSim/Framework/Communications/UserManagerBase.cs @@ -94,9 +94,9 @@ namespace OpenSim.Framework.Communications public void AddPlugin(string provider, string connect) { m_plugins.AddRange(DataPluginFactory.LoadDataPlugins(provider, connect)); - } + } - #region UserProfile + #region UserProfile public virtual void AddTemporaryUserProfile(UserProfileData userProfile) { @@ -924,8 +924,8 @@ namespace OpenSim.Framework.Communications if (md5PasswordHash == userProfile.PasswordHash) return true; else - return false; - } + return false; + } #endregion } diff --git a/OpenSim/Framework/Console/CommandConsole.cs b/OpenSim/Framework/Console/CommandConsole.cs index 06136ff..9671bc2 100644 --- a/OpenSim/Framework/Console/CommandConsole.cs +++ b/OpenSim/Framework/Console/CommandConsole.cs @@ -88,7 +88,7 @@ namespace OpenSim.Framework.Console /// Parsed parts of the help string. If empty then general help is returned. /// public List GetHelp(string[] cmd) - { + { List help = new List(); List helpParts = new List(cmd); @@ -115,7 +115,7 @@ namespace OpenSim.Framework.Console /// /// private List CollectHelp(List helpParts) - { + { string originalHelpRequest = string.Join(" ", helpParts.ToArray()); List help = new List(); @@ -132,7 +132,7 @@ namespace OpenSim.Framework.Console if (dict[helpPart] is Dictionary) dict = (Dictionary)dict[helpPart]; - helpParts.RemoveAt(0); + helpParts.RemoveAt(0); } // There was a command for the given help string @@ -149,7 +149,7 @@ namespace OpenSim.Framework.Console } return help; - } + } private List CollectHelp(Dictionary dict) { @@ -180,7 +180,7 @@ namespace OpenSim.Framework.Console /// /// public void AddCommand(string module, bool shared, string command, - string help, string longhelp, CommandDelegate fn) + string help, string longhelp, CommandDelegate fn) { AddCommand(module, shared, command, help, longhelp, String.Empty, fn); diff --git a/OpenSim/Framework/GridConfig.cs b/OpenSim/Framework/GridConfig.cs index 9aa5d03..3a43a14 100644 --- a/OpenSim/Framework/GridConfig.cs +++ b/OpenSim/Framework/GridConfig.cs @@ -90,13 +90,13 @@ namespace OpenSim.Framework m_configMember.addConfigurationOption("allow_forceful_banlines", ConfigurationOption.ConfigurationTypes.TYPE_STRING, - "Allow Forceful Banlines", "TRUE", true); + "Allow Forceful Banlines", "TRUE", true); m_configMember.addConfigurationOption("allow_region_registration", ConfigurationOption.ConfigurationTypes.TYPE_BOOLEAN, "Allow regions to register immediately upon grid server startup? true/false", "True", - false); + false); m_configMember.addConfigurationOption("console_user", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "Remote console access user name [Default: disabled]", "", false); @@ -147,7 +147,7 @@ namespace OpenSim.Framework break; case "allow_region_registration": AllowRegionRegistration = (bool)configuration_result; - break; + break; case "console_user": ConsoleUser = (string)configuration_result; break; diff --git a/OpenSim/Framework/IAssetCache.cs b/OpenSim/Framework/IAssetCache.cs index 751fdd5..654180d 100644 --- a/OpenSim/Framework/IAssetCache.cs +++ b/OpenSim/Framework/IAssetCache.cs @@ -34,23 +34,23 @@ namespace OpenSim.Framework /// /// Interface to the local asset cache. This is the mechanism through which assets can be added and requested. - /// + /// public interface IAssetCache : IPlugin { /// /// The 'server' from which assets can be requested and to which assets are persisted. - /// + /// - void Initialise(ConfigSettings cs); + void Initialise(ConfigSettings cs); /// /// Report statistical data to the log. - /// + /// void ShowState(); /// /// Clear the asset cache. - /// + /// void Clear(); /// @@ -58,7 +58,7 @@ namespace OpenSim.Framework /// /// /// - /// true if the asset was in the cache, false if it was not + /// true if the asset was in the cache, false if it was not bool TryGetCachedAsset(UUID assetID, out AssetBase asset); /// @@ -69,7 +69,7 @@ namespace OpenSim.Framework /// /// A callback invoked when the asset has either been found or not found. /// If the asset was found this is called with the asset UUID and the asset data - /// If the asset was not found this is still called with the asset UUID but with a null asset data reference + /// If the asset was not found this is still called with the asset UUID but with a null asset data reference void GetAsset(UUID assetID, AssetRequestCallback callback, bool isTexture); /// @@ -84,13 +84,13 @@ namespace OpenSim.Framework /// /// /// - /// null if the asset could not be retrieved + /// null if the asset could not be retrieved AssetBase GetAsset(UUID assetID, bool isTexture); /// /// Add an asset to both the persistent store and the cache. /// - /// + /// void AddAsset(AssetBase asset); /// @@ -100,14 +100,14 @@ namespace OpenSim.Framework /// of the asset cache. This is needed because the osdynamic /// texture code grows the asset cache without bounds. The /// real solution here is a much better cache archicture, but - /// this is a stop gap measure until we have such a thing. + /// this is a stop gap measure until we have such a thing. void ExpireAsset(UUID assetID); /// /// Handle an asset request from the client. The result will be sent back asynchronously. /// /// - /// + /// void AddAssetRequest(IClientAPI userInfo, TransferRequestPacket transferRequest); } diff --git a/OpenSim/Framework/IClientAPI.cs b/OpenSim/Framework/IClientAPI.cs index 444adf9..4bc35e6 100644 --- a/OpenSim/Framework/IClientAPI.cs +++ b/OpenSim/Framework/IClientAPI.cs @@ -810,7 +810,7 @@ namespace OpenSim.Framework /// void Start(); - void Stop(); + void Stop(); // void ActivateGesture(UUID assetId, UUID gestureId); @@ -824,7 +824,7 @@ namespace OpenSim.Framework /// /// The id of the agent associated with the appearance /// - /// + /// void SendAppearance(UUID agentID, byte[] visualParams, byte[] textureEntry); void SendStartPingCheck(byte seq); @@ -833,7 +833,7 @@ namespace OpenSim.Framework /// Tell the client that an object has been deleted /// /// - /// + /// void SendKillObject(ulong regionHandle, uint localID); void SendAnimations(UUID[] animID, int[] seqs, UUID sourceAgentId, UUID[] objectIDs); diff --git a/OpenSim/Framework/ICnmCache.cs b/OpenSim/Framework/ICnmCache.cs index a1ac322..27b9c56 100644 --- a/OpenSim/Framework/ICnmCache.cs +++ b/OpenSim/Framework/ICnmCache.cs @@ -180,16 +180,16 @@ namespace OpenSim.Framework /// When adding an new element to that is limiting total size of elements, /// will remove less recently used elements until it can fit an new element. /// - /// + /// /// /// - /// + /// /// /// bool IsSizeLimited { get; } /// - /// Gets a value indicating whether elements stored to have limited inactivity time. + /// Gets a value indicating whether elements stored to have limited inactivity time. /// /// /// if the has a fixed total size of elements; @@ -200,7 +200,7 @@ namespace OpenSim.Framework /// or methods in , then element is automatically removed from /// the cache. Depending on implementation of the , some of the elements may /// stay longer in cache. - /// + /// /// /// /// @@ -237,7 +237,7 @@ namespace OpenSim.Framework /// /// /// - /// + /// long MaxElementSize { get; } /// @@ -246,7 +246,7 @@ namespace OpenSim.Framework /// /// Maximal allowed total size for elements stored to . /// - /// + /// /// /// Normally size is total bytes used by elements in the cache. But it can be any other suitable unit of measure. /// @@ -278,10 +278,10 @@ namespace OpenSim.Framework /// When adding an new element to that is limiting total size of elements, /// will remove less recently used elements until it can fit an new element. /// - /// + /// /// /// - /// + /// /// /// long Size { get; } @@ -289,9 +289,9 @@ namespace OpenSim.Framework /// /// Gets an object that can be used to synchronize access to the . /// - /// + /// /// An object that can be used to synchronize access to the . - /// + /// /// /// /// To get synchronized (thread safe) access to , use @@ -322,7 +322,7 @@ namespace OpenSim.Framework /// /// /// Depending on implementation, some of expired elements - /// may stay longer than in the cache. + /// may stay longer than in the cache. /// /// /// @@ -418,7 +418,7 @@ namespace OpenSim.Framework /// /// /// if the contains an element with - /// the specified key; otherwise, . + /// the specified key; otherwise, . /// /// /// The key whose to get. diff --git a/OpenSim/Framework/IScene.cs b/OpenSim/Framework/IScene.cs index d61e08c..489653f 100644 --- a/OpenSim/Framework/IScene.cs +++ b/OpenSim/Framework/IScene.cs @@ -55,7 +55,7 @@ namespace OpenSim.Framework GodTakeCopy = 5, Delete = 6, Return = 9 - }; + }; public interface IScene { diff --git a/OpenSim/Framework/ISceneObject.cs b/OpenSim/Framework/ISceneObject.cs index db19527..4fc3e01 100644 --- a/OpenSim/Framework/ISceneObject.cs +++ b/OpenSim/Framework/ISceneObject.cs @@ -32,7 +32,7 @@ namespace OpenSim.Framework { public interface ISceneObject { - UUID UUID { get; } + UUID UUID { get; } ISceneObject CloneForNewScene(); string ToXml2(); string ExtraToXmlString(); diff --git a/OpenSim/Framework/InventoryFolderBase.cs b/OpenSim/Framework/InventoryFolderBase.cs index 3eef6f6..a12183c 100644 --- a/OpenSim/Framework/InventoryFolderBase.cs +++ b/OpenSim/Framework/InventoryFolderBase.cs @@ -89,7 +89,7 @@ namespace OpenSim.Framework ID = id; Name = name; Owner = owner; - ParentID = parent; + ParentID = parent; } public InventoryFolderBase(UUID id, string name, UUID owner, short type, UUID parent, ushort version) diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs index 00462f9..6b432f3 100644 --- a/OpenSim/Framework/InventoryFolderImpl.cs +++ b/OpenSim/Framework/InventoryFolderImpl.cs @@ -304,7 +304,7 @@ namespace OpenSim.Framework /// /// Find a folder given a PATH_DELIMITER delimited path starting from this folder - /// + /// /// /// This method does not handle paths that contain multiple delimitors /// diff --git a/OpenSim/Framework/InventoryItemBase.cs b/OpenSim/Framework/InventoryItemBase.cs index 7150c82..aeb01e2 100644 --- a/OpenSim/Framework/InventoryItemBase.cs +++ b/OpenSim/Framework/InventoryItemBase.cs @@ -34,10 +34,10 @@ namespace OpenSim.Framework /// Inventory Item - contains all the properties associated with an individual inventory piece. /// public class InventoryItemBase : InventoryNodeBase, ICloneable - { + { /// /// The inventory type of the item. This is slightly different from the asset type in some situations. - /// + /// public int InvType { get @@ -54,7 +54,7 @@ namespace OpenSim.Framework /// /// The folder this item is contained in - /// + /// public UUID Folder { get @@ -71,7 +71,7 @@ namespace OpenSim.Framework /// /// The creator of this item - /// + /// public string CreatorId { get @@ -114,7 +114,7 @@ namespace OpenSim.Framework { m_creatorIdAsUuid = value; } - } + } protected UUID m_creatorIdAsUuid = UUID.Zero; /// @@ -130,13 +130,13 @@ namespace OpenSim.Framework set { m_description = value; - } + } } protected string m_description = String.Empty; /// /// - /// + /// public uint NextPermissions { get @@ -153,7 +153,7 @@ namespace OpenSim.Framework /// /// A mask containing permissions for the current owner (cannot be enforced) - /// + /// public uint CurrentPermissions { get @@ -170,7 +170,7 @@ namespace OpenSim.Framework /// /// - /// + /// public uint BasePermissions { get @@ -187,7 +187,7 @@ namespace OpenSim.Framework /// /// - /// + /// public uint EveryOnePermissions { get @@ -204,7 +204,7 @@ namespace OpenSim.Framework /// /// - /// + /// public uint GroupPermissions { get @@ -221,7 +221,7 @@ namespace OpenSim.Framework /// /// This is an enumerated value determining the type of asset (eg Notecard, Sound, Object, etc) - /// + /// public int AssetType { get @@ -238,7 +238,7 @@ namespace OpenSim.Framework /// /// The UUID of the associated asset on the asset server - /// + /// public UUID AssetID { get @@ -255,7 +255,7 @@ namespace OpenSim.Framework /// /// - /// + /// public UUID GroupID { get @@ -272,13 +272,13 @@ namespace OpenSim.Framework /// /// - /// + /// public bool GroupOwned { get { return m_groupOwned; - } + } set { @@ -289,7 +289,7 @@ namespace OpenSim.Framework /// /// - /// + /// public int SalePrice { get @@ -306,7 +306,7 @@ namespace OpenSim.Framework /// /// - /// + /// public byte SaleType { get @@ -323,7 +323,7 @@ namespace OpenSim.Framework /// /// - /// + /// public uint Flags { get @@ -340,7 +340,7 @@ namespace OpenSim.Framework /// /// - /// + /// public int CreationDate { get diff --git a/OpenSim/Framework/InventoryNodeBase.cs b/OpenSim/Framework/InventoryNodeBase.cs index f49cce1..31c3fd1 100644 --- a/OpenSim/Framework/InventoryNodeBase.cs +++ b/OpenSim/Framework/InventoryNodeBase.cs @@ -31,12 +31,12 @@ namespace OpenSim.Framework { /// /// Common base class for inventory nodes of different types (files, folders, etc.) - /// + /// public class InventoryNodeBase - { + { /// /// The name of the node (64 characters or less) - /// + /// public virtual string Name { get { return m_name; } @@ -51,17 +51,17 @@ namespace OpenSim.Framework { get { return m_id; } set { m_id = value; } - } + } private UUID m_id; /// /// The agent who's inventory this is contained by - /// + /// public virtual UUID Owner { get { return m_owner; } set { m_owner = value; } } - private UUID m_owner; + private UUID m_owner; } } diff --git a/OpenSim/Framework/NetworkServersInfo.cs b/OpenSim/Framework/NetworkServersInfo.cs index 7e66742..f720222 100644 --- a/OpenSim/Framework/NetworkServersInfo.cs +++ b/OpenSim/Framework/NetworkServersInfo.cs @@ -32,7 +32,7 @@ namespace OpenSim.Framework { public class NetworkServersInfo { - public string AssetSendKey = String.Empty; + public string AssetSendKey = String.Empty; public string AssetURL = "http://127.0.0.1:" + ConfigSettings.DefaultAssetServerHttpPort.ToString() + "/"; public string GridRecvKey = String.Empty; diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index cee1d4b..d3a5357 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs @@ -1040,7 +1040,7 @@ namespace OpenSim.Framework public static RegionInfo Create(UUID regionID, string regionName, uint regX, uint regY, string externalHostName, uint httpPort, uint simPort, uint remotingPort, string serverURI) { RegionInfo regionInfo; - IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort); + IPEndPoint neighbourInternalEndPoint = new IPEndPoint(Util.GetHostFromDNS(externalHostName), (int)simPort); regionInfo = new RegionInfo(regX, regY, neighbourInternalEndPoint, externalHostName); regionInfo.RemotingPort = remotingPort; regionInfo.RemotingAddress = externalHostName; diff --git a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs index 274f41f..b5901e1 100644 --- a/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs +++ b/OpenSim/Framework/Serialization/External/RegionSettingsSerializer.cs @@ -158,7 +158,7 @@ namespace OpenSim.Framework.Serialization.External settings.Elevation2NE = double.Parse(xtr.ReadElementContentAsString()); break; } - } + } xtr.ReadEndElement(); xtr.ReadStartElement("Terrain"); @@ -200,8 +200,8 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteStartElement("RegionSettings"); - xtw.WriteStartElement("General"); - xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString()); + xtw.WriteStartElement("General"); + xtw.WriteElementString("AllowDamage", settings.AllowDamage.ToString()); xtw.WriteElementString("AllowLandResell", settings.AllowLandResell.ToString()); xtw.WriteElementString("AllowLandJoinDivide", settings.AllowLandJoinDivide.ToString()); xtw.WriteElementString("BlockFly", settings.BlockFly.ToString()); diff --git a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs index eb77e65..fb269b7 100644 --- a/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs +++ b/OpenSim/Framework/Serialization/External/UserProfileSerializer.cs @@ -36,7 +36,7 @@ namespace OpenSim.Framework.Serialization.External /// Serialize and deserialize region settings as an external format. /// public class UserProfileSerializer - { + { public const int MAJOR_VERSION = 0; public const int MINOR_VERSION = 1; @@ -65,6 +65,6 @@ namespace OpenSim.Framework.Serialization.External sw.Close(); return sw.ToString(); - } + } } } \ No newline at end of file diff --git a/OpenSim/Framework/Servers/BaseOpenSimServer.cs b/OpenSim/Framework/Servers/BaseOpenSimServer.cs index 7a244ff..632b551 100644 --- a/OpenSim/Framework/Servers/BaseOpenSimServer.cs +++ b/OpenSim/Framework/Servers/BaseOpenSimServer.cs @@ -158,7 +158,7 @@ namespace OpenSim.Framework.Servers m_consoleAppender.Threshold = Level.All; Notice(String.Format("Console log level is {0}", m_consoleAppender.Threshold)); - } + } m_console.Commands.AddCommand("base", false, "quit", "quit", @@ -196,7 +196,7 @@ namespace OpenSim.Framework.Servers /// /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing - /// + /// public virtual void ShutdownSpecific() {} /// @@ -286,7 +286,7 @@ namespace OpenSim.Framework.Servers /// public virtual void Startup() { - m_log.Info("[STARTUP]: Beginning startup processing"); + m_log.Info("[STARTUP]: Beginning startup processing"); EnhanceVersionInformation(); @@ -301,7 +301,7 @@ namespace OpenSim.Framework.Servers /// /// Should be overriden and referenced by descendents if they need to perform extra shutdown processing - /// + /// public virtual void Shutdown() { ShutdownSpecific(); @@ -367,7 +367,7 @@ namespace OpenSim.Framework.Servers } public virtual void HandleShow(string module, string[] cmd) - { + { List args = new List(cmd); args.RemoveAt(0); @@ -375,7 +375,7 @@ namespace OpenSim.Framework.Servers string[] showParams = args.ToArray(); switch (showParams[0]) - { + { case "info": Notice("Version: " + m_version); Notice("Startup directory: " + m_startupDirectory); diff --git a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs index fe69ad3..5afa110 100644 --- a/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs +++ b/OpenSim/Framework/Servers/HttpServer/AsynchronousRestObjectRequester.cs @@ -168,7 +168,7 @@ namespace OpenSim.Framework.Servers.HttpServer "[ASYNC REQUEST]: Request {0} {1} callback failed with exception {2}", verb, requestUrl, e); } - }, null); + }, null); } } } diff --git a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs index 01990fa..6c63c6c 100644 --- a/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/BaseHttpServer.cs @@ -110,7 +110,7 @@ namespace OpenSim.Framework.Servers.HttpServer public BaseHttpServer(uint port, bool ssl) : this (port) { - m_ssl = ssl; + m_ssl = ssl; } public BaseHttpServer(uint port, bool ssl, uint sslport, string CN) : this (port, ssl) @@ -156,7 +156,7 @@ namespace OpenSim.Framework.Servers.HttpServer lock (m_rpcHandlers) { m_rpcHandlers[method] = handler; - m_rpcHandlersKeepAlive[method] = keepAlive; // default + m_rpcHandlersKeepAlive[method] = keepAlive; // default } return true; @@ -323,7 +323,7 @@ namespace OpenSim.Framework.Servers.HttpServer OSHttpRequest request = objstate.oreq; OSHttpResponse resp = objstate.oresp; - HandleRequest(request,resp); + HandleRequest(request,resp); } public virtual void HandleRequest(OSHttpRequest request, OSHttpResponse response) @@ -712,7 +712,7 @@ namespace OpenSim.Framework.Servers.HttpServer lock (m_rpcHandlers) { methodWasFound = m_rpcHandlers.TryGetValue(methodName, out method); - } + } if (methodWasFound) { @@ -931,7 +931,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (IOException e) { - m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e); + m_log.DebugFormat("[BASE HTTP SERVER] LLSD IOException {0}.", e); } catch (SocketException e) { @@ -1368,7 +1368,7 @@ namespace OpenSim.Framework.Servers.HttpServer bestMatch = pattern; } } - } + } if (String.IsNullOrEmpty(bestMatch)) { @@ -1480,7 +1480,7 @@ namespace OpenSim.Framework.Servers.HttpServer { m_log.Warn("[BASE HTTP SERVER] XmlRpcRequest issue: " + e.Message); } - } + } } public void SendHTML404(OSHttpResponse response, string host) @@ -1589,7 +1589,7 @@ namespace OpenSim.Framework.Servers.HttpServer // if you want more detailed trace information from the HttpServer //m_httpListener2.UseTraceLogs = true; - //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; + //m_httpListener2.DisconnectHandler = httpServerDisconnectMonitor; } else { @@ -1624,7 +1624,7 @@ namespace OpenSim.Framework.Servers.HttpServer } public void httpServerDisconnectMonitor(IHttpClientContext source, SocketError err) - { + { switch (err) { case SocketError.NotSocket: @@ -1635,7 +1635,7 @@ namespace OpenSim.Framework.Servers.HttpServer } public void httpServerException(object source, Exception exception) - { + { m_log.ErrorFormat("[HTTPSERVER]: {0} had an exception {1}", source.ToString(), exception.ToString()); /* if (HTTPDRunning)// && NotSocketErrors > 5) @@ -1662,7 +1662,7 @@ namespace OpenSim.Framework.Servers.HttpServer } catch (NullReferenceException) { - m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer."); + m_log.Warn("[BASEHTTPSERVER]: Null Reference when stopping HttpServer."); } } diff --git a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs index 1bdf4fa..d13408d 100644 --- a/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs +++ b/OpenSim/Framework/Servers/HttpServer/Interfaces/IHttpServer.cs @@ -128,6 +128,6 @@ namespace OpenSim.Framework.Servers.HttpServer string GetHTTP404(string host); - string GetHTTP500(); + string GetHTTP500(); } } diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index d06adb5..8900e46 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -67,7 +67,7 @@ namespace OpenSim /// /// Having this version number allows the grid service to reject connections from regions running a version /// of the code that is too old. - /// + /// /// public readonly static int MajorInterfaceVersion = 6; } diff --git a/OpenSim/Framework/SimStats.cs b/OpenSim/Framework/SimStats.cs index 084964d..3d8f32f 100644 --- a/OpenSim/Framework/SimStats.cs +++ b/OpenSim/Framework/SimStats.cs @@ -35,9 +35,9 @@ namespace OpenSim.Framework /// /// TODO: This looks very much like the OpenMetaverse SimStatsPacket. It should be much more generic stats /// storage. - /// + /// public class SimStats - { + { public uint RegionX { get { return m_regionX; } @@ -47,25 +47,25 @@ namespace OpenSim.Framework public uint RegionY { get { return m_regionY; } - } + } private uint m_regionY; public SimStatsPacket.RegionBlock RegionBlock { get { return m_regionBlock; } - } + } private SimStatsPacket.RegionBlock m_regionBlock; public SimStatsPacket.StatBlock[] StatsBlock { get { return m_statsBlock; } - } + } private SimStatsPacket.StatBlock[] m_statsBlock; public uint RegionFlags { get { return m_regionFlags; } - } + } private uint m_regionFlags; public uint ObjectCapacity @@ -76,7 +76,7 @@ namespace OpenSim.Framework public UUID RegionUUID { - get { return regionUUID;} + get { return regionUUID; } } private UUID regionUUID; diff --git a/OpenSim/Framework/TaskInventoryDictionary.cs b/OpenSim/Framework/TaskInventoryDictionary.cs index 946d7f5..25ae6b0 100644 --- a/OpenSim/Framework/TaskInventoryDictionary.cs +++ b/OpenSim/Framework/TaskInventoryDictionary.cs @@ -38,7 +38,7 @@ namespace OpenSim.Framework /// A dictionary for task inventory. /// /// This class is not thread safe. Callers must synchronize on Dictionary methods or Clone() this object before - /// iterating over it. + /// iterating over it. public class TaskInventoryDictionary : Dictionary, ICloneable, IXmlSerializable { diff --git a/OpenSim/Framework/ThreadTracker.cs b/OpenSim/Framework/ThreadTracker.cs index fa6f0b8..d3a239d 100644 --- a/OpenSim/Framework/ThreadTracker.cs +++ b/OpenSim/Framework/ThreadTracker.cs @@ -57,7 +57,7 @@ namespace OpenSim.Framework } private static void ThreadTrackerThreadLoop() - { + { try { while (true) @@ -70,8 +70,8 @@ namespace OpenSim.Framework { m_log.ErrorFormat( "[THREAD TRACKER]: Thread tracker cleanup thread terminating with exception. Please report this error. Exception is {0}", - e); - } + e); + } } public static void Add(Thread thread) diff --git a/OpenSim/Framework/UserConfig.cs b/OpenSim/Framework/UserConfig.cs index 16f265c..0fa82cf 100644 --- a/OpenSim/Framework/UserConfig.cs +++ b/OpenSim/Framework/UserConfig.cs @@ -133,7 +133,7 @@ namespace OpenSim.Framework m_configMember.addConfigurationOption("library_location", ConfigurationOption.ConfigurationTypes.TYPE_STRING_NOT_EMPTY, "Path to library control file", - string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false); + string.Format(".{0}inventory{0}Libraries.xml", Path.DirectorySeparatorChar), false); m_configMember.addConfigurationOption("database_provider", ConfigurationOption.ConfigurationTypes.TYPE_STRING, "DLL for database provider", "OpenSim.Data.MySQL.dll", false); diff --git a/OpenSim/Framework/UserProfileData.cs b/OpenSim/Framework/UserProfileData.cs index f51a199..413f152 100644 --- a/OpenSim/Framework/UserProfileData.cs +++ b/OpenSim/Framework/UserProfileData.cs @@ -217,7 +217,7 @@ namespace OpenSim.Framework public string Name { get { return String.Format("{0} {1}", m_firstname, m_surname); } - } + } public string Email { diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index a28a617..17fc58c 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs @@ -54,7 +54,7 @@ namespace OpenSim.Framework /// public class Util { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private static uint nextXferID = 5000; private static Random randomClass = new Random(); @@ -136,7 +136,7 @@ namespace OpenSim.Framework float dx = a.X - b.X; float dy = a.Y - b.Y; float dz = a.Z - b.Z; - return (dx*dx + dy*dy + dz*dz) < (amount*amount); + return (dx*dx + dy*dy + dz*dz) < (amount*amount); } /// @@ -975,7 +975,7 @@ namespace OpenSim.Framework else { os = ReadEtcIssue(); - } + } if (os.Length > 45) { -- cgit v1.1 From 606e831ff5337fb5e94dcebf9d6852bd4c434d4b Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Thu, 1 Oct 2009 09:38:36 +0900 Subject: Formatting cleanup. --- OpenSim/Framework/Communications/Cache/CachedUserInfo.cs | 2 +- OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs | 4 ++-- OpenSim/Framework/Communications/IUserService.cs | 2 +- OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs | 2 +- OpenSim/Framework/InventoryFolderImpl.cs | 2 +- OpenSim/Framework/Serialization/External/LandDataSerializer.cs | 2 +- OpenSim/Framework/Servers/VersionInfo.cs | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs index 8c39ca8..aa71536 100644 --- a/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs +++ b/OpenSim/Framework/Communications/Cache/CachedUserInfo.cs @@ -219,7 +219,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// Fetch inventory for this user. /// - /// This has to be executed as a separate step once user information is retreived. + /// This has to be executed as a separate step once user information is retreived. /// This will occur synchronously if the inventory service is in the same process as this class, and /// asynchronously otherwise. public void FetchInventory() diff --git a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs index 2a1da50..9e12d948 100644 --- a/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs +++ b/OpenSim/Framework/Communications/Cache/UserProfileCacheService.cs @@ -123,7 +123,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// Get details of the given user. /// - /// If the user isn't in cache then the user is requested from the profile service. + /// If the user isn't in cache then the user is requested from the profile service. /// /// null if no user details are found public CachedUserInfo GetUserDetails(string fname, string lname) @@ -151,7 +151,7 @@ namespace OpenSim.Framework.Communications.Cache /// /// Get details of the given user. /// - /// If the user isn't in cache then the user is requested from the profile service. + /// If the user isn't in cache then the user is requested from the profile service. /// /// null if no user details are found public CachedUserInfo GetUserDetails(UUID userID) diff --git a/OpenSim/Framework/Communications/IUserService.cs b/OpenSim/Framework/Communications/IUserService.cs index 2872e5e..dfa059d 100644 --- a/OpenSim/Framework/Communications/IUserService.cs +++ b/OpenSim/Framework/Communications/IUserService.cs @@ -128,7 +128,7 @@ namespace OpenSim.Framework.Communications /// /// The agent for whom we're retreiving the friends Data. /// - /// A List of FriendListItems that contains info about the user's friends. + /// A List of FriendListItems that contains info about the user's friends. /// Always returns a list even if the user has no friends /// List GetUserFriendList(UUID friendlistowner); diff --git a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs index d56211f..2413055 100644 --- a/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs +++ b/OpenSim/Framework/Communications/TemporaryUserProfilePlugin.cs @@ -35,7 +35,7 @@ using OpenSim.Data; namespace OpenSim.Framework.Communications { /// - /// Plugin for managing temporary user profiles. + /// Plugin for managing temporary user profiles. /// public class TemporaryUserProfilePlugin : IUserDataPlugin { diff --git a/OpenSim/Framework/InventoryFolderImpl.cs b/OpenSim/Framework/InventoryFolderImpl.cs index 6b432f3..29c7682 100644 --- a/OpenSim/Framework/InventoryFolderImpl.cs +++ b/OpenSim/Framework/InventoryFolderImpl.cs @@ -314,7 +314,7 @@ namespace OpenSim.Framework /// FIXME: Delimitors which occur in names themselves are not currently escapable. /// /// - /// The path to the required folder. + /// The path to the required folder. /// It this is empty or consists only of the PATH_DELIMTER then this folder itself is returned. /// /// null if the folder is not found diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index 6bfae41..4376249 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -155,7 +155,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); xtw.WriteStartElement("ParcelAccessList"); - foreach(ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList) + foreach (ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList) { xtw.WriteStartElement("ParcelAccessEntry"); xtw.WriteElementString("AgentID", pal.AgentID.ToString()); diff --git a/OpenSim/Framework/Servers/VersionInfo.cs b/OpenSim/Framework/Servers/VersionInfo.cs index 8900e46..9f98310 100644 --- a/OpenSim/Framework/Servers/VersionInfo.cs +++ b/OpenSim/Framework/Servers/VersionInfo.cs @@ -56,7 +56,7 @@ namespace OpenSim public const int VERSIONINFO_VERSION_LENGTH = 27; /// - /// This is the external interface version. It is separate from the OpenSimulator project version. + /// This is the external interface version. It is separate from the OpenSimulator project version. /// /// This version number should be /// increased by 1 every time a code change makes the previous OpenSimulator revision incompatible -- cgit v1.1 From 40cf840df26e66fca8ab81d602fd67ff1d2a6afa Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Thu, 1 Oct 2009 09:47:45 +0200 Subject: adding testcase for LandDataSerializer; fixing LandDataSerializer ;-) --- .../Serialization/External/LandDataSerializer.cs | 64 ++++++++-------- .../Serialization/Tests/LandDataSerializerTests.cs | 86 ++++++++++++++++++++++ 2 files changed, 118 insertions(+), 32 deletions(-) create mode 100644 OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index 6bfae41..0d91859 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -132,47 +132,47 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteStartDocument(); xtw.WriteStartElement("LandData"); - xtw.WriteElementString("Area", landData.Area.ToString()); - xtw.WriteElementString("AuctionID", landData.AuctionID.ToString()); - xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); - xtw.WriteElementString("Category", landData.Category.ToString()); - xtw.WriteElementString("ClaimDate", landData.ClaimDate.ToString()); - xtw.WriteElementString("ClaimPrice", landData.ClaimPrice.ToString()); - xtw.WriteElementString("GlobalID", landData.GlobalID.ToString()); - xtw.WriteElementString("GroupID", landData.GroupID.ToString()); - xtw.WriteElementString("IsGroupOwned", landData.IsGroupOwned.ToString()); - xtw.WriteElementString("Bitmap", landData.Bitmap.ToString()); - xtw.WriteElementString("Description", landData.Description); - xtw.WriteElementString("Flags", landData.Flags.ToString()); - xtw.WriteElementString("LandingType", landData.LandingType.ToString()); - xtw.WriteElementString("Name", landData.Name); - xtw.WriteElementString("Status", landData.Status.ToString()); - xtw.WriteElementString("LocalID", landData.LocalID.ToString()); - xtw.WriteElementString("MediaAutoScale", landData.MediaAutoScale.ToString()); - xtw.WriteElementString("MediaID", landData.MediaID.ToString()); - xtw.WriteElementString("MediaURL", landData.MediaURL.ToString()); - xtw.WriteElementString("MusicURL", landData.MusicURL.ToString()); - xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); + xtw.WriteElementString("Area", Convert.ToString(landData.Area)); + xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); + xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); + xtw.WriteElementString("Category", Convert.ToString(landData.Category)); + xtw.WriteElementString("ClaimDate", Convert.ToString(landData.ClaimDate)); + xtw.WriteElementString("ClaimPrice", Convert.ToString(landData.ClaimPrice)); + xtw.WriteElementString("GlobalID", landData.GlobalID.ToString()); + xtw.WriteElementString("GroupID", landData.GroupID.ToString()); + xtw.WriteElementString("IsGroupOwned", Convert.ToString(landData.IsGroupOwned)); + xtw.WriteElementString("Bitmap", Convert.ToBase64String(landData.Bitmap)); + xtw.WriteElementString("Description", landData.Description); + xtw.WriteElementString("Flags", Convert.ToString(landData.Flags)); + xtw.WriteElementString("LandingType", Convert.ToString(landData.LandingType)); + xtw.WriteElementString("Name", landData.Name); + xtw.WriteElementString("Status", Convert.ToString(landData.Status)); + xtw.WriteElementString("LocalID", landData.LocalID.ToString()); + xtw.WriteElementString("MediaAutoScale", Convert.ToString(landData.MediaAutoScale)); + xtw.WriteElementString("MediaID", landData.MediaID.ToString()); + xtw.WriteElementString("MediaURL", landData.MediaURL); + xtw.WriteElementString("MusicURL", landData.MusicURL); + xtw.WriteElementString("OwnerID", landData.OwnerID.ToString()); xtw.WriteStartElement("ParcelAccessList"); foreach(ParcelManager.ParcelAccessEntry pal in landData.ParcelAccessList) { xtw.WriteStartElement("ParcelAccessEntry"); - xtw.WriteElementString("AgentID", pal.AgentID.ToString()); - xtw.WriteElementString("Time", pal.Time.ToString()); - xtw.WriteElementString("AccessList", pal.Flags.ToString()); + xtw.WriteElementString("AgentID", pal.AgentID.ToString()); + xtw.WriteElementString("Time", Convert.ToString(pal.Time)); + xtw.WriteElementString("AccessList", Convert.ToString(pal.Flags)); xtw.WriteEndElement(); } xtw.WriteEndElement(); - xtw.WriteElementString("PassHours", landData.PassHours.ToString()); - xtw.WriteElementString("PassPrice", landData.PassPrice.ToString()); - xtw.WriteElementString("SalePrice", landData.SalePrice.ToString()); - xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString()); - xtw.WriteElementString("UserLocation", landData.UserLocation.ToString()); - xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString()); - xtw.WriteElementString("Dwell", landData.Dwell.ToString()); - xtw.WriteElementString("OtherCleanTime", landData.OtherCleanTime.ToString()); + xtw.WriteElementString("PassHours", Convert.ToString(landData.PassHours)); + xtw.WriteElementString("PassPrice", Convert.ToString(landData.PassPrice)); + xtw.WriteElementString("SalePrice", Convert.ToString(landData.SalePrice)); + xtw.WriteElementString("SnapshotID", landData.SnapshotID.ToString()); + xtw.WriteElementString("UserLocation", landData.UserLocation.ToString()); + xtw.WriteElementString("UserLookAt", landData.UserLookAt.ToString()); + xtw.WriteElementString("Dwell", Convert.ToString(landData.Dwell)); + xtw.WriteElementString("OtherCleanTime", Convert.ToString(landData.OtherCleanTime)); xtw.WriteEndElement(); diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs new file mode 100644 index 0000000..f1881a1 --- /dev/null +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs @@ -0,0 +1,86 @@ +/* + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSimulator Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +using System.Collections.Generic; +using OpenSim.Framework; +using OpenSim.Framework.Serialization.External; +using OpenMetaverse; +using OpenMetaverse.StructuredData; +using NUnit.Framework; + +namespace OpenSim.Framework.Serialization.Tests +{ + [TestFixture] + public class LandDataSerializerTest + { + private LandData land; + + [SetUp] + public void setup() + { + // setup LandData object + this.land = new LandData(); + this.land.AABBMax = new Vector3(0, 0, 0); + this.land.AABBMin = new Vector3(128, 128, 128); + this.land.Area = 128; + this.land.AuctionID = 0; + this.land.AuthBuyerID = new UUID(); + this.land.Category = ParcelCategory.Residential; + this.land.ClaimDate = 0; + this.land.ClaimPrice = 0; + this.land.GlobalID = new UUID("54ff9641-dd40-4a2c-b1f1-47dd3af24e50"); + this.land.GroupID = new UUID("d740204e-bbbf-44aa-949d-02c7d739f6a5"); + this.land.GroupPrims = 0; + this.land.Description = "land data to test LandDataSerializer"; + this.land.Flags = (uint)(ParcelFlags.AllowDamage | ParcelFlags.AllowVoiceChat); + this.land.LandingType = (byte)LandingType.Direct; + this.land.Name = "LandDataSerializerTest Land"; + this.land.Status = ParcelStatus.Leased; + this.land.LocalID = 0; + this.land.MediaAutoScale = (byte)0x01; + this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7"); + this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4"; + this.land.OwnerID = new UUID("1b8eedf9-6d15-448b-8015-24286f1756bf"); + } + + /// + /// + [Test] + public void TestLandDataSerializerSerializeTest() + { + string serialized = LandDataSerializer.Serialize(this.land); + Assert.That(serialized.Length > 0); + } + + /// + /// + [Test] + public void TestLandDataSerializerDeserializeTest() + { + } + } +} -- cgit v1.1 From 77ed8e977a8664456f55533feafeaca913c3b1c6 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Thu, 1 Oct 2009 10:30:26 +0200 Subject: adding meat to the LandDataSerializerTest cases. --- OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs index f1881a1..d0e3fc8 100644 --- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs @@ -25,6 +25,7 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System; using System.Collections.Generic; using OpenSim.Framework; using OpenSim.Framework.Serialization.External; @@ -38,6 +39,7 @@ namespace OpenSim.Framework.Serialization.Tests public class LandDataSerializerTest { private LandData land; + private string preSerialized = "\n\n 128\n 0\n 00000000-0000-0000-0000-000000000000\n Residential\n 0\n 0\n 54ff9641-dd40-4a2c-b1f1-47dd3af24e50\n d740204e-bbbf-44aa-949d-02c7d739f6a5\n False\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n land data to test LandDataSerializer\n 536870944\n 2\n LandDataSerializerTest Land\n Leased\n 0\n 1\n d4452578-2f25-4b97-a81b-819af559cfd7\n http://videos.opensimulator.org/bumblebee.mp4\n \n 1b8eedf9-6d15-448b-8015-24286f1756bf\n \n 0\n 0\n 0\n 00000000-0000-0000-0000-000000000000\n <0, 0, 0>\n <0, 0, 0>\n 0\n 0\n"; [SetUp] public void setup() @@ -70,10 +72,11 @@ namespace OpenSim.Framework.Serialization.Tests /// /// [Test] - public void TestLandDataSerializerSerializeTest() + public void LandDataSerializerSerializeTest() { string serialized = LandDataSerializer.Serialize(this.land); Assert.That(serialized.Length > 0); + Assert.That(serialized == this.preSerialized); } /// -- cgit v1.1 From 05da73c300b8ed2105febb8de8f2d302b8dbe599 Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Thu, 1 Oct 2009 12:01:41 +0200 Subject: fixing LandDataSerializer (yeah! for testcases) --- .../Serialization/External/LandDataSerializer.cs | 36 +++++++++++++--------- .../Serialization/Tests/LandDataSerializerTests.cs | 12 +++++--- 2 files changed, 29 insertions(+), 19 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index e9af2ca..e980945 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -91,20 +91,26 @@ namespace OpenSim.Framework.Serialization.External landData.OwnerID = UUID.Parse( xtr.ReadElementString("OwnerID")); landData.ParcelAccessList = new List(); - xtr.ReadStartElement("ParcelAccessList"); - while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) - { - ParcelManager.ParcelAccessEntry pae; + xtr.Read(); + if (xtr.Name != "ParcelAccessList") + throw new XmlException(String.Format("Expected \"ParcelAccessList\" element but got \"{0}\"", xtr.Name)); - xtr.ReadStartElement("ParcelAccessEntry"); - pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); - pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); - pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); - xtr.ReadEndElement(); + if (!xtr.IsEmptyElement) + { + while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) + { + ParcelManager.ParcelAccessEntry pae; - landData.ParcelAccessList.Add(pae); + xtr.ReadStartElement("ParcelAccessEntry"); + pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); + pae.Time = Convert.ToDateTime( xtr.ReadElementString("Time")); + pae.Flags = (AccessList)Convert.ToUInt32( xtr.ReadElementString("AccessList")); + xtr.ReadEndElement(); + + landData.ParcelAccessList.Add(pae); + } } - xtr.ReadEndElement(); + xtr.Read(); landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours")); landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice")); @@ -135,7 +141,7 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("Area", Convert.ToString(landData.Area)); xtw.WriteElementString("AuctionID", Convert.ToString(landData.AuctionID)); xtw.WriteElementString("AuthBuyerID", landData.AuthBuyerID.ToString()); - xtw.WriteElementString("Category", Convert.ToString(landData.Category)); + xtw.WriteElementString("Category", Convert.ToString((sbyte)landData.Category)); xtw.WriteElementString("ClaimDate", Convert.ToString(landData.ClaimDate)); xtw.WriteElementString("ClaimPrice", Convert.ToString(landData.ClaimPrice)); xtw.WriteElementString("GlobalID", landData.GlobalID.ToString()); @@ -143,10 +149,10 @@ namespace OpenSim.Framework.Serialization.External xtw.WriteElementString("IsGroupOwned", Convert.ToString(landData.IsGroupOwned)); xtw.WriteElementString("Bitmap", Convert.ToBase64String(landData.Bitmap)); xtw.WriteElementString("Description", landData.Description); - xtw.WriteElementString("Flags", Convert.ToString(landData.Flags)); - xtw.WriteElementString("LandingType", Convert.ToString(landData.LandingType)); + xtw.WriteElementString("Flags", Convert.ToString((uint)landData.Flags)); + xtw.WriteElementString("LandingType", Convert.ToString((byte)landData.LandingType)); xtw.WriteElementString("Name", landData.Name); - xtw.WriteElementString("Status", Convert.ToString(landData.Status)); + xtw.WriteElementString("Status", Convert.ToString((sbyte)landData.Status)); xtw.WriteElementString("LocalID", landData.LocalID.ToString()); xtw.WriteElementString("MediaAutoScale", Convert.ToString(landData.MediaAutoScale)); xtw.WriteElementString("MediaID", landData.MediaID.ToString()); diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs index d0e3fc8..06ec047 100644 --- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs @@ -39,7 +39,7 @@ namespace OpenSim.Framework.Serialization.Tests public class LandDataSerializerTest { private LandData land; - private string preSerialized = "\n\n 128\n 0\n 00000000-0000-0000-0000-000000000000\n Residential\n 0\n 0\n 54ff9641-dd40-4a2c-b1f1-47dd3af24e50\n d740204e-bbbf-44aa-949d-02c7d739f6a5\n False\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n land data to test LandDataSerializer\n 536870944\n 2\n LandDataSerializerTest Land\n Leased\n 0\n 1\n d4452578-2f25-4b97-a81b-819af559cfd7\n http://videos.opensimulator.org/bumblebee.mp4\n \n 1b8eedf9-6d15-448b-8015-24286f1756bf\n \n 0\n 0\n 0\n 00000000-0000-0000-0000-000000000000\n <0, 0, 0>\n <0, 0, 0>\n 0\n 0\n"; + private string preSerialized = "\n\n 128\n 0\n 00000000-0000-0000-0000-000000000000\n 10\n 0\n 0\n 54ff9641-dd40-4a2c-b1f1-47dd3af24e50\n d740204e-bbbf-44aa-949d-02c7d739f6a5\n False\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n land data to test LandDataSerializer\n 536870944\n 2\n LandDataSerializerTest Land\n 0\n 0\n 1\n d4452578-2f25-4b97-a81b-819af559cfd7\n http://videos.opensimulator.org/bumblebee.mp4\n \n 1b8eedf9-6d15-448b-8015-24286f1756bf\n \n 0\n 0\n 0\n 00000000-0000-0000-0000-000000000000\n <0, 0, 0>\n <0, 0, 0>\n 0\n 0\n"; [SetUp] public void setup() @@ -75,15 +75,19 @@ namespace OpenSim.Framework.Serialization.Tests public void LandDataSerializerSerializeTest() { string serialized = LandDataSerializer.Serialize(this.land); - Assert.That(serialized.Length > 0); - Assert.That(serialized == this.preSerialized); + Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); + Assert.That(serialized == this.preSerialized, "result of Serialize(LandData) does not match expected result"); } /// /// [Test] - public void TestLandDataSerializerDeserializeTest() + public void TestLandDataSerializerDeserializeFromStringTest() { + LandData reifiedLandData = LandDataSerializer.Deserialize(this.preSerialized); + Assert.That(reifiedLandData != null, "Deserialize(string) returned null"); + Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID"); + Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name"); } } } -- cgit v1.1 From 133a4a9906e55b20ff8780ebe5f59df87d5523ee Mon Sep 17 00:00:00 2001 From: dr scofield (aka dirk husemann) Date: Thu, 1 Oct 2009 15:03:16 +0200 Subject: - adding new LandDataSerializer testcase to "test-xml" target as well - adding another LandDataSerializer testcase --- .../Serialization/External/LandDataSerializer.cs | 22 +++++------ .../Serialization/Tests/LandDataSerializerTests.cs | 44 ++++++++++++++++++++-- 2 files changed, 52 insertions(+), 14 deletions(-) (limited to 'OpenSim/Framework') diff --git a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs index e980945..a3bc5d1 100644 --- a/OpenSim/Framework/Serialization/External/LandDataSerializer.cs +++ b/OpenSim/Framework/Serialization/External/LandDataSerializer.cs @@ -99,7 +99,7 @@ namespace OpenSim.Framework.Serialization.External { while (xtr.Read() && xtr.NodeType != XmlNodeType.EndElement) { - ParcelManager.ParcelAccessEntry pae; + ParcelManager.ParcelAccessEntry pae = new ParcelManager.ParcelAccessEntry(); xtr.ReadStartElement("ParcelAccessEntry"); pae.AgentID = UUID.Parse( xtr.ReadElementString("AgentID")); @@ -112,14 +112,14 @@ namespace OpenSim.Framework.Serialization.External } xtr.Read(); - landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours")); - landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice")); - landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice")); - landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); - landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); - landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); - landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell")); - landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); + landData.PassHours = Convert.ToSingle( xtr.ReadElementString("PassHours")); + landData.PassPrice = Convert.ToInt32( xtr.ReadElementString("PassPrice")); + landData.SalePrice = Convert.ToInt32( xtr.ReadElementString("SalePrice")); + landData.SnapshotID = UUID.Parse( xtr.ReadElementString("SnapshotID")); + landData.UserLocation = Vector3.Parse( xtr.ReadElementString("UserLocation")); + landData.UserLookAt = Vector3.Parse( xtr.ReadElementString("UserLookAt")); + landData.Dwell = Convert.ToInt32( xtr.ReadElementString("Dwell")); + landData.OtherCleanTime = Convert.ToInt32( xtr.ReadElementString("OtherCleanTime")); xtr.ReadEndElement(); @@ -165,8 +165,8 @@ namespace OpenSim.Framework.Serialization.External { xtw.WriteStartElement("ParcelAccessEntry"); xtw.WriteElementString("AgentID", pal.AgentID.ToString()); - xtw.WriteElementString("Time", Convert.ToString(pal.Time)); - xtw.WriteElementString("AccessList", Convert.ToString(pal.Flags)); + xtw.WriteElementString("Time", pal.Time.ToString("s")); + xtw.WriteElementString("AccessList", Convert.ToString((uint)pal.Flags)); xtw.WriteEndElement(); } xtw.WriteEndElement(); diff --git a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs index 06ec047..14e0462 100644 --- a/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs +++ b/OpenSim/Framework/Serialization/Tests/LandDataSerializerTests.cs @@ -39,7 +39,13 @@ namespace OpenSim.Framework.Serialization.Tests public class LandDataSerializerTest { private LandData land; - private string preSerialized = "\n\n 128\n 0\n 00000000-0000-0000-0000-000000000000\n 10\n 0\n 0\n 54ff9641-dd40-4a2c-b1f1-47dd3af24e50\n d740204e-bbbf-44aa-949d-02c7d739f6a5\n False\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n land data to test LandDataSerializer\n 536870944\n 2\n LandDataSerializerTest Land\n 0\n 0\n 1\n d4452578-2f25-4b97-a81b-819af559cfd7\n http://videos.opensimulator.org/bumblebee.mp4\n \n 1b8eedf9-6d15-448b-8015-24286f1756bf\n \n 0\n 0\n 0\n 00000000-0000-0000-0000-000000000000\n <0, 0, 0>\n <0, 0, 0>\n 0\n 0\n"; + private LandData landWithParcelAccessList; + + private static string preSerialized = "\n\n 128\n 0\n 00000000-0000-0000-0000-000000000000\n 10\n 0\n 0\n 54ff9641-dd40-4a2c-b1f1-47dd3af24e50\n d740204e-bbbf-44aa-949d-02c7d739f6a5\n False\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n land data to test LandDataSerializer\n 536870944\n 2\n LandDataSerializerTest Land\n 0\n 0\n 1\n d4452578-2f25-4b97-a81b-819af559cfd7\n http://videos.opensimulator.org/bumblebee.mp4\n \n 1b8eedf9-6d15-448b-8015-24286f1756bf\n \n 0\n 0\n 0\n 00000000-0000-0000-0000-000000000000\n <0, 0, 0>\n <0, 0, 0>\n 0\n 0\n"; + private static string preSerializedWithParcelAccessList = "\n\n 128\n 0\n 00000000-0000-0000-0000-000000000000\n 10\n 0\n 0\n 54ff9641-dd40-4a2c-b1f1-47dd3af24e50\n d740204e-bbbf-44aa-949d-02c7d739f6a5\n False\n AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=\n land data to test LandDataSerializer\n 536870944\n 2\n LandDataSerializerTest Land\n 0\n 0\n 1\n d4452578-2f25-4b97-a81b-819af559cfd7\n http://videos.opensimulator.org/bumblebee.mp4\n \n 1b8eedf9-6d15-448b-8015-24286f1756bf\n \n \n 62d65d45-c91a-4f77-862c-46557d978b6c\n \n 2\n \n \n ec2a8d18-2378-4fe0-8b68-2a31b57c481e\n \n 1\n \n \n 0\n 0\n 0\n 00000000-0000-0000-0000-000000000000\n <0, 0, 0>\n <0, 0, 0>\n 0\n 0\n"; + + + [SetUp] public void setup() @@ -67,27 +73,59 @@ namespace OpenSim.Framework.Serialization.Tests this.land.MediaID = new UUID("d4452578-2f25-4b97-a81b-819af559cfd7"); this.land.MediaURL = "http://videos.opensimulator.org/bumblebee.mp4"; this.land.OwnerID = new UUID("1b8eedf9-6d15-448b-8015-24286f1756bf"); + + this.landWithParcelAccessList = this.land.Copy(); + this.landWithParcelAccessList.ParcelAccessList.Clear(); + + ParcelManager.ParcelAccessEntry pae0 = new ParcelManager.ParcelAccessEntry(); + pae0.AgentID = new UUID("62d65d45-c91a-4f77-862c-46557d978b6c"); + pae0.Flags = AccessList.Ban; + pae0.Time = new DateTime(2009, 10, 01); + this.landWithParcelAccessList.ParcelAccessList.Add(pae0); + + ParcelManager.ParcelAccessEntry pae1 = new ParcelManager.ParcelAccessEntry(); + pae1.AgentID = new UUID("ec2a8d18-2378-4fe0-8b68-2a31b57c481e"); + pae1.Flags = AccessList.Access; + pae1.Time = new DateTime(2010, 10, 20); + this.landWithParcelAccessList.ParcelAccessList.Add(pae1); } /// + /// Test the LandDataSerializer.Serialize() method /// [Test] public void LandDataSerializerSerializeTest() { string serialized = LandDataSerializer.Serialize(this.land); Assert.That(serialized.Length > 0, "Serialize(LandData) returned empty string"); - Assert.That(serialized == this.preSerialized, "result of Serialize(LandData) does not match expected result"); + Assert.That(serialized == LandDataSerializerTest.preSerialized, + "result of Serialize(LandData) does not match expected result"); + + string serializedWithParcelAccessList = LandDataSerializer.Serialize(this.landWithParcelAccessList); + Assert.That(serializedWithParcelAccessList.Length > 0, + "Serialize(LandData) returned empty string for LandData object with ParcelAccessList"); + Assert.That(serializedWithParcelAccessList == LandDataSerializerTest.preSerializedWithParcelAccessList, + "result of Serialize(LandData) does not match expected result (pre-serialized with parcel access list"); } /// + /// Test the LandDataSerializer.Deserialize() method /// [Test] public void TestLandDataSerializerDeserializeFromStringTest() { - LandData reifiedLandData = LandDataSerializer.Deserialize(this.preSerialized); + LandData reifiedLandData = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerialized); Assert.That(reifiedLandData != null, "Deserialize(string) returned null"); Assert.That(reifiedLandData.GlobalID == this.land.GlobalID, "Reified LandData.GlobalID != original LandData.GlobalID"); Assert.That(reifiedLandData.Name == this.land.Name, "Reified LandData.Name != original LandData.Name"); + + LandData reifiedLandDataWithParcelAccessList = LandDataSerializer.Deserialize(LandDataSerializerTest.preSerializedWithParcelAccessList); + Assert.That(reifiedLandDataWithParcelAccessList != null, + "Deserialize(string) returned null (pre-serialized with parcel access list)"); + Assert.That(reifiedLandDataWithParcelAccessList.GlobalID == this.landWithParcelAccessList.GlobalID, + "Reified LandData.GlobalID != original LandData.GlobalID (pre-serialized with parcel access list)"); + Assert.That(reifiedLandDataWithParcelAccessList.Name == this.landWithParcelAccessList.Name, + "Reified LandData.Name != original LandData.Name (pre-serialized with parcel access list)"); } } } -- cgit v1.1