aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-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))