diff options
author | Justin Clark-Casey (justincc) | 2014-07-18 22:57:04 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2014-07-18 22:57:04 +0100 |
commit | 6048dfcd715615c0c90b485a72ebbe2641f16d41 (patch) | |
tree | babd2cc6e4675b705d59fc390cbb30b6bb83ce83 /OpenSim | |
parent | minor: add method doc to ICommands.HasCommand() (diff) | |
download | opensim-SC-6048dfcd715615c0c90b485a72ebbe2641f16d41.zip opensim-SC-6048dfcd715615c0c90b485a72ebbe2641f16d41.tar.gz opensim-SC-6048dfcd715615c0c90b485a72ebbe2641f16d41.tar.bz2 opensim-SC-6048dfcd715615c0c90b485a72ebbe2641f16d41.tar.xz |
In grid mode, add SuppressConsoleCommands flag to [GridService] so that we can stop misleading grid service only console commands from registering.
We need to do this because the simulator initializes and internal copy of the GridService in grid mode for internal purposes
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs | 7 | ||||
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 29 |
2 files changed, 19 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs b/OpenSim/Region/CoreModules/ServiceConnectorsOut/Grid/LocalGridServiceConnector.cs index d5fca71..38fa890 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 | |||
94 | 94 | ||
95 | private void InitialiseService(IConfigSource source) | 95 | private void InitialiseService(IConfigSource source) |
96 | { | 96 | { |
97 | IConfig assetConfig = source.Configs["GridService"]; | 97 | IConfig config = source.Configs["GridService"]; |
98 | if (assetConfig == null) | 98 | if (config == null) |
99 | { | 99 | { |
100 | m_log.Error("[LOCAL GRID SERVICE CONNECTOR]: GridService missing from OpenSim.ini"); | 100 | m_log.Error("[LOCAL GRID SERVICE CONNECTOR]: GridService missing from OpenSim.ini"); |
101 | return; | 101 | return; |
102 | } | 102 | } |
103 | 103 | ||
104 | string serviceDll = assetConfig.GetString("LocalServiceModule", | 104 | string serviceDll = config.GetString("LocalServiceModule", String.Empty); |
105 | String.Empty); | ||
106 | 105 | ||
107 | if (serviceDll == String.Empty) | 106 | if (serviceDll == String.Empty) |
108 | { | 107 | { |
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index aa19fc7..2836236 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -64,6 +64,9 @@ namespace OpenSim.Services.GridService | |||
64 | 64 | ||
65 | m_config = config; | 65 | m_config = config; |
66 | IConfig gridConfig = config.Configs["GridService"]; | 66 | IConfig gridConfig = config.Configs["GridService"]; |
67 | |||
68 | bool suppressConsoleCommands = false; | ||
69 | |||
67 | if (gridConfig != null) | 70 | if (gridConfig != null) |
68 | { | 71 | { |
69 | m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true); | 72 | m_DeleteOnUnregister = gridConfig.GetBoolean("DeleteOnUnregister", true); |
@@ -77,13 +80,17 @@ namespace OpenSim.Services.GridService | |||
77 | } | 80 | } |
78 | m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames); | 81 | m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames); |
79 | m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch); | 82 | m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch); |
83 | |||
84 | // This service is also used locally by a simulator running in grid mode. This switches prevents | ||
85 | // inappropriate console commands from being registered | ||
86 | suppressConsoleCommands = gridConfig.GetBoolean("SuppressConsoleCommands", suppressConsoleCommands); | ||
80 | } | 87 | } |
81 | 88 | ||
82 | if (m_RootInstance == null) | 89 | if (m_RootInstance == null) |
83 | { | 90 | { |
84 | m_RootInstance = this; | 91 | m_RootInstance = this; |
85 | 92 | ||
86 | if (MainConsole.Instance != null) | 93 | if (!suppressConsoleCommands && MainConsole.Instance != null) |
87 | { | 94 | { |
88 | MainConsole.Instance.Commands.AddCommand("Regions", true, | 95 | MainConsole.Instance.Commands.AddCommand("Regions", true, |
89 | "deregister region id", | 96 | "deregister region id", |
@@ -92,17 +99,12 @@ namespace OpenSim.Services.GridService | |||
92 | String.Empty, | 99 | String.Empty, |
93 | HandleDeregisterRegion); | 100 | HandleDeregisterRegion); |
94 | 101 | ||
95 | // A messy way of stopping this command being added if we are in standalone (since the simulator | 102 | MainConsole.Instance.Commands.AddCommand("Regions", true, |
96 | // has an identically named command | 103 | "show regions", |
97 | // | 104 | "show regions", |
98 | // XXX: We're relying on the OpenSimulator version being registered first, which is not well defined. | 105 | "Show details on all regions", |
99 | if (!MainConsole.Instance.Commands.HasCommand("show regions")) | 106 | String.Empty, |
100 | MainConsole.Instance.Commands.AddCommand("Regions", true, | 107 | HandleShowRegions); |
101 | "show regions", | ||
102 | "show regions", | ||
103 | "Show details on all regions", | ||
104 | String.Empty, | ||
105 | HandleShowRegions); | ||
106 | 108 | ||
107 | MainConsole.Instance.Commands.AddCommand("Regions", true, | 109 | MainConsole.Instance.Commands.AddCommand("Regions", true, |
108 | "show region name", | 110 | "show region name", |
@@ -132,6 +134,7 @@ namespace OpenSim.Services.GridService | |||
132 | String.Empty, | 134 | String.Empty, |
133 | HandleSetFlags); | 135 | HandleSetFlags); |
134 | } | 136 | } |
137 | |||
135 | m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); | 138 | m_HypergridLinker = new HypergridLinker(m_config, this, m_Database); |
136 | } | 139 | } |
137 | } | 140 | } |