diff options
Diffstat (limited to 'OpenSim/OpenSim.Storage')
14 files changed, 0 insertions, 1307 deletions
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs deleted file mode 100644 index 1818e3a..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/BDBLocalStorage.cs +++ /dev/null | |||
@@ -1,118 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | // BDB Support | ||
30 | // Apparently broken on Mono | ||
31 | |||
32 | using System; | ||
33 | using System.Collections.Generic; | ||
34 | using System.Data; | ||
35 | using libsecondlife; | ||
36 | using OpenSim.Framework.Interfaces; | ||
37 | using OpenSim.Framework.Types; | ||
38 | using OpenSim.Framework.Terrain; | ||
39 | using BerkeleyDb; | ||
40 | using Kds.Serialization; | ||
41 | using Kds.Serialization.Buffer; | ||
42 | |||
43 | namespace OpenSim.Storage.LocalStorageBDB | ||
44 | { | ||
45 | public class BDBLocalStorage : ILocalStorage | ||
46 | { | ||
47 | const string simDbName = "localsim.db"; | ||
48 | |||
49 | DbHash sim; | ||
50 | Db DB; | ||
51 | //BEFormatter formatter; | ||
52 | |||
53 | public BDBLocalStorage() | ||
54 | { | ||
55 | DB = new Db(DbCreateFlags.None); | ||
56 | sim = (DbHash)DB.Open(null, simDbName, null, BerkeleyDb.DbType.Hash, Db.OpenFlags.Create, 0); | ||
57 | //vendorDb = (DbBTree)db.Open(null, VendorDbName, null, DbType.BTree, Db.OpenFlags.Create, 0); | ||
58 | } | ||
59 | |||
60 | public void Initialise(string file) | ||
61 | { | ||
62 | // Blank | ||
63 | } | ||
64 | |||
65 | public void StorePrim(PrimData prim) | ||
66 | { | ||
67 | DbEntry key = new DbEntry(); | ||
68 | DbEntry data = new DbEntry(); | ||
69 | lock (sim) | ||
70 | { | ||
71 | sim.PutUnique(null, ref key, ref data, DbFile.WriteFlags.AutoCommit); | ||
72 | } | ||
73 | } | ||
74 | public void RemovePrim(LLUUID primID) | ||
75 | { | ||
76 | |||
77 | } | ||
78 | public void LoadPrimitives(ILocalStorageReceiver receiver) | ||
79 | { | ||
80 | |||
81 | } | ||
82 | public float[] LoadWorld() | ||
83 | { | ||
84 | return new float[65536]; | ||
85 | } | ||
86 | public void SaveMap(float[] heightmap) | ||
87 | { | ||
88 | |||
89 | } | ||
90 | |||
91 | public void SaveParcels(ParcelData[] parcel_data) | ||
92 | { | ||
93 | } | ||
94 | |||
95 | public void SaveParcel(ParcelData parcel) | ||
96 | { | ||
97 | } | ||
98 | |||
99 | public void RemoveParcel(ParcelData parcel) | ||
100 | { | ||
101 | } | ||
102 | |||
103 | public void RemoveAllParcels() | ||
104 | { | ||
105 | } | ||
106 | |||
107 | public void LoadParcels(ILocalStorageParcelReceiver recv) | ||
108 | { | ||
109 | recv.NoParcelDataFromStorage(); | ||
110 | } | ||
111 | |||
112 | public void ShutDown() | ||
113 | { | ||
114 | sim.GetDb().Close(); | ||
115 | DB.Close(); | ||
116 | } | ||
117 | } | ||
118 | } \ No newline at end of file | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj deleted file mode 100644 index 417643f..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.csproj +++ /dev/null | |||
@@ -1,112 +0,0 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <ProjectType>Local</ProjectType> | ||
4 | <ProductVersion>8.0.50727</ProductVersion> | ||
5 | <SchemaVersion>2.0</SchemaVersion> | ||
6 | <ProjectGuid>{EE9E5D96-0000-0000-0000-000000000000}</ProjectGuid> | ||
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
9 | <ApplicationIcon></ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | ||
11 | </AssemblyKeyContainerName> | ||
12 | <AssemblyName>OpenSim.Storage.LocalStorageBerkeleyDB</AssemblyName> | ||
13 | <DefaultClientScript>JScript</DefaultClientScript> | ||
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | ||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | ||
16 | <DelaySign>false</DelaySign> | ||
17 | <OutputType>Library</OutputType> | ||
18 | <AppDesignerFolder></AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Storage.LocalStorageBerkeleyDB</RootNamespace> | ||
20 | <StartupObject></StartupObject> | ||
21 | <FileUpgradeFlags> | ||
22 | </FileUpgradeFlags> | ||
23 | </PropertyGroup> | ||
24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
25 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
26 | <BaseAddress>285212672</BaseAddress> | ||
27 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
28 | <ConfigurationOverrideFile> | ||
29 | </ConfigurationOverrideFile> | ||
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
31 | <DocumentationFile></DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | ||
33 | <FileAlignment>4096</FileAlignment> | ||
34 | <Optimize>False</Optimize> | ||
35 | <OutputPath>..\..\..\bin\</OutputPath> | ||
36 | <RegisterForComInterop>False</RegisterForComInterop> | ||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
39 | <WarningLevel>4</WarningLevel> | ||
40 | <NoWarn></NoWarn> | ||
41 | </PropertyGroup> | ||
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
44 | <BaseAddress>285212672</BaseAddress> | ||
45 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
46 | <ConfigurationOverrideFile> | ||
47 | </ConfigurationOverrideFile> | ||
48 | <DefineConstants>TRACE</DefineConstants> | ||
49 | <DocumentationFile></DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | ||
51 | <FileAlignment>4096</FileAlignment> | ||
52 | <Optimize>True</Optimize> | ||
53 | <OutputPath>..\..\..\bin\</OutputPath> | ||
54 | <RegisterForComInterop>False</RegisterForComInterop> | ||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
57 | <WarningLevel>4</WarningLevel> | ||
58 | <NoWarn></NoWarn> | ||
59 | </PropertyGroup> | ||
60 | <ItemGroup> | ||
61 | <Reference Include="Kds.Serialization.dll" > | ||
62 | <HintPath>..\..\..\bin\Kds.Serialization.dll</HintPath> | ||
63 | <Private>False</Private> | ||
64 | </Reference> | ||
65 | <Reference Include="libdb_dotNET43.dll" > | ||
66 | <HintPath>..\..\..\bin\libdb_dotNET43.dll</HintPath> | ||
67 | <Private>False</Private> | ||
68 | </Reference> | ||
69 | <Reference Include="libsecondlife.dll" > | ||
70 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> | ||
71 | <Private>False</Private> | ||
72 | </Reference> | ||
73 | <Reference Include="System" > | ||
74 | <HintPath>System.dll</HintPath> | ||
75 | <Private>False</Private> | ||
76 | </Reference> | ||
77 | <Reference Include="System.Data" > | ||
78 | <HintPath>System.Data.dll</HintPath> | ||
79 | <Private>False</Private> | ||
80 | </Reference> | ||
81 | <Reference Include="System.Xml" > | ||
82 | <HintPath>System.Xml.dll</HintPath> | ||
83 | <Private>False</Private> | ||
84 | </Reference> | ||
85 | </ItemGroup> | ||
86 | <ItemGroup> | ||
87 | <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> | ||
88 | <Name>OpenSim.Framework</Name> | ||
89 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | ||
90 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
91 | <Private>False</Private> | ||
92 | </ProjectReference> | ||
93 | <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | ||
94 | <Name>OpenSim.Framework.Console</Name> | ||
95 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | ||
96 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
97 | <Private>False</Private> | ||
98 | </ProjectReference> | ||
99 | </ItemGroup> | ||
100 | <ItemGroup> | ||
101 | <Compile Include="BDBLocalStorage.cs"> | ||
102 | <SubType>Code</SubType> | ||
103 | </Compile> | ||
104 | </ItemGroup> | ||
105 | <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
106 | <PropertyGroup> | ||
107 | <PreBuildEvent> | ||
108 | </PreBuildEvent> | ||
109 | <PostBuildEvent> | ||
110 | </PostBuildEvent> | ||
111 | </PropertyGroup> | ||
112 | </Project> | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build b/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build deleted file mode 100644 index bc2d8ec..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageBerkeleyDB/OpenSim.Storage.LocalStorageBerkeleyDB.dll.build +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | <?xml version="1.0" ?> | ||
2 | <project name="OpenSim.Storage.LocalStorageBerkeleyDB" default="build"> | ||
3 | <target name="build"> | ||
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | ||
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | ||
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | ||
7 | <fileset basedir="${project::get-base-directory()}"> | ||
8 | </fileset> | ||
9 | </copy> | ||
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | ||
11 | <resources prefix="OpenSim.Storage.LocalStorageBerkeleyDB" dynamicprefix="true" > | ||
12 | </resources> | ||
13 | <sources failonempty="true"> | ||
14 | <include name="BDBLocalStorage.cs" /> | ||
15 | </sources> | ||
16 | <references basedir="${project::get-base-directory()}"> | ||
17 | <lib> | ||
18 | <include name="${project::get-base-directory()}" /> | ||
19 | <include name="${project::get-base-directory()}/${build.dir}" /> | ||
20 | </lib> | ||
21 | <include name="../../../bin/Kds.Serialization.dll" /> | ||
22 | <include name="../../../bin/libdb_dotNET43.dll" /> | ||
23 | <include name="../../../bin/libsecondlife.dll" /> | ||
24 | <include name="../../../bin/OpenSim.Framework.dll" /> | ||
25 | <include name="../../../bin/OpenSim.Framework.Console.dll" /> | ||
26 | <include name="System.dll" /> | ||
27 | <include name="System.Data.dll" /> | ||
28 | <include name="System.Xml.dll" /> | ||
29 | </references> | ||
30 | </csc> | ||
31 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" /> | ||
32 | <mkdir dir="${project::get-base-directory()}/../../../bin/"/> | ||
33 | <copy todir="${project::get-base-directory()}/../../../bin/"> | ||
34 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | ||
35 | <include name="*.dll"/> | ||
36 | <include name="*.exe"/> | ||
37 | </fileset> | ||
38 | </copy> | ||
39 | </target> | ||
40 | <target name="clean"> | ||
41 | <delete dir="${bin.dir}" failonerror="false" /> | ||
42 | <delete dir="${obj.dir}" failonerror="false" /> | ||
43 | </target> | ||
44 | <target name="doc" description="Creates documentation."> | ||
45 | </target> | ||
46 | </project> | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs deleted file mode 100644 index ea2b62e..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System.Reflection; | ||
29 | using System.Runtime.CompilerServices; | ||
30 | using System.Runtime.InteropServices; | ||
31 | |||
32 | // Information about this assembly is defined by the following | ||
33 | // attributes. | ||
34 | // | ||
35 | // change them to the information which is associated with the assembly | ||
36 | // you compile. | ||
37 | |||
38 | [assembly: AssemblyTitle("Db4LocalStorage")] | ||
39 | [assembly: AssemblyDescription("")] | ||
40 | [assembly: AssemblyConfiguration("")] | ||
41 | [assembly: AssemblyCompany("")] | ||
42 | [assembly: AssemblyProduct("Db4LocalStorage")] | ||
43 | [assembly: AssemblyCopyright("")] | ||
44 | [assembly: AssemblyTrademark("")] | ||
45 | [assembly: AssemblyCulture("")] | ||
46 | |||
47 | // This sets the default COM visibility of types in the assembly to invisible. | ||
48 | // If you need to expose a type to COM, use [ComVisible(true)] on that type. | ||
49 | [assembly: ComVisible(false)] | ||
50 | |||
51 | // The assembly version has following format : | ||
52 | // | ||
53 | // Major.Minor.Build.Revision | ||
54 | // | ||
55 | // You can specify all values by your own or you can build default build and revision | ||
56 | // numbers with the '*' character (the default): | ||
57 | |||
58 | [assembly: AssemblyVersion("1.0.*")] | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs deleted file mode 100644 index 46fecd0..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/Db4LocalStorage.cs +++ /dev/null | |||
@@ -1,271 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using Db4objects.Db4o; | ||
31 | using Db4objects.Db4o.Query; | ||
32 | |||
33 | using libsecondlife; | ||
34 | using OpenSim.Framework.Interfaces; | ||
35 | using OpenSim.Framework.Types; | ||
36 | using OpenSim.Framework.Terrain; | ||
37 | using OpenSim.Framework.Console; | ||
38 | |||
39 | |||
40 | namespace OpenSim.Storage.LocalStorageDb4o | ||
41 | { | ||
42 | /// <summary> | ||
43 | /// | ||
44 | /// </summary> | ||
45 | public class Db4LocalStorage : ILocalStorage | ||
46 | { | ||
47 | private IObjectContainer db; | ||
48 | private string datastore; | ||
49 | |||
50 | public Db4LocalStorage() | ||
51 | { | ||
52 | |||
53 | } | ||
54 | |||
55 | public void Initialise(string dfile) | ||
56 | { | ||
57 | OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage Opening " + dfile); | ||
58 | datastore = dfile; | ||
59 | try | ||
60 | { | ||
61 | db = Db4oFactory.OpenFile(datastore); | ||
62 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage creation"); | ||
63 | } | ||
64 | catch (Exception e) | ||
65 | { | ||
66 | db.Close(); | ||
67 | OpenSim.Framework.Console.MainConsole.Instance.Warn("Db4LocalStorage :Constructor - Exception occured"); | ||
68 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); | ||
69 | } | ||
70 | } | ||
71 | |||
72 | public void StorePrim(PrimData prim) | ||
73 | { | ||
74 | IObjectSet result = db.Query(new UUIDPrimQuery(prim.FullID)); | ||
75 | if(result.Count>0) | ||
76 | { | ||
77 | //prim already in storage | ||
78 | //so update it | ||
79 | PrimData found = (PrimData) result.Next(); | ||
80 | found.PathBegin = prim.PathBegin; | ||
81 | found.PathCurve= prim.PathCurve; | ||
82 | found.PathEnd = prim.PathEnd; | ||
83 | found.PathRadiusOffset = prim.PathRadiusOffset; | ||
84 | found.PathRevolutions = prim.PathRevolutions; | ||
85 | found.PathScaleX= prim.PathScaleX; | ||
86 | found.PathScaleY = prim.PathScaleY; | ||
87 | found.PathShearX = prim.PathShearX; | ||
88 | found.PathShearY = prim.PathShearY; | ||
89 | found.PathSkew = prim.PathSkew; | ||
90 | found.PathTaperX = prim.PathTaperX; | ||
91 | found.PathTaperY = prim.PathTaperY; | ||
92 | found.PathTwist = prim.PathTwist; | ||
93 | found.PathTwistBegin = prim.PathTwistBegin; | ||
94 | found.PCode = prim.PCode; | ||
95 | found.ProfileBegin = prim.ProfileBegin; | ||
96 | found.ProfileCurve = prim.ProfileCurve; | ||
97 | found.ProfileEnd = prim.ProfileEnd; | ||
98 | found.ProfileHollow = prim.ProfileHollow; | ||
99 | found.Position = prim.Position; | ||
100 | found.Rotation = prim.Rotation; | ||
101 | found.Texture = prim.Texture; | ||
102 | db.Set(found); | ||
103 | db.Commit(); | ||
104 | } | ||
105 | else | ||
106 | { | ||
107 | //not in storage | ||
108 | db.Set(prim); | ||
109 | db.Commit(); | ||
110 | } | ||
111 | } | ||
112 | |||
113 | public void RemovePrim(LLUUID primID) | ||
114 | { | ||
115 | IObjectSet result = db.Query(new UUIDPrimQuery(primID)); | ||
116 | if(result.Count>0) | ||
117 | { | ||
118 | PrimData found = (PrimData) result.Next(); | ||
119 | db.Delete(found); | ||
120 | } | ||
121 | } | ||
122 | |||
123 | |||
124 | public void LoadPrimitives(ILocalStorageReceiver receiver) | ||
125 | { | ||
126 | IObjectSet result = db.Get(typeof(PrimData)); | ||
127 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count); | ||
128 | foreach (PrimData prim in result) { | ||
129 | receiver.PrimFromStorage(prim); | ||
130 | } | ||
131 | } | ||
132 | |||
133 | public float[] LoadWorld() | ||
134 | { | ||
135 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Loading world...."); | ||
136 | float[] heightmap = null; | ||
137 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Looking for a heightmap in local DB"); | ||
138 | IObjectSet world_result = db.Get(typeof(MapStorage)); | ||
139 | if (world_result.Count > 0) | ||
140 | { | ||
141 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("LoadWorld() - Found a heightmap in local database, loading"); | ||
142 | MapStorage map = (MapStorage)world_result.Next(); | ||
143 | //blank.LandMap = map.Map; | ||
144 | heightmap = map.Map; | ||
145 | } | ||
146 | return heightmap; | ||
147 | } | ||
148 | |||
149 | public void SaveMap(float[] heightmap) | ||
150 | { | ||
151 | IObjectSet world_result = db.Get(typeof(MapStorage)); | ||
152 | if (world_result.Count > 0) | ||
153 | { | ||
154 | OpenSim.Framework.Console.MainConsole.Instance.Verbose("SaveWorld() - updating saved copy of heightmap in local database"); | ||
155 | MapStorage map = (MapStorage)world_result.Next(); | ||
156 | db.Delete(map); | ||
157 | } | ||
158 | MapStorage map1 = new MapStorage(); | ||
159 | map1.Map = heightmap; //OpenSim_Main.local_world.LandMap; | ||
160 | db.Set(map1); | ||
161 | db.Commit(); | ||
162 | } | ||
163 | |||
164 | public void SaveParcel(ParcelData parcel) | ||
165 | { | ||
166 | IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); | ||
167 | if (result.Count > 0) | ||
168 | { | ||
169 | //Old Parcel | ||
170 | ParcelData updateParcel = (ParcelData)result.Next(); | ||
171 | updateParcel.AABBMax = parcel.AABBMax; | ||
172 | updateParcel.AABBMin = parcel.AABBMin; | ||
173 | updateParcel.area = parcel.area; | ||
174 | updateParcel.auctionID = parcel.auctionID; | ||
175 | updateParcel.authBuyerID = parcel.authBuyerID; | ||
176 | updateParcel.category = parcel.category; | ||
177 | updateParcel.claimDate = parcel.claimDate; | ||
178 | updateParcel.claimPrice = parcel.claimPrice; | ||
179 | updateParcel.groupID = parcel.groupID; | ||
180 | updateParcel.groupPrims = parcel.groupPrims; | ||
181 | updateParcel.isGroupOwned = parcel.isGroupOwned; | ||
182 | updateParcel.landingType = parcel.landingType; | ||
183 | updateParcel.mediaAutoScale = parcel.mediaAutoScale; | ||
184 | updateParcel.mediaID = parcel.mediaID; | ||
185 | updateParcel.mediaURL = parcel.mediaURL; | ||
186 | updateParcel.musicURL = parcel.musicURL; | ||
187 | updateParcel.localID = parcel.localID; | ||
188 | updateParcel.ownerID = parcel.ownerID; | ||
189 | updateParcel.passHours = parcel.passHours; | ||
190 | updateParcel.passPrice = parcel.passPrice; | ||
191 | updateParcel.parcelBitmapByteArray = (byte[])parcel.parcelBitmapByteArray.Clone(); | ||
192 | updateParcel.parcelDesc = parcel.parcelDesc; | ||
193 | updateParcel.parcelFlags = parcel.parcelFlags; | ||
194 | updateParcel.parcelName = parcel.parcelName; | ||
195 | updateParcel.parcelStatus = parcel.parcelStatus; | ||
196 | updateParcel.salePrice = parcel.salePrice; | ||
197 | updateParcel.snapshotID = parcel.snapshotID; | ||
198 | updateParcel.userLocation = parcel.userLocation; | ||
199 | updateParcel.userLookAt = parcel.userLookAt; | ||
200 | |||
201 | db.Set(updateParcel); | ||
202 | } | ||
203 | else | ||
204 | { | ||
205 | db.Set(parcel); | ||
206 | } | ||
207 | db.Commit(); | ||
208 | } | ||
209 | |||
210 | public void SaveParcels(ParcelData[] parcel_data) | ||
211 | { | ||
212 | MainConsole.Instance.Notice("Parcel Backup: Saving Parcels..."); | ||
213 | int i; | ||
214 | for (i = 0; i < parcel_data.GetLength(0); i++) | ||
215 | { | ||
216 | |||
217 | SaveParcel(parcel_data[i]); | ||
218 | |||
219 | } | ||
220 | MainConsole.Instance.Notice("Parcel Backup: Parcel Save Complete"); | ||
221 | } | ||
222 | |||
223 | public void RemoveParcel(ParcelData parcel) | ||
224 | { | ||
225 | IObjectSet result = db.Query(new UUIDParcelQuery(parcel.globalID)); | ||
226 | if (result.Count > 0) | ||
227 | { | ||
228 | db.Delete(result[0]); | ||
229 | } | ||
230 | db.Commit(); | ||
231 | } | ||
232 | public void RemoveAllParcels() | ||
233 | { | ||
234 | MainConsole.Instance.Notice("Parcel Backup: Removing all parcels..."); | ||
235 | IObjectSet result = db.Get(typeof(ParcelData)); | ||
236 | if (result.Count > 0) | ||
237 | { | ||
238 | foreach (ParcelData parcelData in result) | ||
239 | { | ||
240 | RemoveParcel(parcelData); | ||
241 | } | ||
242 | } | ||
243 | } | ||
244 | |||
245 | public void LoadParcels(ILocalStorageParcelReceiver recv) | ||
246 | { | ||
247 | MainConsole.Instance.Notice("Parcel Backup: Loading Parcels..."); | ||
248 | IObjectSet result = db.Get(typeof(ParcelData)); | ||
249 | if (result.Count > 0) | ||
250 | { | ||
251 | MainConsole.Instance.Notice("Parcel Backup: Parcels exist in database."); | ||
252 | foreach (ParcelData parcelData in result) | ||
253 | { | ||
254 | |||
255 | recv.ParcelFromStorage(parcelData); | ||
256 | } | ||
257 | } | ||
258 | else | ||
259 | { | ||
260 | MainConsole.Instance.Notice("Parcel Backup: No parcels exist. Creating basic parcel."); | ||
261 | recv.NoParcelDataFromStorage(); | ||
262 | } | ||
263 | MainConsole.Instance.Notice("Parcel Backup: Parcels Restored"); | ||
264 | } | ||
265 | public void ShutDown() | ||
266 | { | ||
267 | db.Commit(); | ||
268 | db.Close(); | ||
269 | } | ||
270 | } | ||
271 | } \ No newline at end of file | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs deleted file mode 100644 index 56387ac..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/MapStorage.cs +++ /dev/null | |||
@@ -1,43 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | |||
32 | namespace OpenSim.Storage.LocalStorageDb4o | ||
33 | { | ||
34 | public class MapStorage | ||
35 | { | ||
36 | public float[] Map; | ||
37 | |||
38 | public MapStorage() | ||
39 | { | ||
40 | |||
41 | } | ||
42 | } | ||
43 | } \ No newline at end of file | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj deleted file mode 100644 index 5b8f1c1..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.csproj +++ /dev/null | |||
@@ -1,116 +0,0 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <ProjectType>Local</ProjectType> | ||
4 | <ProductVersion>8.0.50727</ProductVersion> | ||
5 | <SchemaVersion>2.0</SchemaVersion> | ||
6 | <ProjectGuid>{E1B79ECF-0000-0000-0000-000000000000}</ProjectGuid> | ||
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
9 | <ApplicationIcon></ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | ||
11 | </AssemblyKeyContainerName> | ||
12 | <AssemblyName>OpenSim.Storage.LocalStorageDb4o</AssemblyName> | ||
13 | <DefaultClientScript>JScript</DefaultClientScript> | ||
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | ||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | ||
16 | <DelaySign>false</DelaySign> | ||
17 | <OutputType>Library</OutputType> | ||
18 | <AppDesignerFolder></AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Storage.LocalStorageDb4o</RootNamespace> | ||
20 | <StartupObject></StartupObject> | ||
21 | <FileUpgradeFlags> | ||
22 | </FileUpgradeFlags> | ||
23 | </PropertyGroup> | ||
24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
25 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
26 | <BaseAddress>285212672</BaseAddress> | ||
27 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
28 | <ConfigurationOverrideFile> | ||
29 | </ConfigurationOverrideFile> | ||
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
31 | <DocumentationFile></DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | ||
33 | <FileAlignment>4096</FileAlignment> | ||
34 | <Optimize>False</Optimize> | ||
35 | <OutputPath>..\..\..\bin\</OutputPath> | ||
36 | <RegisterForComInterop>False</RegisterForComInterop> | ||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
39 | <WarningLevel>4</WarningLevel> | ||
40 | <NoWarn></NoWarn> | ||
41 | </PropertyGroup> | ||
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
44 | <BaseAddress>285212672</BaseAddress> | ||
45 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
46 | <ConfigurationOverrideFile> | ||
47 | </ConfigurationOverrideFile> | ||
48 | <DefineConstants>TRACE</DefineConstants> | ||
49 | <DocumentationFile></DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | ||
51 | <FileAlignment>4096</FileAlignment> | ||
52 | <Optimize>True</Optimize> | ||
53 | <OutputPath>..\..\..\bin\</OutputPath> | ||
54 | <RegisterForComInterop>False</RegisterForComInterop> | ||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
57 | <WarningLevel>4</WarningLevel> | ||
58 | <NoWarn></NoWarn> | ||
59 | </PropertyGroup> | ||
60 | <ItemGroup> | ||
61 | <Reference Include="Db4objects.Db4o.dll" > | ||
62 | <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath> | ||
63 | <Private>False</Private> | ||
64 | </Reference> | ||
65 | <Reference Include="libsecondlife.dll" > | ||
66 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> | ||
67 | <Private>False</Private> | ||
68 | </Reference> | ||
69 | <Reference Include="System" > | ||
70 | <HintPath>System.dll</HintPath> | ||
71 | <Private>False</Private> | ||
72 | </Reference> | ||
73 | <Reference Include="System.Xml" > | ||
74 | <HintPath>System.Xml.dll</HintPath> | ||
75 | <Private>False</Private> | ||
76 | </Reference> | ||
77 | </ItemGroup> | ||
78 | <ItemGroup> | ||
79 | <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> | ||
80 | <Name>OpenSim.Framework</Name> | ||
81 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | ||
82 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
83 | <Private>False</Private> | ||
84 | </ProjectReference> | ||
85 | <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | ||
86 | <Name>OpenSim.Framework.Console</Name> | ||
87 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | ||
88 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
89 | <Private>False</Private> | ||
90 | </ProjectReference> | ||
91 | </ItemGroup> | ||
92 | <ItemGroup> | ||
93 | <Compile Include="AssemblyInfo.cs"> | ||
94 | <SubType>Code</SubType> | ||
95 | </Compile> | ||
96 | <Compile Include="Db4LocalStorage.cs"> | ||
97 | <SubType>Code</SubType> | ||
98 | </Compile> | ||
99 | <Compile Include="MapStorage.cs"> | ||
100 | <SubType>Code</SubType> | ||
101 | </Compile> | ||
102 | <Compile Include="UUIDParcelQuery.cs"> | ||
103 | <SubType>Code</SubType> | ||
104 | </Compile> | ||
105 | <Compile Include="UUIDPrimQuery.cs"> | ||
106 | <SubType>Code</SubType> | ||
107 | </Compile> | ||
108 | </ItemGroup> | ||
109 | <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
110 | <PropertyGroup> | ||
111 | <PreBuildEvent> | ||
112 | </PreBuildEvent> | ||
113 | <PostBuildEvent> | ||
114 | </PostBuildEvent> | ||
115 | </PropertyGroup> | ||
116 | </Project> | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build b/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build deleted file mode 100644 index 739b98c..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/OpenSim.Storage.LocalStorageDb4o.dll.build +++ /dev/null | |||
@@ -1,48 +0,0 @@ | |||
1 | <?xml version="1.0" ?> | ||
2 | <project name="OpenSim.Storage.LocalStorageDb4o" default="build"> | ||
3 | <target name="build"> | ||
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | ||
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | ||
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | ||
7 | <fileset basedir="${project::get-base-directory()}"> | ||
8 | </fileset> | ||
9 | </copy> | ||
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | ||
11 | <resources prefix="OpenSim.Storage.LocalStorageDb4o" dynamicprefix="true" > | ||
12 | </resources> | ||
13 | <sources failonempty="true"> | ||
14 | <include name="AssemblyInfo.cs" /> | ||
15 | <include name="Db4LocalStorage.cs" /> | ||
16 | <include name="MapStorage.cs" /> | ||
17 | <include name="UUIDParcelQuery.cs" /> | ||
18 | <include name="UUIDPrimQuery.cs" /> | ||
19 | </sources> | ||
20 | <references basedir="${project::get-base-directory()}"> | ||
21 | <lib> | ||
22 | <include name="${project::get-base-directory()}" /> | ||
23 | <include name="${project::get-base-directory()}/${build.dir}" /> | ||
24 | </lib> | ||
25 | <include name="../../../bin/Db4objects.Db4o.dll" /> | ||
26 | <include name="../../../bin/libsecondlife.dll" /> | ||
27 | <include name="../../../bin/OpenSim.Framework.dll" /> | ||
28 | <include name="../../../bin/OpenSim.Framework.Console.dll" /> | ||
29 | <include name="System.dll" /> | ||
30 | <include name="System.Xml.dll" /> | ||
31 | </references> | ||
32 | </csc> | ||
33 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" /> | ||
34 | <mkdir dir="${project::get-base-directory()}/../../../bin/"/> | ||
35 | <copy todir="${project::get-base-directory()}/../../../bin/"> | ||
36 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | ||
37 | <include name="*.dll"/> | ||
38 | <include name="*.exe"/> | ||
39 | </fileset> | ||
40 | </copy> | ||
41 | </target> | ||
42 | <target name="clean"> | ||
43 | <delete dir="${bin.dir}" failonerror="false" /> | ||
44 | <delete dir="${obj.dir}" failonerror="false" /> | ||
45 | </target> | ||
46 | <target name="doc" description="Creates documentation."> | ||
47 | </target> | ||
48 | </project> | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs deleted file mode 100644 index d24fb5f..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDParcelQuery.cs +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using Db4objects.Db4o; | ||
32 | using Db4objects.Db4o.Query; | ||
33 | using libsecondlife; | ||
34 | using OpenSim.Framework.Interfaces; | ||
35 | using OpenSim.Framework.Types; | ||
36 | |||
37 | namespace OpenSim.Storage.LocalStorageDb4o | ||
38 | { | ||
39 | public class UUIDParcelQuery : Predicate | ||
40 | { | ||
41 | private LLUUID globalIDSearch; | ||
42 | |||
43 | public UUIDParcelQuery(LLUUID find) | ||
44 | { | ||
45 | globalIDSearch = find; | ||
46 | } | ||
47 | public bool Match(ParcelData parcel) | ||
48 | { | ||
49 | return (parcel.globalID == globalIDSearch); | ||
50 | } | ||
51 | } | ||
52 | } | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs b/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs deleted file mode 100644 index b2e8a91..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageDb4o/UUIDPrimQuery.cs +++ /dev/null | |||
@@ -1,52 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | using System; | ||
29 | using System.Collections.Generic; | ||
30 | using System.Text; | ||
31 | using Db4objects.Db4o; | ||
32 | using Db4objects.Db4o.Query; | ||
33 | using libsecondlife; | ||
34 | using OpenSim.Framework.Interfaces; | ||
35 | using OpenSim.Framework.Types; | ||
36 | |||
37 | namespace OpenSim.Storage.LocalStorageDb4o | ||
38 | { | ||
39 | public class UUIDPrimQuery : Predicate | ||
40 | { | ||
41 | private LLUUID _findID; | ||
42 | |||
43 | public UUIDPrimQuery(LLUUID find) | ||
44 | { | ||
45 | _findID = find; | ||
46 | } | ||
47 | public bool Match(PrimData prim) | ||
48 | { | ||
49 | return (prim.FullID == _findID); | ||
50 | } | ||
51 | } | ||
52 | } | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj deleted file mode 100644 index ff93a8f..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.csproj +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
2 | <PropertyGroup> | ||
3 | <ProjectType>Local</ProjectType> | ||
4 | <ProductVersion>8.0.50727</ProductVersion> | ||
5 | <SchemaVersion>2.0</SchemaVersion> | ||
6 | <ProjectGuid>{6B20B603-0000-0000-0000-000000000000}</ProjectGuid> | ||
7 | <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
8 | <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
9 | <ApplicationIcon></ApplicationIcon> | ||
10 | <AssemblyKeyContainerName> | ||
11 | </AssemblyKeyContainerName> | ||
12 | <AssemblyName>OpenSim.Storage.LocalStorageSQLite</AssemblyName> | ||
13 | <DefaultClientScript>JScript</DefaultClientScript> | ||
14 | <DefaultHTMLPageLayout>Grid</DefaultHTMLPageLayout> | ||
15 | <DefaultTargetSchema>IE50</DefaultTargetSchema> | ||
16 | <DelaySign>false</DelaySign> | ||
17 | <OutputType>Library</OutputType> | ||
18 | <AppDesignerFolder></AppDesignerFolder> | ||
19 | <RootNamespace>OpenSim.Storage.LocalStorageSQLite</RootNamespace> | ||
20 | <StartupObject></StartupObject> | ||
21 | <FileUpgradeFlags> | ||
22 | </FileUpgradeFlags> | ||
23 | </PropertyGroup> | ||
24 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
25 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
26 | <BaseAddress>285212672</BaseAddress> | ||
27 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
28 | <ConfigurationOverrideFile> | ||
29 | </ConfigurationOverrideFile> | ||
30 | <DefineConstants>TRACE;DEBUG</DefineConstants> | ||
31 | <DocumentationFile></DocumentationFile> | ||
32 | <DebugSymbols>True</DebugSymbols> | ||
33 | <FileAlignment>4096</FileAlignment> | ||
34 | <Optimize>False</Optimize> | ||
35 | <OutputPath>..\..\..\bin\</OutputPath> | ||
36 | <RegisterForComInterop>False</RegisterForComInterop> | ||
37 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
38 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
39 | <WarningLevel>4</WarningLevel> | ||
40 | <NoWarn></NoWarn> | ||
41 | </PropertyGroup> | ||
42 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
43 | <AllowUnsafeBlocks>False</AllowUnsafeBlocks> | ||
44 | <BaseAddress>285212672</BaseAddress> | ||
45 | <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> | ||
46 | <ConfigurationOverrideFile> | ||
47 | </ConfigurationOverrideFile> | ||
48 | <DefineConstants>TRACE</DefineConstants> | ||
49 | <DocumentationFile></DocumentationFile> | ||
50 | <DebugSymbols>False</DebugSymbols> | ||
51 | <FileAlignment>4096</FileAlignment> | ||
52 | <Optimize>True</Optimize> | ||
53 | <OutputPath>..\..\..\bin\</OutputPath> | ||
54 | <RegisterForComInterop>False</RegisterForComInterop> | ||
55 | <RemoveIntegerChecks>False</RemoveIntegerChecks> | ||
56 | <TreatWarningsAsErrors>False</TreatWarningsAsErrors> | ||
57 | <WarningLevel>4</WarningLevel> | ||
58 | <NoWarn></NoWarn> | ||
59 | </PropertyGroup> | ||
60 | <ItemGroup> | ||
61 | <Reference Include="libsecondlife.dll" > | ||
62 | <HintPath>..\..\..\bin\libsecondlife.dll</HintPath> | ||
63 | <Private>False</Private> | ||
64 | </Reference> | ||
65 | <Reference Include="System" > | ||
66 | <HintPath>System.dll</HintPath> | ||
67 | <Private>False</Private> | ||
68 | </Reference> | ||
69 | <Reference Include="System.Data" > | ||
70 | <HintPath>System.Data.dll</HintPath> | ||
71 | <Private>False</Private> | ||
72 | </Reference> | ||
73 | <Reference Include="System.Data.SQLite.dll" > | ||
74 | <HintPath>..\..\..\bin\System.Data.SQLite.dll</HintPath> | ||
75 | <Private>False</Private> | ||
76 | </Reference> | ||
77 | <Reference Include="System.Xml" > | ||
78 | <HintPath>System.Xml.dll</HintPath> | ||
79 | <Private>False</Private> | ||
80 | </Reference> | ||
81 | </ItemGroup> | ||
82 | <ItemGroup> | ||
83 | <ProjectReference Include="..\..\..\Common\OpenSim.Framework\OpenSim.Framework.csproj"> | ||
84 | <Name>OpenSim.Framework</Name> | ||
85 | <Project>{8ACA2445-0000-0000-0000-000000000000}</Project> | ||
86 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
87 | <Private>False</Private> | ||
88 | </ProjectReference> | ||
89 | <ProjectReference Include="..\..\..\Common\OpenSim.Framework.Console\OpenSim.Framework.Console.csproj"> | ||
90 | <Name>OpenSim.Framework.Console</Name> | ||
91 | <Project>{A7CD0630-0000-0000-0000-000000000000}</Project> | ||
92 | <Package>{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</Package> | ||
93 | <Private>False</Private> | ||
94 | </ProjectReference> | ||
95 | </ItemGroup> | ||
96 | <ItemGroup> | ||
97 | <Compile Include="SQLiteLocalStorage.cs"> | ||
98 | <SubType>Code</SubType> | ||
99 | </Compile> | ||
100 | <Compile Include="Properties\AssemblyInfo.cs"> | ||
101 | <SubType>Code</SubType> | ||
102 | </Compile> | ||
103 | </ItemGroup> | ||
104 | <Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
105 | <PropertyGroup> | ||
106 | <PreBuildEvent> | ||
107 | </PreBuildEvent> | ||
108 | <PostBuildEvent> | ||
109 | </PostBuildEvent> | ||
110 | </PropertyGroup> | ||
111 | </Project> | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build b/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build deleted file mode 100644 index bd4c731..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/OpenSim.Storage.LocalStorageSQLite.dll.build +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | <?xml version="1.0" ?> | ||
2 | <project name="OpenSim.Storage.LocalStorageSQLite" default="build"> | ||
3 | <target name="build"> | ||
4 | <echo message="Build Directory is ${project::get-base-directory()}/${build.dir}" /> | ||
5 | <mkdir dir="${project::get-base-directory()}/${build.dir}" /> | ||
6 | <copy todir="${project::get-base-directory()}/${build.dir}"> | ||
7 | <fileset basedir="${project::get-base-directory()}"> | ||
8 | </fileset> | ||
9 | </copy> | ||
10 | <csc target="library" debug="${build.debug}" unsafe="False" define="TRACE;DEBUG" output="${project::get-base-directory()}/${build.dir}/${project::get-name()}.dll"> | ||
11 | <resources prefix="OpenSim.Storage.LocalStorageSQLite" dynamicprefix="true" > | ||
12 | </resources> | ||
13 | <sources failonempty="true"> | ||
14 | <include name="SQLiteLocalStorage.cs" /> | ||
15 | <include name="Properties/AssemblyInfo.cs" /> | ||
16 | </sources> | ||
17 | <references basedir="${project::get-base-directory()}"> | ||
18 | <lib> | ||
19 | <include name="${project::get-base-directory()}" /> | ||
20 | <include name="${project::get-base-directory()}/${build.dir}" /> | ||
21 | </lib> | ||
22 | <include name="../../../bin/libsecondlife.dll" /> | ||
23 | <include name="../../../bin/OpenSim.Framework.dll" /> | ||
24 | <include name="../../../bin/OpenSim.Framework.Console.dll" /> | ||
25 | <include name="System.dll" /> | ||
26 | <include name="System.Data.dll" /> | ||
27 | <include name="../../../bin/System.Data.SQLite.dll" /> | ||
28 | <include name="System.Xml.dll" /> | ||
29 | </references> | ||
30 | </csc> | ||
31 | <echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../../../bin/" /> | ||
32 | <mkdir dir="${project::get-base-directory()}/../../../bin/"/> | ||
33 | <copy todir="${project::get-base-directory()}/../../../bin/"> | ||
34 | <fileset basedir="${project::get-base-directory()}/${build.dir}/" > | ||
35 | <include name="*.dll"/> | ||
36 | <include name="*.exe"/> | ||
37 | </fileset> | ||
38 | </copy> | ||
39 | </target> | ||
40 | <target name="clean"> | ||
41 | <delete dir="${bin.dir}" failonerror="false" /> | ||
42 | <delete dir="${obj.dir}" failonerror="false" /> | ||
43 | </target> | ||
44 | <target name="doc" description="Creates documentation."> | ||
45 | </target> | ||
46 | </project> | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs deleted file mode 100644 index fe81f8a..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/Properties/AssemblyInfo.cs +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | using System.Reflection; | ||
2 | using System.Runtime.CompilerServices; | ||
3 | using System.Runtime.InteropServices; | ||
4 | |||
5 | // General Information about an assembly is controlled through the following | ||
6 | // set of attributes. Change these attribute values to modify the information | ||
7 | // associated with an assembly. | ||
8 | [assembly: AssemblyTitle("OpenSim.Storage.LocalStorageSQLite")] | ||
9 | [assembly: AssemblyDescription("")] | ||
10 | [assembly: AssemblyConfiguration("")] | ||
11 | [assembly: AssemblyCompany("")] | ||
12 | [assembly: AssemblyProduct("OpenSim.Storage.LocalStorageSQLite")] | ||
13 | [assembly: AssemblyCopyright("Copyright © 2007")] | ||
14 | [assembly: AssemblyTrademark("")] | ||
15 | [assembly: AssemblyCulture("")] | ||
16 | |||
17 | // Setting ComVisible to false makes the types in this assembly not visible | ||
18 | // to COM components. If you need to access a type in this assembly from | ||
19 | // COM, set the ComVisible attribute to true on that type. | ||
20 | [assembly: ComVisible(false)] | ||
21 | |||
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
23 | [assembly: Guid("ecd6e0c1-7909-413e-9e3f-659678ac3bc3")] | ||
24 | |||
25 | // Version information for an assembly consists of the following four values: | ||
26 | // | ||
27 | // Major Version | ||
28 | // Minor Version | ||
29 | // Build Number | ||
30 | // Revision | ||
31 | // | ||
32 | // You can specify all the values or you can default the Revision and Build Numbers | ||
33 | // by using the '*' as shown below: | ||
34 | [assembly: AssemblyVersion("1.0.0.*")] | ||
35 | [assembly: AssemblyFileVersion("1.0.0.*")] | ||
diff --git a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs b/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs deleted file mode 100644 index 8106727..0000000 --- a/OpenSim/OpenSim.Storage/LocalStorageSQLite/SQLiteLocalStorage.cs +++ /dev/null | |||
@@ -1,199 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://www.openmetaverse.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | * | ||
27 | */ | ||
28 | |||
29 | // SQLite Support | ||
30 | // A bad idea, but the IRC people told me to! | ||
31 | |||
32 | using System; | ||
33 | using System.Collections.Generic; | ||
34 | using System.Data; | ||
35 | using System.Data.SQLite; | ||
36 | using libsecondlife; | ||
37 | using OpenSim.Framework.Interfaces; | ||
38 | using OpenSim.Framework.Types; | ||
39 | using OpenSim.Framework.Terrain; | ||
40 | |||
41 | namespace OpenSim.Storage.LocalStorageSQLite | ||
42 | { | ||
43 | public class SQLiteLocalStorage : ILocalStorage | ||
44 | { | ||
45 | IDbConnection db; | ||
46 | |||
47 | public SQLiteLocalStorage() | ||
48 | { | ||
49 | try | ||
50 | { | ||
51 | string connectionstring = "URI=file:localsim.sdb"; | ||
52 | db = (IDbConnection)new SQLiteConnection(connectionstring); | ||
53 | db.Open(); | ||
54 | } | ||
55 | catch (Exception e) | ||
56 | { | ||
57 | db.Close(); | ||
58 | OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :Constructor - Exception occured"); | ||
59 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); | ||
60 | } | ||
61 | } | ||
62 | |||
63 | public void Initialise(string file) | ||
64 | { | ||
65 | // Blank | ||
66 | } | ||
67 | |||
68 | public void StorePrim(PrimData prim) | ||
69 | { | ||
70 | IDbCommand cmd = db.CreateCommand(); | ||
71 | |||
72 | //SECURITY WARNING: | ||
73 | // These parameters wont produce SQL injections since they are all integer based, however. | ||
74 | // if inserting strings such as name or description, you will need to use appropriate | ||
75 | // measures to prevent SQL injection (although the value of SQL injection in this is limited). | ||
76 | |||
77 | string sql = "REPLACE INTO prim (OwnerID,PCode,PathBegin,PathEnd,PathScaleX,PathScaleY,PathShearX,PathShearY,PathSkew,ProfileBegin,ProfileEnd,Scale,PathCurve,ProfileCurve,ParentID,ProfileHollow,PathRadiusOffset,PathRevolutions,PathTaperX,PathTaperY,PathTwist,PathTwistBegin,Texture,CreationDate,OwnerMask,NextOwnerMask,GroupMask,EveryoneMask,BaseMask,Position,Rotation,LocalID,FullID) "; | ||
78 | sql += "VALUES ("; | ||
79 | sql += "\"" + prim.OwnerID.ToStringHyphenated() + "\","; // KILL ME NOW! | ||
80 | sql += "\"" + prim.PCode.ToString() + "\","; | ||
81 | sql += "\"" + prim.PathBegin.ToString() + "\","; | ||
82 | sql += "\"" + prim.PathEnd.ToString() + "\","; | ||
83 | sql += "\"" + prim.PathScaleX.ToString() + "\","; | ||
84 | sql += "\"" + prim.PathScaleY.ToString() + "\","; | ||
85 | sql += "\"" + prim.PathShearX.ToString() + "\","; | ||
86 | sql += "\"" + prim.PathShearY.ToString() + "\","; | ||
87 | sql += "\"" + prim.PathSkew.ToString() + "\","; | ||
88 | sql += "\"" + prim.ProfileBegin.ToString() + "\","; | ||
89 | sql += "\"" + prim.ProfileEnd.ToString() + "\","; | ||
90 | sql += "\"" + prim.Scale.ToString() + "\","; | ||
91 | sql += "\"" + prim.PathCurve.ToString() + "\","; | ||
92 | sql += "\"" + prim.ProfileCurve.ToString() + "\","; | ||
93 | sql += "\"" + prim.ParentID.ToString() + "\","; | ||
94 | sql += "\"" + prim.ProfileHollow.ToString() + "\","; | ||
95 | sql += "\"" + prim.PathRadiusOffset.ToString() + "\","; | ||
96 | sql += "\"" + prim.PathRevolutions.ToString() + "\","; | ||
97 | sql += "\"" + prim.PathTaperX.ToString() + "\","; | ||
98 | sql += "\"" + prim.PathTaperY.ToString() + "\","; | ||
99 | sql += "\"" + prim.PathTwist.ToString() + "\","; | ||
100 | sql += "\"" + prim.PathTwistBegin.ToString() + "\","; | ||
101 | sql += "\"" + prim.Texture.ToString() + "\","; | ||
102 | sql += "\"" + prim.CreationDate.ToString() + "\","; | ||
103 | sql += "\"" + prim.OwnerMask.ToString() + "\","; | ||
104 | sql += "\"" + prim.NextOwnerMask.ToString() + "\","; | ||
105 | sql += "\"" + prim.GroupMask.ToString() + "\","; | ||
106 | sql += "\"" + prim.EveryoneMask.ToString() + "\","; | ||
107 | sql += "\"" + prim.BaseMask.ToString() + "\","; | ||
108 | sql += "\"" + prim.Position.ToString() + "\","; | ||
109 | sql += "\"" + prim.Rotation.ToString() + "\","; | ||
110 | sql += "\"" + prim.LocalID.ToString() + "\","; | ||
111 | sql += "\"" + prim.FullID.ToString() + "\")"; | ||
112 | |||
113 | cmd.CommandText = sql; | ||
114 | |||
115 | try | ||
116 | { | ||
117 | cmd.ExecuteNonQuery(); | ||
118 | } | ||
119 | catch (Exception e) | ||
120 | { | ||
121 | OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :StorePrim - Exception occured"); | ||
122 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); | ||
123 | } | ||
124 | |||
125 | cmd.Dispose(); | ||
126 | cmd = null; | ||
127 | } | ||
128 | |||
129 | public void RemovePrim(LLUUID primID) | ||
130 | { | ||
131 | IDbCommand cmd = db.CreateCommand(); | ||
132 | |||
133 | //SECURITY WARNING: | ||
134 | // These parameters wont produce SQL injections since they are all integer based, however. | ||
135 | // if inserting strings such as name or description, you will need to use appropriate | ||
136 | // measures to prevent SQL injection (although the value of SQL injection in this is limited). | ||
137 | |||
138 | string sql = "DELETE FROM prim WHERE FullID = \"" + primID.ToStringHyphenated() + "\""; | ||
139 | |||
140 | cmd.CommandText = sql; | ||
141 | |||
142 | try | ||
143 | { | ||
144 | cmd.ExecuteNonQuery(); | ||
145 | } | ||
146 | catch (Exception e) | ||
147 | { | ||
148 | OpenSim.Framework.Console.MainConsole.Instance.Warn("SQLiteLocalStorage :RemovePrim - Exception occured"); | ||
149 | OpenSim.Framework.Console.MainConsole.Instance.Warn(e.ToString()); | ||
150 | } | ||
151 | |||
152 | cmd.Dispose(); | ||
153 | cmd = null; | ||
154 | } | ||
155 | |||
156 | public void LoadPrimitives(ILocalStorageReceiver receiver) | ||
157 | { | ||
158 | |||
159 | } | ||
160 | |||
161 | public float[] LoadWorld() | ||
162 | { | ||
163 | return new float[65536]; | ||
164 | } | ||
165 | |||
166 | public void SaveMap(float[] heightmap) | ||
167 | { | ||
168 | |||
169 | } | ||
170 | |||
171 | public void SaveParcels(ParcelData[] parcel_manager) | ||
172 | { | ||
173 | |||
174 | } | ||
175 | |||
176 | public void SaveParcel(ParcelData parcel) | ||
177 | { | ||
178 | } | ||
179 | |||
180 | public void RemoveParcel(ParcelData parcel) | ||
181 | { | ||
182 | } | ||
183 | |||
184 | public void RemoveAllParcels() | ||
185 | { | ||
186 | } | ||
187 | |||
188 | public void LoadParcels(ILocalStorageParcelReceiver recv) | ||
189 | { | ||
190 | recv.NoParcelDataFromStorage(); | ||
191 | } | ||
192 | |||
193 | public void ShutDown() | ||
194 | { | ||
195 | db.Close(); | ||
196 | db = null; | ||
197 | } | ||
198 | } | ||
199 | } \ No newline at end of file | ||