aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDr Scofield2008-11-10 17:37:28 +0000
committerDr Scofield2008-11-10 17:37:28 +0000
commit6df113845e5c9cecb69922221f9f2d4c235b1a28 (patch)
tree5157083e8a6ec10f14ca0be6567090ff3c079816
parentKeep dropped prims from being temp-on-rez and getting cleaned up (diff)
downloadopensim-SC_OLD-6df113845e5c9cecb69922221f9f2d4c235b1a28.zip
opensim-SC_OLD-6df113845e5c9cecb69922221f9f2d4c235b1a28.tar.gz
opensim-SC_OLD-6df113845e5c9cecb69922221f9f2d4c235b1a28.tar.bz2
opensim-SC_OLD-6df113845e5c9cecb69922221f9f2d4c235b1a28.tar.xz
this changeset adds an option to RemoteAdmin to limit the number of
regions that XmlRpcCreateRegion will create: if region_limit is != 0 then XmlRpcCreateRegion will only create a new region if the number of regions already existing is below region_limit.
Diffstat (limited to '')
-rw-r--r--OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs7
-rw-r--r--bin/OpenSim.ini.example7
2 files changed, 13 insertions, 1 deletions
diff --git a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
index 6f8ec43..1490893 100644
--- a/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
+++ b/OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs
@@ -378,6 +378,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
378 XmlRpcResponse response = new XmlRpcResponse(); 378 XmlRpcResponse response = new XmlRpcResponse();
379 Hashtable responseData = new Hashtable(); 379 Hashtable responseData = new Hashtable();
380 380
381 int m_regionLimit = m_config.GetInt("region_limit", 0);
382
381 try { 383 try {
382 Hashtable requestData = (Hashtable) request.Params[0]; 384 Hashtable requestData = (Hashtable) request.Params[0];
383 385
@@ -392,6 +394,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
392 if (!String.IsNullOrEmpty(requiredPassword) && 394 if (!String.IsNullOrEmpty(requiredPassword) &&
393 (string)requestData["password"] != requiredPassword) throw new Exception("wrong password"); 395 (string)requestData["password"] != requiredPassword) throw new Exception("wrong password");
394 396
397 // check whether we still have space left (iff we are using limits)
398 if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit)
399 throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first", m_regionLimit));
400
401
395 // extract or generate region ID now 402 // extract or generate region ID now
396 Scene scene = null; 403 Scene scene = null;
397 UUID regionID = UUID.Zero; 404 UUID regionID = UUID.Zero;
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example
index 8c9ee41..369f940 100644
--- a/bin/OpenSim.ini.example
+++ b/bin/OpenSim.ini.example
@@ -392,6 +392,12 @@ access_password = unknown
392 392
393region_file_template = "{0}x{1}-{2}.xml" 393region_file_template = "{0}x{1}-{2}.xml"
394 394
395; we can limit the number of regions that XmlRpcCreateRegion will
396;allow by setting this to a positive, non-0 number: as long as the
397;number of regions is below region_limits, XmlRpcCreateRegion will
398;succeed. setting region_limits to 0 disables the check.
399;region_limits = 0
400
395[RestPlugins] 401[RestPlugins]
396; Change this to true to enable REST Plugins. This must be true if you wish to use 402; Change this to true to enable REST Plugins. This must be true if you wish to use
397; REST Region or REST Asset and Inventory Plugins 403; REST Region or REST Asset and Inventory Plugins
@@ -472,7 +478,6 @@ msgformat = "PRIVMSG {0} : {3} - {1} of {2}"
472; [XIRC] 478; [XIRC]
473; enabled = false 479; enabled = false
474 480
475
476; Uncomment the following for experiment in world versioning 481; Uncomment the following for experiment in world versioning
477; support. This is so experimental at this point that I'm not going 482; support. This is so experimental at this point that I'm not going
478; to explain it further, you'll need to read the source code 483; to explain it further, you'll need to read the source code