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/Services/Connectors/Land/LandServiceConnector.cs | 13 ++++++++----- .../Connectors/Neighbour/NeighbourServiceConnector.cs | 16 ++++++++++------ 2 files changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim/Services/Connectors') diff --git a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs index 0243f1f..06bc11c 100644 --- a/OpenSim/Services/Connectors/Land/LandServiceConnector.cs +++ b/OpenSim/Services/Connectors/Land/LandServiceConnector.cs @@ -38,6 +38,7 @@ using OpenSim.Framework.Servers.HttpServer; using OpenSim.Services.Interfaces; using OpenMetaverse; using Nwc.XmlRpc; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Services.Connectors { @@ -47,20 +48,20 @@ namespace OpenSim.Services.Connectors LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - protected IGridServices m_MapService = null; + protected IGridService m_GridService = null; public LandServicesConnector() { } - public LandServicesConnector(IGridServices gridServices) + public LandServicesConnector(IGridService gridServices) { Initialise(gridServices); } - public virtual void Initialise(IGridServices gridServices) + public virtual void Initialise(IGridService gridServices) { - m_MapService = gridServices; + m_GridService = gridServices; } public virtual LandData GetLandData(ulong regionHandle, uint x, uint y) @@ -76,7 +77,9 @@ namespace OpenSim.Services.Connectors try { - RegionInfo info = m_MapService.RequestNeighbourInfo(regionHandle); + uint xpos = 0, ypos = 0; + Utils.LongToUInts(regionHandle, out xpos, out ypos); + GridRegion info = m_GridService.GetRegionByPosition(UUID.Zero, (int)xpos, (int)ypos); if (info != null) // just to be sure { XmlRpcRequest request = new XmlRpcRequest("land_data", paramList); diff --git a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs index 7fff537..1b595e7 100644 --- a/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs +++ b/OpenSim/Services/Connectors/Neighbour/NeighbourServiceConnector.cs @@ -41,6 +41,8 @@ using OpenSim.Services.Interfaces; using OpenMetaverse; using OpenMetaverse.StructuredData; +using GridRegion = OpenSim.Services.Interfaces.GridRegion; + namespace OpenSim.Services.Connectors { public class NeighbourServicesConnector : INeighbourService @@ -49,25 +51,27 @@ namespace OpenSim.Services.Connectors LogManager.GetLogger( MethodBase.GetCurrentMethod().DeclaringType); - protected IGridServices m_MapService = null; + protected IGridService m_GridService = null; public NeighbourServicesConnector() { } - public NeighbourServicesConnector(IGridServices gridServices) + public NeighbourServicesConnector(IGridService gridServices) { Initialise(gridServices); } - public virtual void Initialise(IGridServices gridServices) + public virtual void Initialise(IGridService gridServices) { - m_MapService = gridServices; + m_GridService = gridServices; } public virtual bool HelloNeighbour(ulong regionHandle, RegionInfo thisRegion) { - RegionInfo regInfo = m_MapService.RequestNeighbourInfo(regionHandle); + uint x = 0, y = 0; + Utils.LongToUInts(regionHandle, out x, out y); + GridRegion regInfo = m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y); if ((regInfo != null) && // Don't remote-call this instance; that's a startup hickup !((regInfo.ExternalHostName == thisRegion.ExternalHostName) && (regInfo.HttpPort == thisRegion.HttpPort))) @@ -79,7 +83,7 @@ namespace OpenSim.Services.Connectors return false; } - public bool DoHelloNeighbourCall(RegionInfo region, RegionInfo thisRegion) + public bool DoHelloNeighbourCall(GridRegion region, RegionInfo thisRegion) { string uri = "http://" + region.ExternalEndPoint.Address + ":" + region.HttpPort + "/region/" + thisRegion.RegionID + "/"; //m_log.Debug(" >>> DoHelloNeighbourCall <<< " + uri); -- cgit v1.1