diff --git a/OpenSim/Framework/GridInfo.cs b/OpenSim/Framework/GridInfo.cs index 43850596b3..f8504c6998 100644 --- a/OpenSim/Framework/GridInfo.cs +++ b/OpenSim/Framework/GridInfo.cs @@ -321,6 +321,16 @@ namespace OpenSim.Framework } } + public string HomeURLNoEndSlash + { + get + { + if (m_homeURL.URLType != UriHostNameType.Unknown) + return m_homeURL.URL.Substring(0, m_gateKeeperURL.URL.Length - 1); + return null; + } + } + // -2 dns failed // -1 if bad url // 0 if not local diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs index bfce891620..3e4ceeef79 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs @@ -57,11 +57,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess get { return m_assMapper; } } - private string m_HomeURI; private bool m_OutboundPermission; - private string m_ThisGatekeeper; private bool m_RestrictInventoryAccessAbroad; - private bool m_bypassPermissions = true; // This simple check makes it possible to support grids in which all the simulators @@ -99,13 +96,6 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess IConfig thisModuleConfig = source.Configs["HGInventoryAccessModule"]; if (thisModuleConfig != null) { - m_HomeURI = Util.GetConfigVarFromSections(source, "HomeURI", - new string[] { "Startup", "Hypergrid", "HGInventoryAccessModule" }, String.Empty); - m_ThisGatekeeper = Util.GetConfigVarFromSections(source, "GatekeeperURI", - new string[] { "Startup", "Hypergrid", "HGInventoryAccessModule" }, String.Empty); - // Legacy. Renove soon! - m_ThisGatekeeper = thisModuleConfig.GetString("Gatekeeper", m_ThisGatekeeper); - m_OutboundPermission = thisModuleConfig.GetBoolean("OutboundPermission", true); m_RestrictInventoryAccessAbroad = thisModuleConfig.GetBoolean("RestrictInventoryAccessAbroad", true); m_CheckSeparateAssets = thisModuleConfig.GetBoolean("CheckSeparateAssets", false); @@ -129,7 +119,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return; base.AddRegion(scene); - m_assMapper = new HGAssetMapper(scene, m_HomeURI); + if(!m_thisGridInfo.HasHGConfig) + { + m_Enabled = false; + return; + } + + m_assMapper = new HGAssetMapper(scene, m_thisGridInfo.HomeURLNoEndSlash); + scene.EventManager.OnNewInventoryItemUploadComplete += PostInventoryAsset; scene.EventManager.OnTeleportStart += TeleportStart; scene.EventManager.OnTeleportFail += TeleportFail; @@ -237,13 +234,13 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess prefix = "HG "; else prefix = string.Empty; - suffix = " @ " + m_ThisGatekeeper; + suffix = " @ " + m_thisGridInfo.GateKeeperURLNoEndSlash; Vector3 pos = presence.AbsolutePosition; return String.Format(Culture.FormatProvider, "Landmark version 2\nregion_id {0}\nlocal_pos {1} {2} {3}\nregion_handle {4}\ngatekeeper {5}\n", presence.Scene.RegionInfo.RegionID, pos.X, pos.Y, pos.Z, presence.RegionHandle, - m_ThisGatekeeper); + m_thisGridInfo.GateKeeperURLNoEndSlash); } diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs index 0481b4ac2b..64f1825118 100644 --- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs +++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs @@ -58,6 +58,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess protected bool m_Enabled = false; protected Scene m_Scene; + + protected GridInfo m_thisGridInfo; protected IUserManagement m_UserManagement; protected IUserManagement UserManagementModule { @@ -125,6 +127,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess return; m_Scene = scene; + if (m_thisGridInfo == null) + m_thisGridInfo = scene.SceneGridInfo; scene.RegisterModuleInterface(this); scene.EventManager.OnNewClient += OnNewClient; @@ -139,9 +143,9 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess { if (!m_Enabled) return; + m_thisGridInfo = null; } - public virtual void RemoveRegion(Scene scene) { if (!m_Enabled) diff --git a/bin/config-include/GridCommon.ini.example b/bin/config-include/GridCommon.ini.example index 56ca20934e..ee9b3aa3eb 100644 --- a/bin/config-include/GridCommon.ini.example +++ b/bin/config-include/GridCommon.ini.example @@ -178,8 +178,6 @@ ; Change this to your server ; accessible from other grids ; - HomeURI = "${Const|BaseURL}:${Const|PublicPort}" - Gatekeeper = "${Const|BaseURL}:${Const|PublicPort}" ;; If you want to protect your assets from being copied by foreign visitors ;; set this to false. You may want to do this on sims that have licensed content. ;; Default is true. diff --git a/bin/config-include/StandaloneCommon.ini.example b/bin/config-include/StandaloneCommon.ini.example index 9f5dd9f84e..2494789f54 100644 --- a/bin/config-include/StandaloneCommon.ini.example +++ b/bin/config-include/StandaloneCommon.ini.example @@ -351,10 +351,6 @@ ; DisallowImport ="LSLBytecode" [HGInventoryAccessModule] - ;; If you have these set under [Hypergrid], no need to set it here, leave it commented - ; HomeURI = "${Const|BaseURL}:${Const|PublicPort}" - ; GatekeeperURI = "${Const|BaseURL}:${Const|PublicPort}" - ;; If you want to protect your assets from being copied by foreign visitors ;; uncomment the next line. You may want to do this on sims that have licensed content. ;; true = allow exports, false = disallow exports. True by default.