diff --git a/OpenSim.Storage.LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim.Storage.LocalStorageBerkeleyDB/BDBLocalStorage.cs new file mode 100644 index 0000000000..9a63dc75b2 --- /dev/null +++ b/OpenSim.Storage.LocalStorageBerkeleyDB/BDBLocalStorage.cs @@ -0,0 +1,90 @@ +/* +* Copyright (c) OpenSim project, http://sim.opensecondlife.org/ +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +* +*/ + +// BDB Support +// Apparently broken on Mono + +using System; +using System.Collections.Generic; +using System.Data; +using libsecondlife; +using OpenSim.Framework.Interfaces; +using OpenSim.Framework.Assets; +using OpenSim.Framework.Terrain; +using BerkeleyDb; +using Kds.Serialization; +using Kds.Serialization.Buffer; + +namespace OpenSim.Storage.LocalStorageBDB +{ + public class BDBLocalStorage : ILocalStorage + { + const string simDbName = "localsim.db"; + + DbHash sim; + Db DB; + BEFormatter formatter; + + public BDBLocalStorage() + { + DB = new Db(DbCreateFlags.None); + sim = (DbHash)DB.Open(null, simDbName, null, BerkeleyDb.DbType.Hash, Db.OpenFlags.Create, 0); + //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); + } + + public void StorePrim(PrimData prim) + { + DbEntry key = new DbEntry(); + DbEntry data = new DbEntry(); + lock (sim) + { + sim.PutUnique(null, key, data, DbFile.WriteFlags.AutoCommit); + } + } + public void RemovePrim(LLUUID primID) + { + + } + public void LoadPrimitives(ILocalStorageReceiver receiver) + { + + } + public float[] LoadWorld() + { + return new float[65536]; + } + public void SaveMap(float[] heightmap) + { + + } + public void ShutDown() + { + sim.GetDb().Close(); + DB.Close(); + } + } +} \ No newline at end of file diff --git a/OpenSim.Storage.LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj b/OpenSim.Storage.LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj new file mode 100644 index 0000000000..4d2856acb6 --- /dev/null +++ b/OpenSim.Storage.LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj @@ -0,0 +1,69 @@ + + + Debug + AnyCPU + 8.0.50727 + 2.0 + {5D7AB19E-5673-4DDB-8B6B-E3105B826CB4} + Library + Properties + OpenSim.Storage.LocalStorageBerkeleyDB + OpenSim.Storage.LocalStorageBerkeleyDB + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + False + bin\Kds.Serialization.dll + + + False + bin\libdb_dotNET43.dll + + + False + ..\bin\libsecondlife.dll + + + + + + + + + + + + {A7CD0630-0000-0000-0000-000000000000} + OpenSim.Framework.Console + + + {8ACA2445-0000-0000-0000-000000000000} + OpenSim.Framework + + + + + \ No newline at end of file diff --git a/OpenSim.Storage.LocalStorageBerkeleyDB/Properties/AssemblyInfo.cs b/OpenSim.Storage.LocalStorageBerkeleyDB/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..94f553a31c --- /dev/null +++ b/OpenSim.Storage.LocalStorageBerkeleyDB/Properties/AssemblyInfo.cs @@ -0,0 +1,35 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("OpenSim.Storage.LocalStorageBerkeleyDB")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("OpenSim.Storage.LocalStorageBerkeleyDB")] +[assembly: AssemblyCopyright("Copyright © 2007")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("e8d6c27e-1feb-4cff-b029-51c701b9330b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Revision and Build Numbers +// by using the '*' as shown below: +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/OpenSim.Storage.LocalStorageBerkeleyDB/bin/Kds.Serialization.dll b/OpenSim.Storage.LocalStorageBerkeleyDB/bin/Kds.Serialization.dll new file mode 100644 index 0000000000..7f03277c73 Binary files /dev/null and b/OpenSim.Storage.LocalStorageBerkeleyDB/bin/Kds.Serialization.dll differ diff --git a/OpenSim.Storage.LocalStorageBerkeleyDB/bin/libdb_dotNET43.dll b/OpenSim.Storage.LocalStorageBerkeleyDB/bin/libdb_dotNET43.dll new file mode 100644 index 0000000000..16a1cfc6c2 Binary files /dev/null and b/OpenSim.Storage.LocalStorageBerkeleyDB/bin/libdb_dotNET43.dll differ diff --git a/OpenSim.Storage.LocalStorageBerkeleyDB/obj/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.FileList.txt b/OpenSim.Storage.LocalStorageBerkeleyDB/obj/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.FileList.txt new file mode 100644 index 0000000000..533fee8b28 --- /dev/null +++ b/OpenSim.Storage.LocalStorageBerkeleyDB/obj/OpenSim.Storage.LocalStorageBerkeleyDB.csproj.FileList.txt @@ -0,0 +1,13 @@ +bin\Debug\OpenSim.Storage.LocalStorageBerkeleyDB.dll +bin\Debug\OpenSim.Storage.LocalStorageBerkeleyDB.pdb +bin\Debug\Kds.Serialization.dll +bin\Debug\libdb_dotNET43.dll +bin\Debug\OpenSim.Framework.Console.dll +bin\Debug\OpenSim.Framework.dll +bin\Debug\Db4objects.Db4o.dll +bin\Debug\libsecondlife.dll +bin\Debug\OpenSim.Framework.pdb +bin\Debug\OpenSim.Framework.Console.pdb +obj\Debug\ResolveAssemblyReference.cache +obj\Debug\OpenSim.Storage.LocalStorageBerkeleyDB.dll +obj\Debug\OpenSim.Storage.LocalStorageBerkeleyDB.pdb diff --git a/OpenSim.Storage.LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim.Storage.LocalStorageSQLite/SQLiteLocalStorage.cs index 4ccc8a22d5..8c9a5e1c0c 100644 --- a/OpenSim.Storage.LocalStorageSQLite/SQLiteLocalStorage.cs +++ b/OpenSim.Storage.LocalStorageSQLite/SQLiteLocalStorage.cs @@ -47,7 +47,7 @@ namespace OpenSim.Storage.LocalStorageSQLite { try { - string connectionstring = "URI=file:localsim.db"; + string connectionstring = "URI=file:localsim.sdb"; db = (IDbConnection)new SQLiteConnection(connectionstring); db.Open(); }