aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/DataSnapshot/DataSnapshotManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/DataSnapshot/DataSnapshotManager.cs')
-rw-r--r--OpenSim/Region/DataSnapshot/DataSnapshotManager.cs29
1 files changed, 28 insertions, 1 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 @@
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.IO; 31using System.IO;
32using System.Linq;
32using System.Net; 33using System.Net;
33using System.Reflection; 34using System.Reflection;
35using System.Text;
34using System.Xml; 36using System.Xml;
35using log4net; 37using log4net;
36using Nini.Config; 38using 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