diff options
author | Justin Clarke Casey | 2008-09-19 20:02:19 +0000 |
---|---|---|
committer | Justin Clarke Casey | 2008-09-19 20:02:19 +0000 |
commit | e518fe5d346427e5134efdd191ecc9d61acafe08 (patch) | |
tree | 9e1281d3a8d5c4279bd5a0dc150b9d5498705cec /OpenSim | |
parent | add a region settings test (diff) | |
download | opensim-SC-e518fe5d346427e5134efdd191ecc9d61acafe08.zip opensim-SC-e518fe5d346427e5134efdd191ecc9d61acafe08.tar.gz opensim-SC-e518fe5d346427e5134efdd191ecc9d61acafe08.tar.bz2 opensim-SC-e518fe5d346427e5134efdd191ecc9d61acafe08.tar.xz |
* Enables logins to regions on a grid once they have finished starting up (this does not include script startup).
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Application/OpenSimBase.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Communications/OGS1/OGS1GridServices.cs | 75 |
2 files changed, 47 insertions, 30 deletions
diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index d4fa314..8eea56f 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs | |||
@@ -425,7 +425,7 @@ namespace OpenSim | |||
425 | 425 | ||
426 | LoadPlugins(); | 426 | LoadPlugins(); |
427 | 427 | ||
428 | // Only enable logins to the regions once we have completely finished starting up | 428 | // Only enable logins to the regions once we have completely finished starting up (apart from scripts) |
429 | m_commsManager.GridService.RegionLoginsEnabled = true; | 429 | m_commsManager.GridService.RegionLoginsEnabled = true; |
430 | } | 430 | } |
431 | 431 | ||
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 | |||
613 | /// <param name="request"></param> | 613 | /// <param name="request"></param> |
614 | /// <returns></returns> | 614 | /// <returns></returns> |
615 | public XmlRpcResponse ExpectUser(XmlRpcRequest request) | 615 | public XmlRpcResponse ExpectUser(XmlRpcRequest request) |
616 | { | 616 | { |
617 | Hashtable requestData = (Hashtable) request.Params[0]; | 617 | Hashtable requestData = (Hashtable) request.Params[0]; |
618 | AgentCircuitData agentData = new AgentCircuitData(); | 618 | AgentCircuitData agentData = new AgentCircuitData(); |
619 | agentData.SessionID = new UUID((string) requestData["session_id"]); | 619 | agentData.SessionID = new UUID((string) requestData["session_id"]); |
@@ -627,7 +627,7 @@ namespace OpenSim.Region.Communications.OGS1 | |||
627 | 627 | ||
628 | m_log.DebugFormat( | 628 | m_log.DebugFormat( |
629 | "[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}", | 629 | "[CLIENT]: Told by user service to prepare for a connection from {0} {1} {2}, circuit {3}", |
630 | agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode); | 630 | agentData.firstname, agentData.lastname, agentData.AgentID, agentData.circuitcode); |
631 | 631 | ||
632 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) | 632 | if (requestData.ContainsKey("child_agent") && requestData["child_agent"].Equals("1")) |
633 | { | 633 | { |
@@ -644,45 +644,62 @@ namespace OpenSim.Region.Communications.OGS1 | |||
644 | agentData.child = false; | 644 | agentData.child = false; |
645 | } | 645 | } |
646 | 646 | ||
647 | RegionInfo[] regions = m_regionsOnInstance.ToArray(); | ||
648 | bool banned = false; | ||
649 | |||
650 | for (int i = 0; i < regions.Length; i++) | ||
651 | { | ||
652 | if (regions[i] != null) | ||
653 | { | ||
654 | if (regions[i].RegionHandle == regionHandle) | ||
655 | { | ||
656 | if (regions[i].EstateSettings.IsBanned(agentData.AgentID)) | ||
657 | { | ||
658 | banned = true; | ||
659 | break; | ||
660 | } | ||
661 | } | ||
662 | } | ||
663 | } | ||
664 | |||
665 | XmlRpcResponse resp = new XmlRpcResponse(); | 647 | XmlRpcResponse resp = new XmlRpcResponse(); |
666 | 648 | ||
667 | if (banned) | 649 | if (!m_regionLoginsEnabled) |
668 | { | 650 | { |
669 | m_log.InfoFormat("[CLIENT]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname); | 651 | m_log.InfoFormat( |
652 | "[CLIENT]: Denying access for user {0} {1} because region login is currently disabled", | ||
653 | agentData.firstname, agentData.lastname); | ||
670 | 654 | ||
671 | Hashtable respdata = new Hashtable(); | 655 | Hashtable respdata = new Hashtable(); |
672 | respdata["success"] = "FALSE"; | 656 | respdata["success"] = "FALSE"; |
673 | respdata["reason"] = "banned"; | 657 | respdata["reason"] = "region login currently disabled"; |
674 | resp.Value = respdata; | 658 | resp.Value = respdata; |
675 | } | 659 | } |
676 | else | 660 | else |
677 | { | 661 | { |
678 | m_localBackend.TriggerExpectUser(regionHandle, agentData); | 662 | RegionInfo[] regions = m_regionsOnInstance.ToArray(); |
679 | Hashtable respdata = new Hashtable(); | 663 | bool banned = false; |
680 | respdata["success"] = "TRUE"; | 664 | |
681 | resp.Value = respdata; | 665 | for (int i = 0; i < regions.Length; i++) |
666 | { | ||
667 | if (regions[i] != null) | ||
668 | { | ||
669 | if (regions[i].RegionHandle == regionHandle) | ||
670 | { | ||
671 | if (regions[i].EstateSettings.IsBanned(agentData.AgentID)) | ||
672 | { | ||
673 | banned = true; | ||
674 | break; | ||
675 | } | ||
676 | } | ||
677 | } | ||
678 | } | ||
679 | |||
680 | if (banned) | ||
681 | { | ||
682 | m_log.InfoFormat( | ||
683 | "[CLIENT]: Denying access for user {0} {1} because user is banned", | ||
684 | agentData.firstname, agentData.lastname); | ||
685 | |||
686 | Hashtable respdata = new Hashtable(); | ||
687 | respdata["success"] = "FALSE"; | ||
688 | respdata["reason"] = "banned"; | ||
689 | resp.Value = respdata; | ||
690 | } | ||
691 | else | ||
692 | { | ||
693 | m_localBackend.TriggerExpectUser(regionHandle, agentData); | ||
694 | Hashtable respdata = new Hashtable(); | ||
695 | respdata["success"] = "TRUE"; | ||
696 | resp.Value = respdata; | ||
697 | } | ||
682 | } | 698 | } |
683 | 699 | ||
684 | return resp; | 700 | return resp; |
685 | } | 701 | } |
702 | |||
686 | // Grid Request Processing | 703 | // Grid Request Processing |
687 | /// <summary> | 704 | /// <summary> |
688 | /// Ooops, our Agent must be dead if we're getting this request! | 705 | /// Ooops, our Agent must be dead if we're getting this request! |