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 | |
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-f1fc557715397ae41d5e0fa902083eb785fe4c5f.zip opensim-SC-f1fc557715397ae41d5e0fa902083eb785fe4c5f.tar.gz opensim-SC-f1fc557715397ae41d5e0fa902083eb785fe4c5f.tar.bz2 opensim-SC-f1fc557715397ae41d5e0fa902083eb785fe4c5f.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Framework/RegionInfo.cs | 12 | ||||
-rw-r--r-- | OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs | 88 |
2 files changed, 91 insertions, 9 deletions
diff --git a/OpenSim/Framework/RegionInfo.cs b/OpenSim/Framework/RegionInfo.cs index 5911ade..cae5e51 100644 --- a/OpenSim/Framework/RegionInfo.cs +++ b/OpenSim/Framework/RegionInfo.cs | |||
@@ -127,7 +127,6 @@ namespace OpenSim.Framework | |||
127 | private int m_objectCapacity = 0; | 127 | private int m_objectCapacity = 0; |
128 | private int m_maxPrimsPerUser = -1; | 128 | private int m_maxPrimsPerUser = -1; |
129 | private int m_linksetCapacity = 0; | 129 | private int m_linksetCapacity = 0; |
130 | private int m_agentCapacity = 0; | ||
131 | private string m_regionType = String.Empty; | 130 | private string m_regionType = String.Empty; |
132 | private RegionLightShareData m_windlight = new RegionLightShareData(); | 131 | private RegionLightShareData m_windlight = new RegionLightShareData(); |
133 | protected uint m_httpPort; | 132 | protected uint m_httpPort; |
@@ -351,10 +350,7 @@ namespace OpenSim.Framework | |||
351 | get { return m_linksetCapacity; } | 350 | get { return m_linksetCapacity; } |
352 | } | 351 | } |
353 | 352 | ||
354 | public int AgentCapacity | 353 | public int AgentCapacity { get; set; } |
355 | { | ||
356 | get { return m_agentCapacity; } | ||
357 | } | ||
358 | 354 | ||
359 | public byte AccessLevel | 355 | public byte AccessLevel |
360 | { | 356 | { |
@@ -748,7 +744,7 @@ namespace OpenSim.Framework | |||
748 | 744 | ||
749 | #endregion | 745 | #endregion |
750 | 746 | ||
751 | m_agentCapacity = config.GetInt("MaxAgents", 100); | 747 | AgentCapacity = config.GetInt("MaxAgents", 100); |
752 | allKeys.Remove("MaxAgents"); | 748 | allKeys.Remove("MaxAgents"); |
753 | 749 | ||
754 | // Multi-tenancy | 750 | // Multi-tenancy |
@@ -864,8 +860,8 @@ namespace OpenSim.Framework | |||
864 | if (m_linksetCapacity > 0) | 860 | if (m_linksetCapacity > 0) |
865 | config.Set("LinksetPrims", m_linksetCapacity); | 861 | config.Set("LinksetPrims", m_linksetCapacity); |
866 | 862 | ||
867 | if (m_agentCapacity > 0) | 863 | if (AgentCapacity > 0) |
868 | config.Set("MaxAgents", m_agentCapacity); | 864 | config.Set("MaxAgents", AgentCapacity); |
869 | 865 | ||
870 | if (ScopeID != UUID.Zero) | 866 | if (ScopeID != UUID.Zero) |
871 | config.Set("ScopeID", ScopeID.ToString()); | 867 | config.Set("ScopeID", ScopeID.ToString()); |
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)) |