diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index ddaf8de73c..f7b2338612 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs @@ -29,8 +29,10 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; using System.Net; using System.Reflection; +using System.Text; using System.Xml; using log4net; using Nini.Config; @@ -131,9 +133,12 @@ namespace OpenSim.Region.DataSnapshot m_period = config.Configs["DataSnapshot"].GetInt("default_snapshot_period", m_period); m_maxStales = config.Configs["DataSnapshot"].GetInt("max_changes_before_update", m_maxStales); m_snapsDir = config.Configs["DataSnapshot"].GetString("snapshot_cache_directory", m_snapsDir); - m_dataServices = config.Configs["DataSnapshot"].GetString("data_services", m_dataServices); m_listener_port = config.Configs["Network"].GetString("http_listener_port", m_listener_port); + m_dataServices = config.Configs["DataSnapshot"].GetString("data_services", m_dataServices); + // New way of spec'ing data services, one per line + AddDataServicesVars(config.Configs["DataSnapshot"]); + String[] annoying_string_array = config.Configs["DataSnapshot"].GetString("disable_modules", "").Split(".".ToCharArray()); foreach (String bloody_wanker in annoying_string_array) { @@ -289,6 +294,28 @@ namespace OpenSim.Region.DataSnapshot return null; } + private void AddDataServicesVars(IConfig config) + { + // Make sure the services given this way aren't in m_dataServices already + List servs = new List(m_dataServices.Split(new char[] { ';' })); + + StringBuilder sb = new StringBuilder(); + string[] keys = config.GetKeys(); + + if (keys.Length > 0) + { + IEnumerable serviceKeys = keys.Where(value => value.StartsWith("DATA_SRV_")); + foreach (string serviceKey in serviceKeys) + { + string keyValue = config.GetString(serviceKey, string.Empty).Trim(); + if (!servs.Contains(keyValue)) + sb.Append(keyValue).Append(";"); + } + } + + m_dataServices = (m_dataServices == "noservices") ? sb.ToString() : sb.Append(m_dataServices).ToString(); + } + #endregion #region [Public] Snapshot storage functions diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 045fa88fa7..8714c6af73 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example @@ -797,12 +797,15 @@ ;; the data snapshots. ; snapshot_cache_directory = "DataSnapshot" + ;; [Supported, but obsolete] ;# {data_services} {index_sims:true} {Data service URLs to register with?} {} http://metaverseink.com/cgi-bin/register.py ; This semicolon-separated string serves to notify specific data services ; about the existence of this sim. Uncomment if you want to index your ; data with this and/or other search providers. ; data_services="http://metaverseink.com/cgi-bin/register.py" + ;; New way of specifying data services, one per service + ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" [Economy] ;# {SellEnabled} {} {Enable selling for 0?} {true false} true diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 20b2f0f173..654b323101 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini @@ -1389,10 +1389,9 @@ ; This will be created in bin, if it doesn't exist already. It will hold the data snapshots. snapshot_cache_directory = "DataSnapshot" - ; This semicolon-separated string serves to notify specific data services about the existence - ; of this sim. Uncomment if you want to index your data with this and/or other search providers. - ;data_services="http://metaverseink.com/cgi-bin/register.py" - + ; Uncomment if you want to index your data with this and/or other search providers. One entry per + ; data service + ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" [Economy] ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only -