From 98bfeabf94d18be8302cab181d3427a81a1e7b50 Mon Sep 17 00:00:00 2001 From: diva Date: Thu, 12 Feb 2009 02:03:36 +0000 Subject: Makes ban of HG users exactly the same as ban of local users, that is upon AddClient and not before. --- .../Communications/Hypergrid/HGGridServices.cs | 119 ++++++++------------- 1 file changed, 44 insertions(+), 75 deletions(-) (limited to 'OpenSim/Region/Communications/Hypergrid/HGGridServices.cs') diff --git a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs index 9b11a2c..d93918d 100644 --- a/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs +++ b/OpenSim/Region/Communications/Hypergrid/HGGridServices.cs @@ -729,88 +729,57 @@ namespace OpenSim.Region.Communications.Hypergrid } else { - RegionInfo[] regions = m_regionsOnInstance.ToArray(); - //bool banned = false; - // Just check one region. We assume they all belong to the same estate. - if ((regions.Length > 0) && (regions[0].EstateSettings.IsBanned(userData.ID))) - { - m_log.InfoFormat( - "[HGrid]: Denying access for user {0} {1} because user is banned", - userData.FirstName, userData.SurName); - - Hashtable respdata = new Hashtable(); - respdata["success"] = "FALSE"; - respdata["reason"] = "banned"; - resp.Value = respdata; - } - else - { - // Finally, everything looks ok - //Console.WriteLine("XXX---- EVERYTHING OK ---XXX"); + // Finally, everything looks ok + //Console.WriteLine("XXX---- EVERYTHING OK ---XXX"); - // Nope, let's do it only for the *agent* - //// 0 - Switch name if necessary - //if (IsComingHome(userData)) - //{ - // string[] parts = userData.FirstName.Split( new char[] {'.'}); - // if (parts.Length >= 1) - // userData.FirstName = parts[0]; - // if (parts.Length == 2) - // userData.SurName = parts[1]; - // else - // m_log.Warn("[HGrid]: Something fishy with user " + userData.FirstName + userData.SurName); - - // m_log.Info("[HGrid]: Welcome home, " + userData.FirstName + " " + userData.SurName); - //} + // 1 - Preload the user data + m_userProfileCache.PreloadUserCache(userData.ID, userData); - // 1 - Preload the user data - m_userProfileCache.PreloadUserCache(userData.ID, userData); - - if (m_knownRegions.ContainsKey(userData.ID)) - { - // This was left here when the user departed - m_knownRegions.Remove(userData.ID); - } + if (m_knownRegions.ContainsKey(userData.ID)) + { + // This was left here when the user departed + m_knownRegions.Remove(userData.ID); + } - // 2 - Load the region info into list of known regions - RegionInfo rinfo = new RegionInfo(); - rinfo.RegionID = userData.HomeRegionID; - rinfo.ExternalHostName = userData.UserHomeAddress; - rinfo.HttpPort = Convert.ToUInt32(userData.UserHomePort); - rinfo.RemotingPort = Convert.ToUInt32(userData.UserHomeRemotingPort); - rinfo.RegionID = userData.HomeRegionID; - // X=0 on the map - rinfo.RegionLocX = 0; - rinfo.RegionLocY = (uint)(random.Next(0, Int32.MaxValue)); //(uint)m_knownRegions.Count; - rinfo.regionSecret = userRegionHandle.ToString(); - //Console.WriteLine("XXX--- Here: handle = " + rinfo.regionSecret); - try - { - rinfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport); - } - catch (Exception e) - { - m_log.Warn("[HGrid]: Exception while constructing internal endpoint: " + e); - } - rinfo.RemotingAddress = rinfo.ExternalEndPoint.Address.ToString(); //userData.UserHomeAddress; + // 2 - Load the region info into list of known regions + RegionInfo rinfo = new RegionInfo(); + rinfo.RegionID = userData.HomeRegionID; + rinfo.ExternalHostName = userData.UserHomeAddress; + rinfo.HttpPort = Convert.ToUInt32(userData.UserHomePort); + rinfo.RemotingPort = Convert.ToUInt32(userData.UserHomeRemotingPort); + rinfo.RegionID = userData.HomeRegionID; + // X=0 on the map + rinfo.RegionLocX = 0; + rinfo.RegionLocY = (uint)(random.Next(0, Int32.MaxValue)); //(uint)m_knownRegions.Count; + rinfo.regionSecret = userRegionHandle.ToString(); + //Console.WriteLine("XXX--- Here: handle = " + rinfo.regionSecret); + try + { + rinfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport); + } + catch (Exception e) + { + m_log.Warn("[HGrid]: Exception while constructing internal endpoint: " + e); + } + rinfo.RemotingAddress = rinfo.ExternalEndPoint.Address.ToString(); //userData.UserHomeAddress; - if (!IsComingHome(userData)) - { - // Change the user's home region here!!! - userData.HomeRegion = rinfo.RegionHandle; - } + if (!IsComingHome(userData)) + { + // Change the user's home region here!!! + userData.HomeRegion = rinfo.RegionHandle; + } - if (!m_knownRegions.ContainsKey(userData.ID)) - m_knownRegions.Add(userData.ID, rinfo); + if (!m_knownRegions.ContainsKey(userData.ID)) + m_knownRegions.Add(userData.ID, rinfo); - // 3 - Send the reply - Hashtable respdata = new Hashtable(); - respdata["success"] = "TRUE"; - resp.Value = respdata; + // 3 - Send the reply + Hashtable respdata = new Hashtable(); + respdata["success"] = "TRUE"; + resp.Value = respdata; - DumpUserData(userData); - DumpRegionData(rinfo); - } + DumpUserData(userData); + DumpRegionData(rinfo); + } return resp; -- cgit v1.1