From 19b26811c88e7b0c243a47b9f6e978ad092a1333 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 12 Nov 2020 04:27:39 +0000 Subject: [PATCH] send it to regions --- OpenSim/Framework/GridInfo.cs | 4 +-- OpenSim/Services/GridService/GridService.cs | 28 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/GridInfo.cs b/OpenSim/Framework/GridInfo.cs index 3573a5cf90..cc5ae09ec8 100644 --- a/OpenSim/Framework/GridInfo.cs +++ b/OpenSim/Framework/GridInfo.cs @@ -656,9 +656,9 @@ namespace OpenSim.Framework } if (m_gateKeeperAlias != null && m_gateKeeperAlias.Count > 0) { - m_gridUrlAlias = new string[m_homeURLAlias.Count]; + m_gridUrlAlias = new string[m_gateKeeperAlias.Count]; int i = 0; - foreach (OSHHTPHost a in m_homeURLAlias) + foreach (OSHHTPHost a in m_gateKeeperAlias) m_gridUrlAlias[i++] = a.URI; } } diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index c7be76ac8d..a226437873 100755 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -29,6 +29,7 @@ using System; using System.Collections.Generic; using System.Net; using System.Reflection; +using System.Text; using Nini.Config; using log4net; using OpenSim.Framework; @@ -186,6 +187,33 @@ namespace OpenSim.Services.GridService m_ExtraFeatures["GridName"] = configVal; m_ExtraFeatures["ExportSupported"] = gridConfig.GetString("ExportSupported", "true"); + + string[] sections = new string[] { "Const, Startup", "Hypergrid", "GatekeeperService" }; + string gatekeeperURIAlias = Util.GetConfigVarFromSections(config, "GatekeeperURIAlias", sections, string.Empty); + + if (!string.IsNullOrWhiteSpace(gatekeeperURIAlias)) + { + string[] alias = gatekeeperURIAlias.Split(','); + if(alias.Length > 0) + { + StringBuilder sb = osStringBuilderCache.Acquire(); + int last = alias.Length -1; + for (int i = 0; i < alias.Length; ++i) + { + OSHHTPHost tmp = new OSHHTPHost(alias[i], false); + if (tmp.IsValidHost) + { + sb.Append(tmp.URI); + if(i < last) + sb.Append(','); + } + } + if(sb.Length > 0) + m_ExtraFeatures["GridURLAlias"] = osStringBuilderCache.GetStringAndRelease(sb); + else + osStringBuilderCache.Release(sb); + } + } } #region IGridService