diff options
-rw-r--r-- | OpenSim/Region/Communications/Hypergrid/HGGridServices.cs | 119 |
1 files changed, 44 insertions, 75 deletions
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 | |||
729 | } | 729 | } |
730 | else | 730 | else |
731 | { | 731 | { |
732 | RegionInfo[] regions = m_regionsOnInstance.ToArray(); | 732 | // Finally, everything looks ok |
733 | //bool banned = false; | 733 | //Console.WriteLine("XXX---- EVERYTHING OK ---XXX"); |
734 | // Just check one region. We assume they all belong to the same estate. | ||
735 | if ((regions.Length > 0) && (regions[0].EstateSettings.IsBanned(userData.ID))) | ||
736 | { | ||
737 | m_log.InfoFormat( | ||
738 | "[HGrid]: Denying access for user {0} {1} because user is banned", | ||
739 | userData.FirstName, userData.SurName); | ||
740 | |||
741 | Hashtable respdata = new Hashtable(); | ||
742 | respdata["success"] = "FALSE"; | ||
743 | respdata["reason"] = "banned"; | ||
744 | resp.Value = respdata; | ||
745 | } | ||
746 | else | ||
747 | { | ||
748 | // Finally, everything looks ok | ||
749 | //Console.WriteLine("XXX---- EVERYTHING OK ---XXX"); | ||
750 | 734 | ||
751 | // Nope, let's do it only for the *agent* | 735 | // 1 - Preload the user data |
752 | //// 0 - Switch name if necessary | 736 | m_userProfileCache.PreloadUserCache(userData.ID, userData); |
753 | //if (IsComingHome(userData)) | ||
754 | //{ | ||
755 | // string[] parts = userData.FirstName.Split( new char[] {'.'}); | ||
756 | // if (parts.Length >= 1) | ||
757 | // userData.FirstName = parts[0]; | ||
758 | // if (parts.Length == 2) | ||
759 | // userData.SurName = parts[1]; | ||
760 | // else | ||
761 | // m_log.Warn("[HGrid]: Something fishy with user " + userData.FirstName + userData.SurName); | ||
762 | |||
763 | // m_log.Info("[HGrid]: Welcome home, " + userData.FirstName + " " + userData.SurName); | ||
764 | //} | ||
765 | 737 | ||
766 | // 1 - Preload the user data | 738 | if (m_knownRegions.ContainsKey(userData.ID)) |
767 | m_userProfileCache.PreloadUserCache(userData.ID, userData); | 739 | { |
768 | 740 | // This was left here when the user departed | |
769 | if (m_knownRegions.ContainsKey(userData.ID)) | 741 | m_knownRegions.Remove(userData.ID); |
770 | { | 742 | } |
771 | // This was left here when the user departed | ||
772 | m_knownRegions.Remove(userData.ID); | ||
773 | } | ||
774 | 743 | ||
775 | // 2 - Load the region info into list of known regions | 744 | // 2 - Load the region info into list of known regions |
776 | RegionInfo rinfo = new RegionInfo(); | 745 | RegionInfo rinfo = new RegionInfo(); |
777 | rinfo.RegionID = userData.HomeRegionID; | 746 | rinfo.RegionID = userData.HomeRegionID; |
778 | rinfo.ExternalHostName = userData.UserHomeAddress; | 747 | rinfo.ExternalHostName = userData.UserHomeAddress; |
779 | rinfo.HttpPort = Convert.ToUInt32(userData.UserHomePort); | 748 | rinfo.HttpPort = Convert.ToUInt32(userData.UserHomePort); |
780 | rinfo.RemotingPort = Convert.ToUInt32(userData.UserHomeRemotingPort); | 749 | rinfo.RemotingPort = Convert.ToUInt32(userData.UserHomeRemotingPort); |
781 | rinfo.RegionID = userData.HomeRegionID; | 750 | rinfo.RegionID = userData.HomeRegionID; |
782 | // X=0 on the map | 751 | // X=0 on the map |
783 | rinfo.RegionLocX = 0; | 752 | rinfo.RegionLocX = 0; |
784 | rinfo.RegionLocY = (uint)(random.Next(0, Int32.MaxValue)); //(uint)m_knownRegions.Count; | 753 | rinfo.RegionLocY = (uint)(random.Next(0, Int32.MaxValue)); //(uint)m_knownRegions.Count; |
785 | rinfo.regionSecret = userRegionHandle.ToString(); | 754 | rinfo.regionSecret = userRegionHandle.ToString(); |
786 | //Console.WriteLine("XXX--- Here: handle = " + rinfo.regionSecret); | 755 | //Console.WriteLine("XXX--- Here: handle = " + rinfo.regionSecret); |
787 | try | 756 | try |
788 | { | 757 | { |
789 | rinfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport); | 758 | rinfo.InternalEndPoint = new IPEndPoint(IPAddress.Parse("0.0.0.0"), (int)userhomeinternalport); |
790 | } | 759 | } |
791 | catch (Exception e) | 760 | catch (Exception e) |
792 | { | 761 | { |
793 | m_log.Warn("[HGrid]: Exception while constructing internal endpoint: " + e); | 762 | m_log.Warn("[HGrid]: Exception while constructing internal endpoint: " + e); |
794 | } | 763 | } |
795 | rinfo.RemotingAddress = rinfo.ExternalEndPoint.Address.ToString(); //userData.UserHomeAddress; | 764 | rinfo.RemotingAddress = rinfo.ExternalEndPoint.Address.ToString(); //userData.UserHomeAddress; |
796 | 765 | ||
797 | if (!IsComingHome(userData)) | 766 | if (!IsComingHome(userData)) |
798 | { | 767 | { |
799 | // Change the user's home region here!!! | 768 | // Change the user's home region here!!! |
800 | userData.HomeRegion = rinfo.RegionHandle; | 769 | userData.HomeRegion = rinfo.RegionHandle; |
801 | } | 770 | } |
802 | 771 | ||
803 | if (!m_knownRegions.ContainsKey(userData.ID)) | 772 | if (!m_knownRegions.ContainsKey(userData.ID)) |
804 | m_knownRegions.Add(userData.ID, rinfo); | 773 | m_knownRegions.Add(userData.ID, rinfo); |
805 | 774 | ||
806 | // 3 - Send the reply | 775 | // 3 - Send the reply |
807 | Hashtable respdata = new Hashtable(); | 776 | Hashtable respdata = new Hashtable(); |
808 | respdata["success"] = "TRUE"; | 777 | respdata["success"] = "TRUE"; |
809 | resp.Value = respdata; | 778 | resp.Value = respdata; |
810 | 779 | ||
811 | DumpUserData(userData); | 780 | DumpUserData(userData); |
812 | DumpRegionData(rinfo); | 781 | DumpRegionData(rinfo); |
813 | } | 782 | |
814 | } | 783 | } |
815 | 784 | ||
816 | return resp; | 785 | return resp; |