From b37b71b2738599419239b3e3081f9e1b5e78ec06 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Mon, 18 Feb 2008 17:31:05 +0000 Subject: [PATCH] * Make RegionProfileData.RequestSimProfileData static * Minor documentation bits --- OpenSim/Framework/Data/RegionProfileData.cs | 10 +++++++- OpenSim/Grid/GridServer/GridManager.cs | 5 ++++ OpenSim/Grid/UserServer/UserLoginService.cs | 24 ++++++++++--------- .../Communications/OGS1/OGS1GridServices.cs | 2 +- 4 files changed, 28 insertions(+), 13 deletions(-) diff --git a/OpenSim/Framework/Data/RegionProfileData.cs b/OpenSim/Framework/Data/RegionProfileData.cs index 8119d018fc..3dbe27f631 100644 --- a/OpenSim/Framework/Data/RegionProfileData.cs +++ b/OpenSim/Framework/Data/RegionProfileData.cs @@ -182,7 +182,15 @@ namespace OpenSim.Framework.Data return simData; } - public RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, + /// + /// Request sim profile information from a grid server + /// + /// + /// + /// + /// + /// The sim profile. Null if there was a request failure + public static RegionProfileData RequestSimProfileData(ulong region_handle, string gridserver_url, string gridserver_sendkey, string gridserver_recvkey) { Hashtable requestData = new Hashtable(); diff --git a/OpenSim/Grid/GridServer/GridManager.cs b/OpenSim/Grid/GridServer/GridManager.cs index 5cd83ea4f9..634abc83cc 100644 --- a/OpenSim/Grid/GridServer/GridManager.cs +++ b/OpenSim/Grid/GridServer/GridManager.cs @@ -503,6 +503,11 @@ namespace OpenSim.Grid.GridServer } + /// + /// Returns an XML RPC response to a simulator profile request + /// + /// + /// public XmlRpcResponse XmlRpcSimulatorDataRequestMethod(XmlRpcRequest request) { Hashtable requestData = (Hashtable) request.Params[0]; diff --git a/OpenSim/Grid/UserServer/UserLoginService.cs b/OpenSim/Grid/UserServer/UserLoginService.cs index 09cd9fd87b..58e85d811b 100644 --- a/OpenSim/Grid/UserServer/UserLoginService.cs +++ b/OpenSim/Grid/UserServer/UserLoginService.cs @@ -72,12 +72,13 @@ namespace OpenSim.Grid.UserServer bool tryDefault = false; //CFK: Since the try is always "tried", the "Home Location" message should always appear, so comment this one. //CFK: m_log.Info("[LOGIN]: Load information from the gridserver"); - RegionProfileData SimInfo = new RegionProfileData(); + try { - SimInfo = - SimInfo.RequestSimProfileData(theUser.currentAgent.currentHandle, m_config.GridServerURL, - m_config.GridSendKey, m_config.GridRecvKey); + RegionProfileData SimInfo = + RegionProfileData.RequestSimProfileData( + theUser.currentAgent.currentHandle, m_config.GridServerURL, + m_config.GridSendKey, m_config.GridRecvKey); // Customise the response //CFK: This is redundant and the next message should always appear. @@ -129,16 +130,18 @@ namespace OpenSim.Grid.UserServer theUser.currentAgent.currentRegion = SimInfo.UUID; theUser.currentAgent.currentHandle = SimInfo.regionHandle; - m_log.Info("[LOGIN]: " + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + - SimInfo.regionLocX + "," + SimInfo.regionLocY); + m_log.Info("[LOGIN]: Sending expect user call to " + + SimInfo.regionName + " @ " + SimInfo.httpServerURI + " " + + SimInfo.regionLocX + "," + SimInfo.regionLocY); - XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); + XmlRpcRequest GridReq = new XmlRpcRequest("expect_user", SendParams); XmlRpcResponse GridResp = GridReq.Send(SimInfo.httpServerURI, 6000); } catch (Exception) { tryDefault = true; } + if (tryDefault) { // Send him to default region instead @@ -149,12 +152,11 @@ namespace OpenSim.Grid.UserServer m_log.Warn( "[LOGIN]: Home region not available: sending to default " + defaultHandle.ToString()); - SimInfo = new RegionProfileData(); try { - SimInfo = - SimInfo.RequestSimProfileData(defaultHandle, m_config.GridServerURL, - m_config.GridSendKey, m_config.GridRecvKey); + RegionProfileData SimInfo = RegionProfileData.RequestSimProfileData( + defaultHandle, m_config.GridServerURL, + m_config.GridSendKey, m_config.GridRecvKey); // Customise the response m_log.Info("[LOGIN]: Home Location"); diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 5d38b83771..0a9a05c10c 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -75,7 +75,7 @@ namespace OpenSim.Region.Communications.OGS1 } /// - /// + /// Contructor. Adds "expect_user" and "check" xmlrpc method handlers /// /// ///