From e0a06f641668cd5c25a7854af2faf8a61c4053ee Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Tue, 5 May 2009 16:17:52 +0000 Subject: - moving banned check and public/private check to Scene.NewUserConnection() - adding reason reporting this enforces estate bans very early on and prevents us from circulating client objects that we'd then have to retract once we realize that the client is not allowed into the region --- .../Interregion/RESTInterregionComms.cs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'OpenSim/Region/CoreModules/ServiceConnectors/Interregion/RESTInterregionComms.cs') diff --git a/OpenSim/Region/CoreModules/ServiceConnectors/Interregion/RESTInterregionComms.cs b/OpenSim/Region/CoreModules/ServiceConnectors/Interregion/RESTInterregionComms.cs index 7fafb6e..80dced7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectors/Interregion/RESTInterregionComms.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectors/Interregion/RESTInterregionComms.cs @@ -140,10 +140,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Interregion * Agent-related communications */ - public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit) + public bool SendCreateChildAgent(ulong regionHandle, AgentCircuitData aCircuit, out string reason) { // Try local first - if (m_localBackend.SendCreateChildAgent(regionHandle, aCircuit)) + if (m_localBackend.SendCreateChildAgent(regionHandle, aCircuit, out reason)) return true; // else do the remote thing @@ -154,7 +154,7 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Interregion { m_regionClient.SendUserInformation(regInfo, aCircuit); - return m_regionClient.DoCreateChildAgentCall(regInfo, aCircuit, "None"); + return m_regionClient.DoCreateChildAgentCall(regInfo, aCircuit, "None", out reason); } //else // m_log.Warn("[REST COMMS]: Region not found " + regionHandle); @@ -431,12 +431,19 @@ namespace OpenSim.Region.CoreModules.ServiceConnectors.Interregion return; } + OSDMap resp = new OSDMap(2); + string reason = String.Empty; + // This is the meaning of POST agent m_regionClient.AdjustUserInformation(aCircuit); - bool result = m_localBackend.SendCreateChildAgent(regionhandle, aCircuit); + bool result = m_localBackend.SendCreateChildAgent(regionhandle, aCircuit, out reason); + + resp["reason"] = OSD.FromString(reason); + resp["success"] = OSD.FromBoolean(result); + // TODO: add reason if not String.Empty? responsedata["int_response_code"] = 200; - responsedata["str_response_string"] = result.ToString(); + responsedata["str_response_string"] = OSDParser.SerializeJsonString(resp); } protected virtual void DoAgentPut(Hashtable request, Hashtable responsedata) -- cgit v1.1