Fixed the connection from User server to GridServer.

0.6.8-post-fixes
Diva Canto 2009-09-27 20:44:43 -07:00
parent e15a9b8484
commit 0766b6dc34
2 changed files with 33 additions and 32 deletions

View File

@ -34,6 +34,7 @@ using System.Text.RegularExpressions;
using log4net;
using Nwc.XmlRpc;
using OpenMetaverse;
using Nini.Config;
using OpenSim.Data;
using OpenSim.Framework;
using OpenSim.Framework.Communications;
@ -42,6 +43,9 @@ using OpenSim.Framework.Communications.Cache;
using OpenSim.Framework.Capabilities;
using OpenSim.Framework.Servers;
using OpenSim.Framework.Servers.HttpServer;
using OpenSim.Services.Interfaces;
using OpenSim.Services.Connectors;
using GridRegion = OpenSim.Services.Interfaces.GridRegion;
namespace OpenSim.Grid.UserServer.Modules
{
@ -63,6 +67,8 @@ namespace OpenSim.Grid.UserServer.Modules
public UserConfig m_config;
private readonly IRegionProfileRouter m_regionProfileService;
private IGridService m_GridService;
protected BaseHttpServer m_httpServer;
public UserLoginService(
@ -76,6 +82,8 @@ namespace OpenSim.Grid.UserServer.Modules
m_defaultHomeY = m_config.DefaultY;
m_interInventoryService = inventoryService;
m_regionProfileService = regionProfileService;
m_GridService = new GridServicesConnector(config.GridServerURL.ToString());
}
public void RegisterHandlers(BaseHttpServer httpServer, bool registerLLSDHandler, bool registerOpenIDHandlers)
@ -203,47 +211,37 @@ namespace OpenSim.Grid.UserServer.Modules
protected override RegionInfo RequestClosestRegion(string region)
{
RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(region,
m_config.GridServerURL, m_config.GridSendKey, m_config.GridRecvKey);
if (profileData != null)
{
return profileData.ToRegionInfo();
}
else
{
return null;
}
return GridRegionToRegionInfo(m_GridService.GetRegionByName(UUID.Zero, region));
}
protected override RegionInfo GetRegionInfo(ulong homeRegionHandle)
{
RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionHandle,
m_config.GridServerURL, m_config.GridSendKey,
m_config.GridRecvKey);
if (profileData != null)
{
return profileData.ToRegionInfo();
}
else
{
return null;
}
uint x = 0, y = 0;
Utils.LongToUInts(homeRegionHandle, out x, out y);
return GridRegionToRegionInfo(m_GridService.GetRegionByPosition(UUID.Zero, (int)x, (int)y));
}
protected override RegionInfo GetRegionInfo(UUID homeRegionId)
{
RegionProfileData profileData = m_regionProfileService.RequestSimProfileData(homeRegionId,
m_config.GridServerURL, m_config.GridSendKey,
m_config.GridRecvKey);
if (profileData != null)
{
return profileData.ToRegionInfo();
return GridRegionToRegionInfo(m_GridService.GetRegionByUUID(UUID.Zero, homeRegionId));
}
else
private RegionInfo GridRegionToRegionInfo(GridRegion gregion)
{
if (gregion == null)
return null;
}
RegionInfo rinfo = new RegionInfo();
rinfo.ExternalHostName = gregion.ExternalHostName;
rinfo.HttpPort = gregion.HttpPort;
rinfo.InternalEndPoint = gregion.InternalEndPoint;
rinfo.RegionID = gregion.RegionID;
rinfo.RegionLocX = (uint)(gregion.RegionLocX / Constants.RegionSize);
rinfo.RegionLocY = (uint)(gregion.RegionLocY / Constants.RegionSize);
rinfo.RegionName = gregion.RegionName;
rinfo.ScopeID = gregion.ScopeID;
return rinfo;
}
protected override bool PrepareLoginToRegion(RegionInfo regionInfo, UserProfileData user, LoginResponse response, IPEndPoint remoteClient)

View File

@ -980,6 +980,8 @@
<Reference name="OpenSim.Framework.Servers"/>
<Reference name="OpenSim.Framework.Servers.HttpServer"/>
<Reference name="OpenSim.Framework.Statistics"/>
<Reference name="OpenSim.Services.Interfaces"/>
<Reference name="OpenSim.Services.Connectors"/>
<Reference name="OpenSim.Grid.Framework"/>
<Reference name="OpenSim.Grid.Communications.OGS1"/>
<Reference name="OpenMetaverse.dll"/>
@ -988,6 +990,7 @@
<Reference name="XMLRPC.dll"/>
<Reference name="log4net.dll"/>
<Reference name="DotNetOpenId.dll"/>
<Reference name="Nini.dll"/>
<Files>
<Match pattern="*.cs" recurse="true"/>