* One change in SQLiteLocalStorage
* Committing half-started Berkeley BDB bindings, however not adding to solution or prebuild (will/should not compile yet)0.1-prestable
parent
1747d49d71
commit
6e60d1e17f
|
@ -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 <organization> 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 <copyright holder> ``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 <copyright holder> 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProductVersion>8.0.50727</ProductVersion>
|
||||||
|
<SchemaVersion>2.0</SchemaVersion>
|
||||||
|
<ProjectGuid>{5D7AB19E-5673-4DDB-8B6B-E3105B826CB4}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>OpenSim.Storage.LocalStorageBerkeleyDB</RootNamespace>
|
||||||
|
<AssemblyName>OpenSim.Storage.LocalStorageBerkeleyDB</AssemblyName>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="Kds.Serialization, Version=0.8.1.26141, Culture=neutral, PublicKeyToken=07e6449d79bffb34, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>bin\Kds.Serialization.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="libdb_dotNET43, Version=0.9.1.26139, Culture=neutral, PublicKeyToken=0f0d57806cebdc08, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>bin\libdb_dotNET43.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="libsecondlife, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||||
|
<SpecificVersion>False</SpecificVersion>
|
||||||
|
<HintPath>..\bin\libsecondlife.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="BDBLocalStorage.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj">
|
||||||
|
<Project>{A7CD0630-0000-0000-0000-000000000000}</Project>
|
||||||
|
<Name>OpenSim.Framework.Console</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\OpenSim.Framework\OpenSim.Framework.csproj">
|
||||||
|
<Project>{8ACA2445-0000-0000-0000-000000000000}</Project>
|
||||||
|
<Name>OpenSim.Framework</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
|
@ -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")]
|
Binary file not shown.
Binary file not shown.
|
@ -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
|
|
@ -47,7 +47,7 @@ namespace OpenSim.Storage.LocalStorageSQLite
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string connectionstring = "URI=file:localsim.db";
|
string connectionstring = "URI=file:localsim.sdb";
|
||||||
db = (IDbConnection)new SQLiteConnection(connectionstring);
|
db = (IDbConnection)new SQLiteConnection(connectionstring);
|
||||||
db.Open();
|
db.Open();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue