aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2014-10-31 21:44:31 +0000
committerJustin Clark-Casey2014-10-31 21:47:12 +0000
commita05be7bd651fb48b522af1ee94e0aa602ceb480a (patch)
tree20b43829f2875d4ce64b0a053fc727f8f6f09738 /OpenSim/Region/CoreModules
parentAdd "region get" command as a synononym for "show region" console command. (diff)
downloadopensim-SC_OLD-a05be7bd651fb48b522af1ee94e0aa602ceb480a.zip
opensim-SC_OLD-a05be7bd651fb48b522af1ee94e0aa602ceb480a.tar.gz
opensim-SC_OLD-a05be7bd651fb48b522af1ee94e0aa602ceb480a.tar.bz2
opensim-SC_OLD-a05be7bd651fb48b522af1ee94e0aa602ceb480a.tar.xz
Add "region set" console command.
This current allows one to set two region parameters agent-limit <int> will set the current root agent limit for the region, as also settable through the viewer, though some impose a max setting (e.g. 100). max-agent-limit <int> will set the maximum allowed root agent limit. This can also be set via the MaxAgent parameter in region config.
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r--OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs74
1 files changed, 73 insertions, 1 deletions
diff --git a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
index c2be5c5..b0caaf9 100644
--- a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
+++ b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs
@@ -97,6 +97,15 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
97 "Some parameters can be set with the \"region set\" command.\n" 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).", 98 + "Others must be changed via a viewer (usually via the region/estate dialog box).",
99 HandleShowRegion); 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.\n"
107 + "max-agent-limit <int> - Maximum root agent limit. agent-limit cannot exceed this.",
108 HandleRegionSet);
100 } 109 }
101 110
102 public void RemoveRegion(Scene scene) 111 public void RemoveRegion(Scene scene)
@@ -132,8 +141,8 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
132 dispList.AddRow("External endpoint", ri.ExternalEndPoint); 141 dispList.AddRow("External endpoint", ri.ExternalEndPoint);
133 dispList.AddRow("Internal endpoint", ri.InternalEndPoint); 142 dispList.AddRow("Internal endpoint", ri.InternalEndPoint);
134 dispList.AddRow("Access level", ri.AccessLevel); 143 dispList.AddRow("Access level", ri.AccessLevel);
144 dispList.AddRow("Agent limit", rs.AgentLimit);
135 dispList.AddRow("Max agent limit", ri.AgentCapacity); 145 dispList.AddRow("Max agent limit", ri.AgentCapacity);
136 dispList.AddRow("Current agent limit", rs.AgentLimit);
137 dispList.AddRow("Linkset capacity", ri.LinksetCapacity <= 0 ? "not set" : ri.LinksetCapacity.ToString()); 146 dispList.AddRow("Linkset capacity", ri.LinksetCapacity <= 0 ? "not set" : ri.LinksetCapacity.ToString());
138 dispList.AddRow("Prim capacity", ri.ObjectCapacity); 147 dispList.AddRow("Prim capacity", ri.ObjectCapacity);
139 dispList.AddRow("Prim bonus", rs.ObjectBonus); 148 dispList.AddRow("Prim bonus", rs.ObjectBonus);
@@ -175,6 +184,69 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands
175 MainConsole.Instance.Output(sb.ToString()); 184 MainConsole.Instance.Output(sb.ToString());
176 } 185 }
177 186
187 private void HandleRegionSet(string module, string[] args)
188 {
189 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
190 return;
191
192 if (args.Length != 4)
193 {
194 MainConsole.Instance.OutputFormat("Usage: region set <param> <value>");
195 return;
196 }
197
198 string param = args[2];
199 string rawValue = args[3];
200
201 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))
202 return;
203
204 RegionInfo ri = m_scene.RegionInfo;
205 RegionSettings rs = ri.RegionSettings;
206
207 if (param == "agent-limit")
208 {
209 int newValue;
210
211 if (!ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, rawValue, out newValue))
212 return;
213
214 if (newValue > ri.AgentCapacity)
215 {
216 MainConsole.Instance.OutputFormat(
217 "Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit",
218 newValue, m_scene.Name, ri.AgentCapacity);
219 }
220 else
221 {
222 rs.AgentLimit = newValue;
223
224 MainConsole.Instance.OutputFormat(
225 "{0} set to {1} in {2}", "agent-limit", newValue, m_scene.Name);
226 }
227 }
228 else if (param == "max-agent-limit")
229 {
230 int newValue;
231
232 if (!ConsoleUtil.TryParseConsoleNaturalInt(MainConsole.Instance, rawValue, out newValue))
233 return;
234
235 ri.AgentCapacity = newValue;
236
237 MainConsole.Instance.OutputFormat(
238 "{0} set to {1} in {2}", "max-agent-limit", newValue, m_scene.Name);
239
240 if (ri.AgentCapacity < rs.AgentLimit)
241 {
242 rs.AgentLimit = ri.AgentCapacity;
243
244 MainConsole.Instance.OutputFormat(
245 "Reducing {0} to {1} in {2}", "agent-limit", rs.AgentLimit, m_scene.Name);
246 }
247 }
248 }
249
178 private void HandleShowScene(string module, string[] cmd) 250 private void HandleShowScene(string module, string[] cmd)
179 { 251 {
180 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) 252 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene))