diff options
author | Diva Canto | 2014-11-06 17:49:36 -0800 |
---|---|---|
committer | Diva Canto | 2014-11-06 17:49:36 -0800 |
commit | f1fc557715397ae41d5e0fa902083eb785fe4c5f (patch) | |
tree | f60e8133bda04dbb44b1020df94dd67ac476311a /OpenSim/Region/CoreModules | |
parent | Added grid information to SimFeatures response, so that the viewer can show it. (diff) | |
parent | Actually persist a changed console set agent-limit via "region set". (diff) | |
download | opensim-SC_OLD-f1fc557715397ae41d5e0fa902083eb785fe4c5f.zip opensim-SC_OLD-f1fc557715397ae41d5e0fa902083eb785fe4c5f.tar.gz opensim-SC_OLD-f1fc557715397ae41d5e0fa902083eb785fe4c5f.tar.bz2 opensim-SC_OLD-f1fc557715397ae41d5e0fa902083eb785fe4c5f.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs | 88 |
1 files changed, 87 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs index 95eca39..710c8da 100644 --- a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs | |||
@@ -87,7 +87,26 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
87 | "Regions", false, "show region", | 87 | "Regions", false, "show region", |
88 | "show region", | 88 | "show region", |
89 | "Show control information for the currently selected region (host name, max physical prim size, etc).", | 89 | "Show control information for the currently selected region (host name, max physical prim size, etc).", |
90 | "A synonym for \"region get\"", | ||
90 | HandleShowRegion); | 91 | HandleShowRegion); |
92 | |||
93 | m_console.Commands.AddCommand( | ||
94 | "Regions", false, "region get", | ||
95 | "region get", | ||
96 | "Show control information for the currently selected region (host name, max physical prim size, etc).", | ||
97 | "Some parameters can be set with the \"region set\" command.\n" | ||
98 | + "Others must be changed via a viewer (usually via the region/estate dialog box).", | ||
99 | HandleShowRegion); | ||
100 | |||
101 | m_console.Commands.AddCommand( | ||
102 | "Regions", false, "region set", | ||
103 | "region get", | ||
104 | "Set control information for the currently selected region.", | ||
105 | "Currently, the following parameters can be set:\n" | ||
106 | + "agent-limit <int> - Current root agent limit. This is persisted over restart.\n" | ||
107 | + "max-agent-limit <int> - Maximum root agent limit. agent-limit cannot exceed this." | ||
108 | + " This is not persisted over restart - to set it every time you must add a MaxAgents entry to your regions file.", | ||
109 | HandleRegionSet); | ||
91 | } | 110 | } |
92 | 111 | ||
93 | public void RemoveRegion(Scene scene) | 112 | public void RemoveRegion(Scene scene) |
@@ -123,8 +142,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
123 | dispList.AddRow("External endpoint", ri.ExternalEndPoint); | 142 | dispList.AddRow("External endpoint", ri.ExternalEndPoint); |
124 | dispList.AddRow("Internal endpoint", ri.InternalEndPoint); | 143 | dispList.AddRow("Internal endpoint", ri.InternalEndPoint); |
125 | dispList.AddRow("Access level", ri.AccessLevel); | 144 | dispList.AddRow("Access level", ri.AccessLevel); |
145 | dispList.AddRow("Agent limit", rs.AgentLimit); | ||
126 | dispList.AddRow("Max agent limit", ri.AgentCapacity); | 146 | dispList.AddRow("Max agent limit", ri.AgentCapacity); |
127 | dispList.AddRow("Current agent limit", rs.AgentLimit); | ||
128 | dispList.AddRow("Linkset capacity", ri.LinksetCapacity <= 0 ? "not set" : ri.LinksetCapacity.ToString()); | 147 | dispList.AddRow("Linkset capacity", ri.LinksetCapacity <= 0 ? "not set" : ri.LinksetCapacity.ToString()); |
129 | dispList.AddRow("Prim capacity", ri.ObjectCapacity); | 148 | dispList.AddRow("Prim capacity", ri.ObjectCapacity); |
130 | dispList.AddRow("Prim bonus", rs.ObjectBonus); | 149 | dispList.AddRow("Prim bonus", rs.ObjectBonus); |
@@ -166,6 +185,73 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands | |||
166 | MainConsole.Instance.Output(sb.ToString()); | 185 | MainConsole.Instance.Output(sb.ToString()); |
167 | } | 186 | } |
168 | 187 | ||
188 | private void HandleRegionSet(string module, string[] args) | ||
189 | { | ||
190 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) | ||
191 | return; | ||
192 | |||
193 | if (args.Length != 4) | ||
194 | { | ||
195 | MainConsole.Instance.OutputFormat("Usage: region set <param> <value>"); | ||
196 | return; | ||
197 | } | ||
198 | |||
199 | string param = args[2]; | ||
200 | string rawValue = args[3]; | ||
201 | |||
202 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) | ||
203 | return; | ||
204 | |||
205 | RegionInfo ri = m_scene.RegionInfo; | ||
206 | RegionSettings rs = ri.RegionSettings; | ||
207 | |||
208 | if (param == "agent-limit") | ||
209 | { | ||
210 | int newValue; | ||
211 | |||
212 | if (!ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, rawValue, out newValue)) | ||
213 | return; | ||
214 | |||
215 | if (newValue > ri.AgentCapacity) | ||
216 | { | ||
217 | MainConsole.Instance.OutputFormat( | ||
218 | "Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit", | ||
219 | newValue, m_scene.Name, ri.AgentCapacity); | ||
220 | } | ||
221 | else | ||
222 | { | ||
223 | rs.AgentLimit = newValue; | ||
224 | |||
225 | MainConsole.Instance.OutputFormat( | ||
226 | "{0} set to {1} in {2}", "agent-limit", newValue, m_scene.Name); | ||
227 | } | ||
228 | |||
229 | rs.Save(); | ||
230 | } | ||
231 | else if (param == "max-agent-limit") | ||
232 | { | ||
233 | int newValue; | ||
234 | |||
235 | if (!ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, rawValue, out newValue)) | ||
236 | return; | ||
237 | |||
238 | ri.AgentCapacity = newValue; | ||
239 | |||
240 | MainConsole.Instance.OutputFormat( | ||
241 | "{0} set to {1} in {2}", "max-agent-limit", newValue, m_scene.Name); | ||
242 | |||
243 | if (ri.AgentCapacity < rs.AgentLimit) | ||
244 | { | ||
245 | rs.AgentLimit = ri.AgentCapacity; | ||
246 | |||
247 | MainConsole.Instance.OutputFormat( | ||
248 | "Reducing {0} to {1} in {2}", "agent-limit", rs.AgentLimit, m_scene.Name); | ||
249 | } | ||
250 | |||
251 | rs.Save(); | ||
252 | } | ||
253 | } | ||
254 | |||
169 | private void HandleShowScene(string module, string[] cmd) | 255 | private void HandleShowScene(string module, string[] cmd) |
170 | { | 256 | { |
171 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) | 257 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) |