From 6df113845e5c9cecb69922221f9f2d4c235b1a28 Mon Sep 17 00:00:00 2001 From: Dr Scofield Date: Mon, 10 Nov 2008 17:37:28 +0000 Subject: 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. --- OpenSim/ApplicationPlugins/RemoteController/RemoteAdminPlugin.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim') 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 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; -- cgit v1.1