From 0766b6dc34b972026846360767a20e2f11325c70 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 27 Sep 2009 20:44:43 -0700 Subject: Fixed the connection from User server to GridServer. --- .../Grid/UserServer.Modules/UserLoginService.cs | 62 +++++++++++----------- 1 file changed, 30 insertions(+), 32 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index 01d5537..2ca5ada 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -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(); - } - else - { + return GridRegionToRegionInfo(m_GridService.GetRegionByUUID(UUID.Zero, homeRegionId)); + } + + 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) -- cgit v1.1 From 73a61a8a32f18f4a003cbf0f4d6e876badea69ce Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 27 Sep 2009 21:14:31 -0700 Subject: Fixed small bug in having to deal with RegionInfo's ServerURI, which wasn't being set. --- OpenSim/Grid/UserServer.Modules/UserLoginService.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index 2ca5ada..66fc24e 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -240,6 +240,7 @@ namespace OpenSim.Grid.UserServer.Modules rinfo.RegionLocY = (uint)(gregion.RegionLocY / Constants.RegionSize); rinfo.RegionName = gregion.RegionName; rinfo.ScopeID = gregion.ScopeID; + rinfo.ServerURI = "http://" + gregion.ExternalHostName + ":" + gregion.HttpPort.ToString(); return rinfo; } -- cgit v1.1 From 3091e5db9d6d46191d52a21ef5c25feb76ed703a Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 07:53:52 -0700 Subject: Fixed bug in user server related to region's serverURI. --- OpenSim/Grid/UserServer.Modules/UserLoginService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index 66fc24e..47bbeca 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -240,7 +240,7 @@ namespace OpenSim.Grid.UserServer.Modules rinfo.RegionLocY = (uint)(gregion.RegionLocY / Constants.RegionSize); rinfo.RegionName = gregion.RegionName; rinfo.ScopeID = gregion.ScopeID; - rinfo.ServerURI = "http://" + gregion.ExternalHostName + ":" + gregion.HttpPort.ToString(); + rinfo.ServerURI = gregion.ServerURI; return rinfo; } -- cgit v1.1 From 6653a30487d76760451467a22849aba725f1e7cf Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 28 Sep 2009 20:58:21 -0700 Subject: Fixed bug in HG that was causing secondlife:// refs to bomb the client. Also fiddled a bit more with the initial CAP in the user server. --- OpenSim/Grid/UserServer.Modules/UserLoginService.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index 47bbeca..c95e054 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -279,9 +279,8 @@ namespace OpenSim.Grid.UserServer.Modules //response.SeedCapability = serverURI + CapsUtil.GetCapsSeedPath(capsPath); // Take off trailing / so that the caps path isn't //CAPS/someUUID - if (regionInfo.httpServerURI.EndsWith("/")) - regionInfo.httpServerURI = regionInfo.httpServerURI.Substring(0, regionInfo.httpServerURI.Length - 1); - response.SeedCapability = regionInfo.httpServerURI + CapsUtil.GetCapsSeedPath(capsPath); + string uri = regionInfo.httpServerURI.Trim(new char[] { '/' }); + response.SeedCapability = uri + CapsUtil.GetCapsSeedPath(capsPath); // Notify the target of an incoming user -- 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/Grid/MessagingServer.Modules/UserDataBaseService.cs | 2 +- OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs | 2 +- OpenSim/Grid/UserServer.Modules/UserLoginService.cs | 2 +- OpenSim/Grid/UserServer.Modules/UserManager.cs | 8 ++++---- OpenSim/Grid/UserServer/Main.cs | 4 ++-- OpenSim/Grid/UserServer/UserServerCommsManager.cs | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Grid') diff --git a/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs b/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs index 8006119..76c4899 100644 --- a/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs +++ b/OpenSim/Grid/MessagingServer.Modules/UserDataBaseService.cs @@ -70,6 +70,6 @@ namespace OpenSim.Grid.MessagingServer.Modules { //throw new Exception("The method or operation is not implemented."); return null; - } + } } } diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs index 9d31d81..77caf47 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginAuthService.cs @@ -47,7 +47,7 @@ namespace OpenSim.Grid.UserServer.Modules /// /// Hypergrid login service used in grid mode. - /// + /// public class UserLoginAuthService : HGLoginAuthService { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs index c95e054..7d0e0de 100644 --- a/OpenSim/Grid/UserServer.Modules/UserLoginService.cs +++ b/OpenSim/Grid/UserServer.Modules/UserLoginService.cs @@ -55,7 +55,7 @@ namespace OpenSim.Grid.UserServer.Modules /// /// Login service used in grid mode. - /// + /// public class UserLoginService : LoginService { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); diff --git a/OpenSim/Grid/UserServer.Modules/UserManager.cs b/OpenSim/Grid/UserServer.Modules/UserManager.cs index efbf45e..36c6297 100644 --- a/OpenSim/Grid/UserServer.Modules/UserManager.cs +++ b/OpenSim/Grid/UserServer.Modules/UserManager.cs @@ -229,7 +229,7 @@ namespace OpenSim.Grid.UserServer.Modules UserProfileData userProfile = m_userDataBaseService.GetUserProfile(userUuid); if (null == userProfile) - return Util.CreateUnknownUserErrorResponse(); + return Util.CreateUnknownUserErrorResponse(); string authed; @@ -249,12 +249,12 @@ namespace OpenSim.Grid.UserServer.Modules // "[USER MANAGER]: Authentication by password result from {0} for {1} is {2}", // remoteClient, userUuid, authed); - XmlRpcResponse response = new XmlRpcResponse(); - Hashtable responseData = new Hashtable(); + XmlRpcResponse response = new XmlRpcResponse(); + Hashtable responseData = new Hashtable(); responseData["auth_user"] = authed; response.Value = responseData; - return response; + return response; } public XmlRpcResponse XmlRPCGetAvatarPickerAvatar(XmlRpcRequest request, IPEndPoint remoteClient) diff --git a/OpenSim/Grid/UserServer/Main.cs b/OpenSim/Grid/UserServer/Main.cs index a92226d..286076d7 100644 --- a/OpenSim/Grid/UserServer/Main.cs +++ b/OpenSim/Grid/UserServer/Main.cs @@ -187,13 +187,13 @@ namespace OpenSim.Grid.UserServer /// protected virtual void StartupUserServerModules() { - m_log.Info("[STARTUP]: Establishing data connection"); + m_log.Info("[STARTUP]: Establishing data connection"); //we only need core components so we can request them from here IInterServiceInventoryServices inventoryService; TryGet(out inventoryService); - CommunicationsManager commsManager = new UserServerCommsManager(inventoryService); + CommunicationsManager commsManager = new UserServerCommsManager(inventoryService); //setup database access service, for now this has to be created before the other modules. m_userDataBaseService = new UserDataBaseService(commsManager); diff --git a/OpenSim/Grid/UserServer/UserServerCommsManager.cs b/OpenSim/Grid/UserServer/UserServerCommsManager.cs index 7200836..8ef693b 100644 --- a/OpenSim/Grid/UserServer/UserServerCommsManager.cs +++ b/OpenSim/Grid/UserServer/UserServerCommsManager.cs @@ -28,9 +28,9 @@ using OpenSim.Framework.Communications; namespace OpenSim.Grid.UserServer -{ +{ public class UserServerCommsManager : CommunicationsManager - { + { public UserServerCommsManager(IInterServiceInventoryServices interServiceInventoryService) : base(null, null) { -- cgit v1.1