From 79f0ac82e328e325df28f3af3d4c98a7885a44f5 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 10 Aug 2007 17:22:54 +0000 Subject: Some cleaning up and removed a few old files no longer in use. Temporary have had to rename the OpenSim.DataStore.MonoSqlite project to OpenSim.DataStore.MonoSqlite1, as I'm not sure what was done to stop the old project name being included in the VS2005 solution. Also some config changes: OpenSim now has a INI (OpenSim.ini) file that it will read some config settings from (if the ini file exists). Added Mono.Data.SqliteClient.dll so that we can use the same code for sqlite on Windows and mono/linux. (from what I can tell Mono class libraries have a MIT license so there should be no problems with us including this dll). So now to get the basic prim storage working , you need to first create the sqlite database file from the sqlite3-prims.sql in share directory. Then in the OpenSim.ini file, change the storage_plugin so it points to OpenSim.DataStore.MonoSqlite1.dll (storage_plugin = OpenSim.DataStore.MonoSqlite1.dll). Then in your region.xml files change the DataStore value so it is the name of your database file (at the moment you need a different sqlite3 database file for each region). --- OpenSim/Framework/General/Util.cs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'OpenSim/Framework/General/Util.cs') diff --git a/OpenSim/Framework/General/Util.cs b/OpenSim/Framework/General/Util.cs index f3e2a01..f3a8c73 100644 --- a/OpenSim/Framework/General/Util.cs +++ b/OpenSim/Framework/General/Util.cs @@ -32,6 +32,8 @@ using System.Net; using System.Text; using libsecondlife; +using Nini.Config; + namespace OpenSim.Framework.Utilities { public class Util @@ -313,5 +315,28 @@ namespace OpenSim.Framework.Utilities { } + + // Nini (config) related Methods + public static IConfigSource ConvertDataRowToXMLConfig(System.Data.DataRow row, string fileName) + { + if(!File.Exists(fileName)) + { + //create new file + } + XmlConfigSource config = new XmlConfigSource(fileName); + AddDataRowToConfig(config, row); + config.Save(); + + return config; + } + + public static void AddDataRowToConfig(IConfigSource config, System.Data.DataRow row) + { + config.Configs.Add((string)row[0]); + for (int i = 0; i < row.Table.Columns.Count; i++) + { + config.Configs[(string)row[0]].Set(row.Table.Columns[i].ColumnName, row[i]); + } + } } } -- cgit v1.1