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