aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Communications
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Communications')
-rw-r--r--OpenSim/Region/Communications/OGS1/OGS1GridServices.cs70
1 files changed, 66 insertions, 4 deletions
diff --git a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
index bbb3163..f7de887 100644
--- a/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
+++ b/OpenSim/Region/Communications/OGS1/OGS1GridServices.cs
@@ -55,10 +55,14 @@ namespace OpenSim.Region.Communications.OGS1
55 private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>(); 55 private List<SimpleRegionInfo> m_knownRegions = new List<SimpleRegionInfo>();
56 private Dictionary<ulong, int> m_deadRegionCache = new Dictionary<ulong, int>(); 56 private Dictionary<ulong, int> m_deadRegionCache = new Dictionary<ulong, int>();
57 private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>(); 57 private Dictionary<string, string> m_queuedGridSettings = new Dictionary<string, string>();
58 private List<RegionInfo> m_regionsOnInstance = new List<RegionInfo>();
59
60
58 61
59 public BaseHttpServer httpListener; 62 public BaseHttpServer httpListener;
60 public NetworkServersInfo serversInfo; 63 public NetworkServersInfo serversInfo;
61 public BaseHttpServer httpServer; 64 public BaseHttpServer httpServer;
65
62 public string _gdebugRegionName = String.Empty; 66 public string _gdebugRegionName = String.Empty;
63 67
64 public string gdebugRegionName 68 public string gdebugRegionName
@@ -95,6 +99,8 @@ namespace OpenSim.Region.Communications.OGS1
95 // see IGridServices 99 // see IGridServices
96 public RegionCommsListener RegisterRegion(RegionInfo regionInfo) 100 public RegionCommsListener RegisterRegion(RegionInfo regionInfo)
97 { 101 {
102 m_regionsOnInstance.Add(regionInfo);
103
98 m_log.InfoFormat( 104 m_log.InfoFormat(
99 "[OGS1 GRID SERVICES]: Attempting to register region {0} with grid at {1}", 105 "[OGS1 GRID SERVICES]: Attempting to register region {0} with grid at {1}",
100 regionInfo.RegionName, serversInfo.GridURL); 106 regionInfo.RegionName, serversInfo.GridURL);
@@ -606,12 +612,47 @@ namespace OpenSim.Region.Communications.OGS1
606 612
607 ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]); 613 ulong regionHandle = Convert.ToUInt64((string) requestData["regionhandle"]);
608 614
609 m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString());
610 m_localBackend.TriggerExpectUser(regionHandle, agentData);
611 615
612 m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user..."); 616 RegionInfo[] regions = m_regionsOnInstance.ToArray();
617 bool banned = false;
613 618
614 return new XmlRpcResponse(); 619 for (int i = 0; i < regions.Length; i++)
620 {
621 if (regions[i] != null)
622 {
623 if (regions[i].RegionHandle == regionHandle)
624 {
625 if (regions[i].CheckIfUserBanned(agentData.AgentID))
626 {
627 banned = true;
628 break;
629 }
630 }
631 }
632 }
633
634 XmlRpcResponse resp = new XmlRpcResponse();
635
636 if (banned)
637 {
638 m_log.InfoFormat("[OGS1 GRID SERVICES]: Denying access for user {0} {1} because user is banned",agentData.firstname,agentData.lastname);
639
640 Hashtable respdata = new Hashtable();
641 respdata["success"] = "FALSE";
642 respdata["reason"] = "banned";
643 resp.Value = respdata;
644 }
645 else
646 {
647 m_log.Debug("[CONNECTION DEBUGGING]: Triggering welcome for " + agentData.AgentID.ToString() + " into " + regionHandle.ToString());
648 m_localBackend.TriggerExpectUser(regionHandle, agentData);
649 m_log.Info("[OGS1 GRID SERVICES]: Welcoming new user...");
650 Hashtable respdata = new Hashtable();
651 respdata["success"] = "TRUE";
652 resp.Value = respdata;
653
654 }
655 return resp;
615 } 656 }
616 // Grid Request Processing 657 // Grid Request Processing
617 /// <summary> 658 /// <summary>
@@ -1107,6 +1148,27 @@ namespace OpenSim.Region.Communications.OGS1
1107 /// <returns></returns> 1148 /// <returns></returns>
1108 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying) 1149 public bool ExpectAvatarCrossing(ulong regionHandle, LLUUID agentID, LLVector3 position, bool isFlying)
1109 { 1150 {
1151 RegionInfo[] regions = m_regionsOnInstance.ToArray();
1152 bool banned = false;
1153
1154 for (int i = 0; i < regions.Length; i++)
1155 {
1156 if (regions[i] != null)
1157 {
1158 if (regions[i].RegionHandle == regionHandle)
1159 {
1160 if (regions[i].CheckIfUserBanned(agentID))
1161 {
1162 banned = true;
1163 break;
1164 }
1165 }
1166 }
1167 }
1168
1169 if (banned)
1170 return false;
1171
1110 RegionInfo regInfo = null; 1172 RegionInfo regInfo = null;
1111 try 1173 try
1112 { 1174 {