From 983c6a74b15f566a9d2290b545f2b56b74f05f58 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 23 Sep 2010 01:21:08 -0400 Subject: * Add CSharpSqlite to prebuild * Use a conditional define to determine whether we're using CSharpSqlite or Mono.Data.Sqlite #if CSharpSqlite using Community.CsharpSqlite.Sqlite; #else using Mono.Data.Sqlite; #endif * Hopefully, this will restore sqlite functionality on a Mac. In visual studio, you can edit the OpenSim.Data.SQLite project, go to the Build tab and enter CSharpSqlite in the box. I'm not sure how to define CSharpSqlite in Mono, someone better at it then me will have to take the job of figuring out the best way to define it in Mono. --- OpenSim/Data/SQLite/SQLiteAssetData.cs | 7 ++++++- OpenSim/Data/SQLite/SQLiteAuthenticationData.cs | 7 ++++++- OpenSim/Data/SQLite/SQLiteAvatarData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteEstateData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteFramework.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteFriendsData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteInventoryStore.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteUserAccountData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteUtils.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteXInventoryData.cs | 6 +++++- 12 files changed, 62 insertions(+), 12 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/SQLite/SQLiteAssetData.cs b/OpenSim/Data/SQLite/SQLiteAssetData.cs index 16e560c..5b71897 100644 --- a/OpenSim/Data/SQLite/SQLiteAssetData.cs +++ b/OpenSim/Data/SQLite/SQLiteAssetData.cs @@ -30,7 +30,12 @@ using System.Data; using System.Reflection; using System.Collections.Generic; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif + using OpenMetaverse; using OpenSim.Framework; diff --git a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs index a1412ff..c54bd74 100644 --- a/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs +++ b/OpenSim/Data/SQLite/SQLiteAuthenticationData.cs @@ -33,7 +33,12 @@ using System.Reflection; using log4net; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +using log4net; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteAvatarData.cs b/OpenSim/Data/SQLite/SQLiteAvatarData.cs index c093884..60a1a3e 100644 --- a/OpenSim/Data/SQLite/SQLiteAvatarData.cs +++ b/OpenSim/Data/SQLite/SQLiteAvatarData.cs @@ -33,7 +33,11 @@ using System.Threading; using log4net; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index d1d67eb..21556da 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -30,7 +30,11 @@ using System.Collections.Generic; using System.Data; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; diff --git a/OpenSim/Data/SQLite/SQLiteFramework.cs b/OpenSim/Data/SQLite/SQLiteFramework.cs index cf114d1..4992bcc 100644 --- a/OpenSim/Data/SQLite/SQLiteFramework.cs +++ b/OpenSim/Data/SQLite/SQLiteFramework.cs @@ -31,7 +31,11 @@ using System.Collections.Generic; using System.Data; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteFriendsData.cs b/OpenSim/Data/SQLite/SQLiteFriendsData.cs index b06853c..4bfd228 100644 --- a/OpenSim/Data/SQLite/SQLiteFriendsData.cs +++ b/OpenSim/Data/SQLite/SQLiteFriendsData.cs @@ -31,7 +31,11 @@ using System.Collections.Generic; using System.Data; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs index 9b8e2fa..0d7b001 100644 --- a/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs +++ b/OpenSim/Data/SQLite/SQLiteGenericTableHandler.cs @@ -30,7 +30,11 @@ using System.Collections.Generic; using System.Data; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenSim.Framework; using OpenSim.Region.Framework.Interfaces; diff --git a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs index ecf8e02..d606f11 100644 --- a/OpenSim/Data/SQLite/SQLiteInventoryStore.cs +++ b/OpenSim/Data/SQLite/SQLiteInventoryStore.cs @@ -30,7 +30,11 @@ using System.Collections.Generic; using System.Data; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenSim.Framework; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index ebe6da8..9d49fb6 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -32,7 +32,11 @@ using System.Drawing; using System.IO; using System.Reflection; using log4net; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using OpenMetaverse; using OpenMetaverse.StructuredData; using OpenSim.Framework; diff --git a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs index 2706aea..7a5de50 100644 --- a/OpenSim/Data/SQLite/SQLiteUserAccountData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserAccountData.cs @@ -31,7 +31,11 @@ using System.Collections.Generic; using System.Data; using OpenMetaverse; using OpenSim.Framework; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteUtils.cs b/OpenSim/Data/SQLite/SQLiteUtils.cs index 07c6b69..ca5861f 100644 --- a/OpenSim/Data/SQLite/SQLiteUtils.cs +++ b/OpenSim/Data/SQLite/SQLiteUtils.cs @@ -27,7 +27,11 @@ using System; using System.Data; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif namespace OpenSim.Data.SQLite { diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs index ca651e1..ccbd86e 100644 --- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs +++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs @@ -29,7 +29,11 @@ using System; using System.Data; using System.Reflection; using System.Collections.Generic; -using Mono.Data.Sqlite; +#if CSharpSqlite + using Community.CsharpSqlite.Sqlite; +#else + using Mono.Data.Sqlite; +#endif using log4net; using OpenMetaverse; using OpenSim.Framework; -- cgit v1.1 From acd5bbdb71682131be386b7a5ce1904622b0ee70 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Thu, 23 Sep 2010 01:45:54 -0400 Subject: * One more item for CSharpSqlite * Hopefully this will enable mac people to use SQLite again * Someone cooler then me will need to figure out how to define CSharpSqlite with Mono so the conditional will pick up. * There's also an error that occurs when you first load OpenSimulator under CSharpSQLite that goes away after. * The databases are not byte for byte compatible. Mono.Data.Sqlite is able to read CSharpSqlite made databases but not the reverse way. --- OpenSim/Data/SQLite/SQLiteEstateData.cs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/SQLite/SQLiteEstateData.cs b/OpenSim/Data/SQLite/SQLiteEstateData.cs index 21556da..63252aa 100644 --- a/OpenSim/Data/SQLite/SQLiteEstateData.cs +++ b/OpenSim/Data/SQLite/SQLiteEstateData.cs @@ -109,10 +109,17 @@ namespace OpenSim.Data.SQLite { EstateSettings es = new EstateSettings(); es.OnSave += StoreEstateSettings; + IDataReader r = null; + try + { + r = cmd.ExecuteReader(); + } + catch (SqliteException) + { + m_log.Error("[SQLITE]: There was an issue loading the estate settings. This can happen the first time running OpenSimulator with CSharpSqlite the first time. OpenSimulator will probably crash, restart it and it should be good to go."); + } - IDataReader r = cmd.ExecuteReader(); - - if (r.Read()) + if (r != null && r.Read()) { foreach (string name in FieldList) { -- cgit v1.1