diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | 29 | ||||
-rw-r--r-- | bin/OpenSim.ini.example | 3 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 7 |
3 files changed, 34 insertions, 5 deletions
diff --git a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs index ddaf8de..f7b2338 100644 --- a/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs +++ b/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs | |||
@@ -29,8 +29,10 @@ | |||
29 | using System; | 29 | using System; |
30 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
31 | using System.IO; | 31 | using System.IO; |
32 | using System.Linq; | ||
32 | using System.Net; | 33 | using System.Net; |
33 | using System.Reflection; | 34 | using System.Reflection; |
35 | using System.Text; | ||
34 | using System.Xml; | 36 | using System.Xml; |
35 | using log4net; | 37 | using log4net; |
36 | using Nini.Config; | 38 | using Nini.Config; |
@@ -131,9 +133,12 @@ namespace OpenSim.Region.DataSnapshot | |||
131 | m_period = config.Configs["DataSnapshot"].GetInt("default_snapshot_period", m_period); | 133 | m_period = config.Configs["DataSnapshot"].GetInt("default_snapshot_period", m_period); |
132 | m_maxStales = config.Configs["DataSnapshot"].GetInt("max_changes_before_update", m_maxStales); | 134 | m_maxStales = config.Configs["DataSnapshot"].GetInt("max_changes_before_update", m_maxStales); |
133 | m_snapsDir = config.Configs["DataSnapshot"].GetString("snapshot_cache_directory", m_snapsDir); | 135 | m_snapsDir = config.Configs["DataSnapshot"].GetString("snapshot_cache_directory", m_snapsDir); |
134 | m_dataServices = config.Configs["DataSnapshot"].GetString("data_services", m_dataServices); | ||
135 | m_listener_port = config.Configs["Network"].GetString("http_listener_port", m_listener_port); | 136 | m_listener_port = config.Configs["Network"].GetString("http_listener_port", m_listener_port); |
136 | 137 | ||
138 | m_dataServices = config.Configs["DataSnapshot"].GetString("data_services", m_dataServices); | ||
139 | // New way of spec'ing data services, one per line | ||
140 | AddDataServicesVars(config.Configs["DataSnapshot"]); | ||
141 | |||
137 | String[] annoying_string_array = config.Configs["DataSnapshot"].GetString("disable_modules", "").Split(".".ToCharArray()); | 142 | String[] annoying_string_array = config.Configs["DataSnapshot"].GetString("disable_modules", "").Split(".".ToCharArray()); |
138 | foreach (String bloody_wanker in annoying_string_array) | 143 | foreach (String bloody_wanker in annoying_string_array) |
139 | { | 144 | { |
@@ -289,6 +294,28 @@ namespace OpenSim.Region.DataSnapshot | |||
289 | return null; | 294 | return null; |
290 | } | 295 | } |
291 | 296 | ||
297 | private void AddDataServicesVars(IConfig config) | ||
298 | { | ||
299 | // Make sure the services given this way aren't in m_dataServices already | ||
300 | List<string> servs = new List<string>(m_dataServices.Split(new char[] { ';' })); | ||
301 | |||
302 | StringBuilder sb = new StringBuilder(); | ||
303 | string[] keys = config.GetKeys(); | ||
304 | |||
305 | if (keys.Length > 0) | ||
306 | { | ||
307 | IEnumerable<string> serviceKeys = keys.Where(value => value.StartsWith("DATA_SRV_")); | ||
308 | foreach (string serviceKey in serviceKeys) | ||
309 | { | ||
310 | string keyValue = config.GetString(serviceKey, string.Empty).Trim(); | ||
311 | if (!servs.Contains(keyValue)) | ||
312 | sb.Append(keyValue).Append(";"); | ||
313 | } | ||
314 | } | ||
315 | |||
316 | m_dataServices = (m_dataServices == "noservices") ? sb.ToString() : sb.Append(m_dataServices).ToString(); | ||
317 | } | ||
318 | |||
292 | #endregion | 319 | #endregion |
293 | 320 | ||
294 | #region [Public] Snapshot storage functions | 321 | #region [Public] Snapshot storage functions |
diff --git a/bin/OpenSim.ini.example b/bin/OpenSim.ini.example index 045fa88..8714c6a 100644 --- a/bin/OpenSim.ini.example +++ b/bin/OpenSim.ini.example | |||
@@ -797,12 +797,15 @@ | |||
797 | ;; the data snapshots. | 797 | ;; the data snapshots. |
798 | ; snapshot_cache_directory = "DataSnapshot" | 798 | ; snapshot_cache_directory = "DataSnapshot" |
799 | 799 | ||
800 | ;; [Supported, but obsolete] | ||
800 | ;# {data_services} {index_sims:true} {Data service URLs to register with?} {} http://metaverseink.com/cgi-bin/register.py | 801 | ;# {data_services} {index_sims:true} {Data service URLs to register with?} {} http://metaverseink.com/cgi-bin/register.py |
801 | ; This semicolon-separated string serves to notify specific data services | 802 | ; This semicolon-separated string serves to notify specific data services |
802 | ; about the existence of this sim. Uncomment if you want to index your | 803 | ; about the existence of this sim. Uncomment if you want to index your |
803 | ; data with this and/or other search providers. | 804 | ; data with this and/or other search providers. |
804 | ; data_services="http://metaverseink.com/cgi-bin/register.py" | 805 | ; data_services="http://metaverseink.com/cgi-bin/register.py" |
805 | 806 | ||
807 | ;; New way of specifying data services, one per service | ||
808 | ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" | ||
806 | 809 | ||
807 | [Economy] | 810 | [Economy] |
808 | ;# {SellEnabled} {} {Enable selling for 0?} {true false} true | 811 | ;# {SellEnabled} {} {Enable selling for 0?} {true false} true |
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index 20b2f0f..654b323 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -1389,10 +1389,9 @@ | |||
1389 | ; This will be created in bin, if it doesn't exist already. It will hold the data snapshots. | 1389 | ; This will be created in bin, if it doesn't exist already. It will hold the data snapshots. |
1390 | snapshot_cache_directory = "DataSnapshot" | 1390 | snapshot_cache_directory = "DataSnapshot" |
1391 | 1391 | ||
1392 | ; This semicolon-separated string serves to notify specific data services about the existence | 1392 | ; Uncomment if you want to index your data with this and/or other search providers. One entry per |
1393 | ; of this sim. Uncomment if you want to index your data with this and/or other search providers. | 1393 | ; data service |
1394 | ;data_services="http://metaverseink.com/cgi-bin/register.py" | 1394 | ;DATA_SRV_MISearch = "http://metaverseink.com/cgi-bin/register.py" |
1395 | |||
1396 | 1395 | ||
1397 | [Economy] | 1396 | [Economy] |
1398 | ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - | 1397 | ; These economy values get used in the BetaGridLikeMoneyModule. - This module is for demonstration only - |