aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/LocalStorage
diff options
context:
space:
mode:
authorgareth2007-03-22 10:11:15 +0000
committergareth2007-03-22 10:11:15 +0000
commit7daa3955bc3a1918e40962851f9e8d38597a245e (patch)
treebee3e1372a7eed0c1b220a8a49f7bee7d29a6b91 /src/LocalStorage
parentLoad XML for neighbourinfo from grid (diff)
downloadopensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.zip
opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.gz
opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.bz2
opensim-SC_OLD-7daa3955bc3a1918e40962851f9e8d38597a245e.tar.xz
brought zircon branch into trunk
Diffstat (limited to 'src/LocalStorage')
-rw-r--r--src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs21
-rw-r--r--src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs139
-rw-r--r--src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj52
-rw-r--r--src/LocalStorage/default.build53
4 files changed, 0 insertions, 265 deletions
diff --git a/src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs b/src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs
deleted file mode 100644
index 0c5ff75..0000000
--- a/src/LocalStorage/Db4LocalStorage/AssemblyInfo.cs
+++ /dev/null
@@ -1,21 +0,0 @@
1using System;
2using System.Reflection;
3using System.Runtime.InteropServices;
4
5// ------------------------------------------------------------------------------
6// <autogenerated>
7// This code was generated by a tool.
8// Mono Runtime Version: 2.0.50727.42
9//
10// Changes to this file may cause incorrect behavior and will be lost if
11// the code is regenerated.
12// </autogenerated>
13// ------------------------------------------------------------------------------
14
15[assembly: ComVisibleAttribute(false)]
16[assembly: CLSCompliantAttribute(false)]
17[assembly: AssemblyVersionAttribute("0.1.0.240")]
18[assembly: AssemblyTitleAttribute("opensim-localstorage")]
19[assembly: AssemblyDescriptionAttribute("The local storage handler")]
20[assembly: AssemblyCopyrightAttribute("Copyright © OGS development team 2007")]
21
diff --git a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs b/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs
deleted file mode 100644
index bb9825c..0000000
--- a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.cs
+++ /dev/null
@@ -1,139 +0,0 @@
1/*
2* Copyright (c) OpenSim project, http://sim.opensecondlife.org/
3*
4* Redistribution and use in source and binary forms, with or without
5* modification, are permitted provided that the following conditions are met:
6* * Redistributions of source code must retain the above copyright
7* notice, this list of conditions and the following disclaimer.
8* * Redistributions in binary form must reproduce the above copyright
9* notice, this list of conditions and the following disclaimer in the
10* documentation and/or other materials provided with the distribution.
11* * Neither the name of the <organization> nor the
12* names of its contributors may be used to endorse or promote products
13* derived from this software without specific prior written permission.
14*
15* THIS SOFTWARE IS PROVIDED BY <copyright holder> ``AS IS'' AND ANY
16* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18* DISCLAIMED. IN NO EVENT SHALL <copyright holder> BE LIABLE FOR ANY
19* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
22* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*
26*/
27using System;
28using System.Collections.Generic;
29using Db4objects.Db4o;
30using Db4objects.Db4o.Query;
31using libsecondlife;
32using GridInterfaces;
33
34namespace Db4LocalStorage
35{
36 /// <summary>
37 ///
38 /// </summary>
39 public class Db4LocalStorage : ILocalStorage
40 {
41 private IObjectContainer db;
42
43 public Db4LocalStorage()
44 {
45 try
46 {
47 db = Db4oFactory.OpenFile("localworld.yap");
48 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage creation");
49 }
50 catch(Exception e)
51 {
52 db.Close();
53 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage :Constructor - Exception occured");
54 ServerConsole.MainConsole.Instance.WriteLine(e.ToString());
55 }
56 }
57
58 public void StorePrim(PrimData prim)
59 {
60 IObjectSet result = db.Query(new UUIDQuery(prim.FullID));
61 if(result.Count>0)
62 {
63 //prim already in storage
64 //so update it
65 PrimData found = (PrimData) result.Next();
66 found.PathBegin = prim.PathBegin;
67 found.PathCurve= prim.PathCurve;
68 found.PathEnd = prim.PathEnd;
69 found.PathRadiusOffset = prim.PathRadiusOffset;
70 found.PathRevolutions = prim.PathRevolutions;
71 found.PathScaleX= prim.PathScaleX;
72 found.PathScaleY = prim.PathScaleY;
73 found.PathShearX = prim.PathShearX;
74 found.PathShearY = prim.PathShearY;
75 found.PathSkew = prim.PathSkew;
76 found.PathTaperX = prim.PathTaperX;
77 found.PathTaperY = prim.PathTaperY;
78 found.PathTwist = prim.PathTwist;
79 found.PathTwistBegin = prim.PathTwistBegin;
80 found.PCode = prim.PCode;
81 found.ProfileBegin = prim.ProfileBegin;
82 found.ProfileCurve = prim.ProfileCurve;
83 found.ProfileEnd = prim.ProfileEnd;
84 found.ProfileHollow = prim.ProfileHollow;
85 found.Position = prim.Position;
86 found.Rotation = prim.Rotation;
87 db.Set(found);
88 db.Commit();
89 }
90 else
91 {
92 //not in storage
93 db.Set(prim);
94 db.Commit();
95 }
96 }
97
98 public void RemovePrim(LLUUID primID)
99 {
100 IObjectSet result = db.Query(new UUIDQuery(primID));
101 if(result.Count>0)
102 {
103 PrimData found = (PrimData) result.Next();
104 db.Delete(found);
105 }
106 }
107
108
109 public void LoadPrimitives(ILocalStorageReceiver receiver)
110 {
111 IObjectSet result = db.Get(typeof(PrimData));
112 ServerConsole.MainConsole.Instance.WriteLine("Db4LocalStorage.cs: LoadPrimitives() - number of prims in storages is "+result.Count);
113 foreach (PrimData prim in result) {
114 receiver.PrimFromStorage(prim);
115 }
116 }
117
118 public void ShutDown()
119 {
120 db.Commit();
121 db.Close();
122 }
123 }
124
125 public class UUIDQuery : Predicate
126 {
127 private LLUUID _findID;
128
129 public UUIDQuery(LLUUID find)
130 {
131 _findID = find;
132 }
133 public bool Match(PrimData prim)
134 {
135 return (prim.FullID == _findID);
136 }
137 }
138
139}
diff --git a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj b/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj
deleted file mode 100644
index c00771c..0000000
--- a/src/LocalStorage/Db4LocalStorage/Db4LocalStorage.csproj
+++ /dev/null
@@ -1,52 +0,0 @@
1<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <PropertyGroup>
3 <OutputType>Library</OutputType>
4 <RootNamespace>Db4LocalStorage</RootNamespace>
5 <AssemblyName>Db4LocalStorage</AssemblyName>
6 <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
7 <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
8 <ProjectGuid>{74784F23-B0FD-484C-82C1-96C0215733DC}</ProjectGuid>
9 </PropertyGroup>
10 <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
11 <OutputPath>bin\Debug\</OutputPath>
12 <Optimize>False</Optimize>
13 <DefineConstants>DEBUG;TRACE</DefineConstants>
14 <DebugSymbols>True</DebugSymbols>
15 <DebugType>Full</DebugType>
16 <CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
17 </PropertyGroup>
18 <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
19 <OutputPath>bin\Release\</OutputPath>
20 <Optimize>True</Optimize>
21 <DefineConstants>TRACE</DefineConstants>
22 <DebugSymbols>False</DebugSymbols>
23 <DebugType>None</DebugType>
24 <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow>
25 </PropertyGroup>
26 <ItemGroup>
27 <Reference Include="System" />
28 <Reference Include="System.Xml" />
29 <Reference Include="libsecondlife">
30 <HintPath>..\..\..\bin\libsecondlife.dll</HintPath>
31 <SpecificVersion>False</SpecificVersion>
32 </Reference>
33 <Reference Include="Db4objects.Db4o">
34 <HintPath>..\..\..\bin\Db4objects.Db4o.dll</HintPath>
35 <SpecificVersion>False</SpecificVersion>
36 </Reference>
37 </ItemGroup>
38 <ItemGroup>
39 <Compile Include="Db4LocalStorage.cs" />
40 </ItemGroup>
41 <ItemGroup>
42 <ProjectReference Include="..\..\ServerConsole\ServerConsole\ServerConsole.csproj">
43 <Project>{C9A6026D-8E0C-4FE4-8691-FB2A566AA245}</Project>
44 <Name>ServerConsole</Name>
45 </ProjectReference>
46 <ProjectReference Include="..\..\GridInterfaces\GridInterfaces.csproj">
47 <Project>{5DA3174D-42F9-416D-9F0B-AF41FA2BE2F9}</Project>
48 <Name>GridInterfaces</Name>
49 </ProjectReference>
50 </ItemGroup>
51 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
52</Project> \ No newline at end of file
diff --git a/src/LocalStorage/default.build b/src/LocalStorage/default.build
deleted file mode 100644
index 5ed183e..0000000
--- a/src/LocalStorage/default.build
+++ /dev/null
@@ -1,53 +0,0 @@
1<?xml version="1.0"?>
2 <project name="OpenSim" default="build" basedir=".">
3 <description>nant buildfile for OpenSim</description>
4 <property name="debug" value="true" overwrite="false" />
5 <target name="clean" description="remove all generated files">
6 <delete file="../bin/Db4LocalStorage.dll" failonerror="false" />
7 </target>
8
9 <target name="svnupdate" description="updates to latest SVN">
10 <exec program="svn">
11 <arg value="update" />
12 </exec>
13 </target>
14
15 <target name="upgrade" description="updates from SVN and then builds" depends="clean,svnupdate,build">
16
17 </target>
18
19 <target name="build" description="compiles the source code">
20
21 <loadfile file="../../VERSION" property="svnver"/>
22 <asminfo output="Db4LocalStorage/AssemblyInfo.cs" language="CSharp">
23 <imports>
24 <import namespace="System" />
25 <import namespace="System.Reflection" />
26 <import namespace="System.Runtime.InteropServices" />
27 </imports>
28 <attributes>
29 <attribute type="ComVisibleAttribute" value="false" />
30 <attribute type="CLSCompliantAttribute" value="false" />
31 <attribute type="AssemblyVersionAttribute" value="${svnver}" />
32 <attribute type="AssemblyTitleAttribute" value="opensim-localstorage" />
33 <attribute type="AssemblyDescriptionAttribute" value="The local storage handler" />
34 <attribute type="AssemblyCopyrightAttribute" value="Copyright © OGS development team 2007"/>
35 </attributes>
36 </asminfo>
37
38 <csc target="library" output="../../bin/Db4LocalStorage.dll" debug="${debug}" verbose="true" warninglevel="4">
39 <references basedir="../../bin/" failonempty="true">
40 <include name="System.dll" />
41 <include name="System.Data.dll" />
42 <include name="System.Xml.dll" />
43 <include name="libsecondlife.dll" />
44 <include name="GridInterfaces.dll" />
45 <include name="ServerConsole.dll" />
46 <include name="Db4objects.Db4o.dll" />
47 </references>
48 <sources basedir="Db4LocalStorage/">
49 <include name="*.cs" />
50 </sources>
51 </csc>
52 </target>
53</project>