From 0c81966c0a8f69474fb542d7b4df1780ef756519 Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 29 Jan 2010 09:12:22 -0800 Subject: Works for grid login. --- .../Connectors/Grid/GridServiceConnector.cs | 42 +++++++++++++++++++++- .../Simulation/SimulationServiceConnector.cs | 3 ++ 2 files changed, 44 insertions(+), 1 deletion(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs index a1ca58e..7c8a3e2 100644 --- a/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs +++ b/OpenSim/Services/Connectors/Grid/GridServiceConnector.cs @@ -564,7 +564,47 @@ namespace OpenSim.Services.Connectors public int GetRegionFlags(UUID scopeID, UUID regionID) { - return 0; + Dictionary sendData = new Dictionary(); + + sendData["SCOPEID"] = scopeID.ToString(); + sendData["REGIONID"] = regionID.ToString(); + + sendData["METHOD"] = "get_region_flags"; + + string reply = string.Empty; + try + { + reply = SynchronousRestFormsRequester.MakeRequest("POST", + m_ServerURI + "/grid", + ServerUtils.BuildQueryString(sendData)); + } + catch (Exception e) + { + m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message); + return -1; + } + + int flags = -1; + + if (reply != string.Empty) + { + Dictionary replyData = ServerUtils.ParseXmlResponse(reply); + + if ((replyData != null) && replyData.ContainsKey("result") && (replyData["result"] != null)) + { + Int32.TryParse((string)replyData["result"], out flags); + //else + // m_log.DebugFormat("[GRID CONNECTOR]: GetRegionFlags {0}, {1} received wrong type {2}", + // scopeID, regionID, replyData["result"].GetType()); + } + else + m_log.DebugFormat("[GRID CONNECTOR]: GetRegionFlags {0}, {1} received null response", + scopeID, regionID); + } + else + m_log.DebugFormat("[GRID CONNECTOR]: GetRegionFlags received null reply"); + + return flags; } #endregion diff --git a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs index e2ab179..d3be1a8 100644 --- a/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Simulation/SimulationServiceConnector.cs @@ -105,6 +105,8 @@ namespace OpenSim.Services.Connectors.Simulation // Fill it in OSDMap args = PackCreateAgentArguments(aCircuit, destination, flags); + if (args == null) + return false; string strBuffer = ""; byte[] buffer = new byte[1]; @@ -210,6 +212,7 @@ namespace OpenSim.Services.Connectors.Simulation catch (Exception e) { m_log.Debug("[REMOTE SIMULATION CONNECTOR]: PackAgentCircuitData failed with exception: " + e.Message); + return null; } // Add the input arguments args["destination_x"] = OSD.FromString(destination.RegionLocX.ToString()); -- cgit v1.1