From e518fe5d346427e5134efdd191ecc9d61acafe08 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 19 Sep 2008 20:02:19 +0000 Subject: * Enables logins to regions on a grid once they have finished starting up (this does not include script startup). --- .../Region/Communications/OGS1/OGS1GridServices.cs | 75 +++++++++++++--------- 1 file changed, 46 insertions(+), 29 deletions(-) (limited to 'OpenSim/Region/Communications/OGS1') diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs index 2e91157..a59a6a5 100644 --- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs +++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs @@ -613,7 +613,7 @@ namespace OpenSim.Region.Communications.OGS1 /// /// public XmlRpcResponse ExpectUser(XmlRpcRequest request) - { + { Hashtable requestData = (Hashtable) request.Params[0]; AgentCircuitData agentData = new AgentCircuitData(); agentData.SessionID = new UUID((string) requestData["session_id"]); @@ -627,7 +627,7 @@ namespace OpenSim.Region.Communications.OGS1 m_log.DebugFormat( "[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}", - agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode); + agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode); if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) { @@ -644,45 +644,62 @@ namespace OpenSim.Region.Communications.OGS1 agentData.child = false; } - RegionInfo[] regions = m_regionsOnInstance.ToArray(); - bool banned = false; - - for (int i = 0; i < regions.Length; i++) - { - if (regions[i] != null) - { - if (regions[i].RegionHandle == regionHandle) - { - if (regions[i].EstateSettings.IsBanned(agentData.AgentID)) - { - banned = true; - break; - } - } - } - } - XmlRpcResponse resp = new XmlRpcResponse(); - - if (banned) + + if (!m_regionLoginsEnabled) { - m_log.InfoFormat("[CLIENT]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); + m_log.InfoFormat( + "[CLIENT]: Denying access for user {0} {1} because region login is currently disabled", + agentData.firstname, agentData.lastname); Hashtable respdata = new Hashtable(); respdata["success"] = "FALSE"; - respdata["reason"] = "banned"; - resp.Value = respdata; + respdata["reason"] = "region login currently disabled"; + resp.Value = respdata; } else { - m_localBackend.TriggerExpectUser(regionHandle, agentData); - Hashtable respdata = new Hashtable(); - respdata["success"] = "TRUE"; - resp.Value = respdata; + RegionInfo[] regions = m_regionsOnInstance.ToArray(); + bool banned = false; + + for (int i = 0; i < regions.Length; i++) + { + if (regions[i] != null) + { + if (regions[i].RegionHandle == regionHandle) + { + if (regions[i].EstateSettings.IsBanned(agentData.AgentID)) + { + banned = true; + break; + } + } + } + } + + if (banned) + { + m_log.InfoFormat( + "[CLIENT]: Denying access for user {0} {1} because user is banned", + agentData.firstname, agentData.lastname); + + Hashtable respdata = new Hashtable(); + respdata["success"] = "FALSE"; + respdata["reason"] = "banned"; + resp.Value = respdata; + } + else + { + m_localBackend.TriggerExpectUser(regionHandle, agentData); + Hashtable respdata = new Hashtable(); + respdata["success"] = "TRUE"; + resp.Value = respdata; + } } return resp; } + // Grid Request Processing /// /// Ooops, our Agent must be dead if we're getting this request! -- cgit v1.1