mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
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.
This commit is contained in:
@@ -378,6 +378,8 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
XmlRpcResponse response = new XmlRpcResponse();
|
||||
Hashtable responseData = new Hashtable();
|
||||
|
||||
int m_regionLimit = m_config.GetInt("region_limit", 0);
|
||||
|
||||
try {
|
||||
Hashtable requestData = (Hashtable) request.Params[0];
|
||||
|
||||
@@ -392,6 +394,11 @@ namespace OpenSim.ApplicationPlugins.RemoteController
|
||||
if (!String.IsNullOrEmpty(requiredPassword) &&
|
||||
(string)requestData["password"] != requiredPassword) throw new Exception("wrong password");
|
||||
|
||||
// check whether we still have space left (iff we are using limits)
|
||||
if (m_regionLimit != 0 && m_app.SceneManager.Scenes.Count >= m_regionLimit)
|
||||
throw new Exception(String.Format("cannot instantiate new region, server capacity {0} already reached; delete regions first", m_regionLimit));
|
||||
|
||||
|
||||
// extract or generate region ID now
|
||||
Scene scene = null;
|
||||
UUID regionID = UUID.Zero;
|
||||
|
||||
Reference in New Issue
Block a user