diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index d5fca71dff..38fa8900d7 100644 --- a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs +++ b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs @@ -94,15 +94,14 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid private void InitialiseService(IConfigSource source) { - IConfig assetConfig = source.Configs["GridService"]; - if (assetConfig == null) + IConfig config = source.Configs["GridService"]; + if (config == null) { m_log.Error("[LOCAL GRID SERVICE CONNECTOR]: GridService missing from OpenSim.ini"); return; } - string serviceDll = assetConfig.GetString("LocalServiceModule", - String.Empty); + string serviceDll = config.GetString("LocalServiceModule", String.Empty); if (serviceDll == String.Empty) { diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index aa19fc7166..2836236fb7 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -64,6 +64,9 @@ namespace OpenSim.Services.GridService m_config = config; IConfig gridConfig = config.Configs["GridService"]; + + bool suppressConsoleCommands = false; + if (gridConfig != null) { m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true); @@ -77,13 +80,17 @@ namespace OpenSim.Services.GridService } m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames); m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch); + + // This service is also used locally by a simulator running in grid mode. This switches prevents + // inappropriate console commands from being registered + suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands); } - + if (m_RootInstance == null) { m_RootInstance = this; - if (MainConsole.Instance != null) + if (!suppressConsoleCommands && MainConsole.Instance != null) { MainConsole.Instance.Commands.AddCommand("Regions", true, "deregister region id", @@ -92,17 +99,12 @@ namespace OpenSim.Services.GridService String.Empty, HandleDeregisterRegion); - // A messy way of stopping this command being added if we are in standalone (since the simulator - // has an identically named command - // - // XXX: We're relying on the OpenSimulator version being registered first, which is not well defined. - if (!MainConsole.Instance.Commands.HasCommand("show regions")) - MainConsole.Instance.Commands.AddCommand("Regions", true, - "show regions", - "show regions", - "Show details on all regions", - String.Empty, - HandleShowRegions); + MainConsole.Instance.Commands.AddCommand("Regions", true, + "show regions", + "show regions", + "Show details on all regions", + String.Empty, + HandleShowRegions); MainConsole.Instance.Commands.AddCommand("Regions", true, "show region name", @@ -132,6 +134,7 @@ namespace OpenSim.Services.GridService String.Empty, HandleSetFlags); } + m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); } } diff --git a/bin/config-include/Grid.ini b/bin/config-include/Grid.ini index 419b40d0f3..e9eaee35f4 100644 --- a/bin/config-include/Grid.ini +++ b/bin/config-include/Grid.ini @@ -55,8 +55,11 @@ LocalServiceModule = "OpenSim.Services.GridService.dll:GridService" ; for the LocalGridServicesConnector which is used by the Remote one StorageProvider = "OpenSim.Data.Null.dll:NullRegionData" - NetworkConnector = "OpenSim.Services.Connectors.dll:GridServicesConnector" + + ; Because LocalGridServicesConnector starts this service, in grid mode we need to suppress + ; the inappropriate console commands that it registers. + SuppressConsoleCommands = true [LibraryService] LocalServiceModule = "OpenSim.Services.InventoryService.dll:LibraryService"