diff options
author | Sean Dague | 2008-04-23 19:13:06 +0000 |
---|---|---|
committer | Sean Dague | 2008-04-23 19:13:06 +0000 |
commit | a1cc0e436ff9081f3c0a76de861ed0673cd36142 (patch) | |
tree | 31d775f3e17109b5b6765e89b73da9f036172328 /OpenSim/Data | |
parent | * Fix a console issue where pressing return on some operating systems cause t... (diff) | |
download | opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.zip opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.tar.gz opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.tar.bz2 opensim-SC_OLD-a1cc0e436ff9081f3c0a76de861ed0673cd36142.tar.xz |
changes to allow asset_source to be specified in the opensim.ini
this will work for sqlite and nhibernate, but will be ignored for
mysql and mssql (reverting to their ini files) until someone writes
that bit.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Data/AssetDataBase.cs | 1 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLAssetData.cs | 7 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 7 | ||||
-rw-r--r-- | OpenSim/Data/NHibernate/NHibernateAssetData.cs | 16 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteAssetData.cs | 9 |
5 files changed, 32 insertions, 8 deletions
diff --git a/OpenSim/Data/AssetDataBase.cs b/OpenSim/Data/AssetDataBase.cs index b30ae73..e3b5c25 100644 --- a/OpenSim/Data/AssetDataBase.cs +++ b/OpenSim/Data/AssetDataBase.cs | |||
@@ -40,6 +40,7 @@ namespace OpenSim.Data | |||
40 | 40 | ||
41 | public abstract string Version { get; } | 41 | public abstract string Version { get; } |
42 | public abstract string Name { get; } | 42 | public abstract string Name { get; } |
43 | public abstract void Initialise(string connect); | ||
43 | public abstract void Initialise(); | 44 | public abstract void Initialise(); |
44 | } | 45 | } |
45 | } | 46 | } |
diff --git a/OpenSim/Data/MSSQL/MSSQLAssetData.cs b/OpenSim/Data/MSSQL/MSSQLAssetData.cs index 2029b80..d837e4e 100644 --- a/OpenSim/Data/MSSQL/MSSQLAssetData.cs +++ b/OpenSim/Data/MSSQL/MSSQLAssetData.cs | |||
@@ -191,6 +191,13 @@ namespace OpenSim.Data.MSSQL | |||
191 | 191 | ||
192 | #region IPlugin Members | 192 | #region IPlugin Members |
193 | 193 | ||
194 | override public void Initialise(string connect) | ||
195 | { | ||
196 | // TODO: this would allow you to pass in connnect info as | ||
197 | // a string instead of file, if someone writes the support | ||
198 | Initialise(); | ||
199 | } | ||
200 | |||
194 | override public void Initialise() | 201 | override public void Initialise() |
195 | { | 202 | { |
196 | IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini"); | 203 | IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini"); |
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 111f7d1..b6545d7 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -170,6 +170,13 @@ namespace OpenSim.Data.MySQL | |||
170 | 170 | ||
171 | #region IPlugin Members | 171 | #region IPlugin Members |
172 | 172 | ||
173 | override public void Initialise(string connect) | ||
174 | { | ||
175 | // TODO: This will let you pass in the connect string in | ||
176 | // the config, though someone will need to write that. | ||
177 | Initialise(); | ||
178 | } | ||
179 | |||
173 | override public void Initialise() | 180 | override public void Initialise() |
174 | { | 181 | { |
175 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); | 182 | IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); |
diff --git a/OpenSim/Data/NHibernate/NHibernateAssetData.cs b/OpenSim/Data/NHibernate/NHibernateAssetData.cs index db90d09..7bd4a0b 100644 --- a/OpenSim/Data/NHibernate/NHibernateAssetData.cs +++ b/OpenSim/Data/NHibernate/NHibernateAssetData.cs | |||
@@ -50,18 +50,24 @@ namespace OpenSim.Data.NHibernate | |||
50 | 50 | ||
51 | public override void Initialise() | 51 | public override void Initialise() |
52 | { | 52 | { |
53 | // TODO: hard coding for sqlite based stuff to begin with, just making it easier to test | 53 | Initialise("SQLiteDialect;SqliteClientDriver;URI=file:Asset.db,version=3"); |
54 | } | ||
54 | 55 | ||
56 | public override void Initialise(string connect) | ||
57 | { | ||
58 | // TODO: hard coding for sqlite based stuff to begin with, just making it easier to test | ||
59 | char[] split = {';'}; | ||
60 | string[] parts = connect.Split(split); | ||
61 | |||
55 | // This is stubbing for now, it will become dynamic later and support different db backends | 62 | // This is stubbing for now, it will become dynamic later and support different db backends |
56 | cfg = new Configuration(); | 63 | cfg = new Configuration(); |
57 | cfg.SetProperty(Environment.ConnectionProvider, | 64 | cfg.SetProperty(Environment.ConnectionProvider, |
58 | "NHibernate.Connection.DriverConnectionProvider"); | 65 | "NHibernate.Connection.DriverConnectionProvider"); |
59 | cfg.SetProperty(Environment.Dialect, | 66 | cfg.SetProperty(Environment.Dialect, |
60 | "NHibernate.Dialect.SQLiteDialect"); | 67 | "NHibernate.Dialect." + parts[0]); |
61 | cfg.SetProperty(Environment.ConnectionDriver, | 68 | cfg.SetProperty(Environment.ConnectionDriver, |
62 | "NHibernate.Driver.SqliteClientDriver"); | 69 | "NHibernate.Driver." + parts[1]); |
63 | cfg.SetProperty(Environment.ConnectionString, | 70 | cfg.SetProperty(Environment.ConnectionString, parts[2]); |
64 | "URI=file:Asset.db,version=3"); | ||
65 | cfg.AddAssembly("OpenSim.Data.NHibernate"); | 71 | cfg.AddAssembly("OpenSim.Data.NHibernate"); |
66 | 72 | ||
67 | HbmSerializer.Default.Validate = true; | 73 | HbmSerializer.Default.Validate = true; |
diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 2b63d2b..0d8b468 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs | |||
@@ -56,9 +56,12 @@ namespace OpenSim.Data.SQLite | |||
56 | 56 | ||
57 | private SqliteConnection m_conn; | 57 | private SqliteConnection m_conn; |
58 | 58 | ||
59 | public void Initialise(string dbfile, string dbname) | 59 | override public void Initialise(string dbconnect) |
60 | { | 60 | { |
61 | m_conn = new SqliteConnection("URI=file:" + dbfile + ",version=3"); | 61 | if (dbconnect == string.Empty) { |
62 | dbconnect = "URI=file:AssetStorage.db,version=3"; | ||
63 | } | ||
64 | m_conn = new SqliteConnection(dbconnect); | ||
62 | m_conn.Open(); | 65 | m_conn.Open(); |
63 | TestTables(m_conn); | 66 | TestTables(m_conn); |
64 | return; | 67 | return; |
@@ -289,7 +292,7 @@ namespace OpenSim.Data.SQLite | |||
289 | 292 | ||
290 | override public void Initialise() | 293 | override public void Initialise() |
291 | { | 294 | { |
292 | Initialise("AssetStorage.db", ""); | 295 | Initialise("URI=file:AssetStorage.db,version=3"); |
293 | } | 296 | } |
294 | 297 | ||
295 | override public string Name | 298 | override public string Name |