Finished adding Db4o support to user profile manager

0.1-prestable
gareth 2007-04-02 11:41:45 +00:00
parent 1ea4ba3a18
commit 906526bb9a
7 changed files with 16 additions and 27 deletions

View File

@ -26,6 +26,7 @@
<include name="../bin/OpenSim.Framework.dll" />
<include name="../bin/OpenSim.Framework.Console.dll" />
<include name="../bin/libsecondlife.dll" />
<include name="../bin/Db4objects.Db4o.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />

View File

@ -13,7 +13,6 @@
<sources failonempty="true">
<include name="AssemblyInfo.cs" />
<include name="DbSimConfig.cs" />
<include name="MapStorage.cs" />
</sources>
<references basedir="${project::get-base-directory()}">
<lib>

View File

@ -45,6 +45,7 @@
<include name="System.dll" />
<include name="System.Xml.dll" />
<include name="../bin/libsecondlife.dll" />
<include name="../bin/Db4objects.Db4o.dll" />
</references>
</csc>
<echo message="Copying from [${project::get-base-directory()}/${build.dir}/] to [${project::get-base-directory()}/../bin/" />

View File

@ -4,6 +4,7 @@ using System.Text;
using libsecondlife;
using OpenSim.Framework.Utilities;
using OpenSim.Framework.Inventory;
using Db4objects.Db4o;
namespace OpenSim.Framework.User
{
@ -12,13 +13,19 @@ namespace OpenSim.Framework.User
public Dictionary<LLUUID, UserProfile> UserProfiles = new Dictionary<LLUUID, UserProfile>();
public UserProfileManagerBase()
{
}
public UserProfileManagerBase() {
}
public virtual void InitUserProfiles()
{
// TODO: need to load from database
IObjectContainer db;
db = Db4oFactory.OpenFile("userprofiles.yap");
IObjectSet result = db.Get(typeof(UserProfile));
foreach (UserProfile userprof in result) {
UserProfiles.Add(userprof.UUID, userprof);
}
Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database");
db.Close();
}
public UserProfile GetProfileByName(string firstname, string lastname)

View File

@ -13,6 +13,7 @@
<sources failonempty="true">
<include name="AssemblyInfo.cs" />
<include name="Db4LocalStorage.cs" />
<include name="MapStorage.cs" />
<include name="UUIDQuery.cs" />
</sources>
<references basedir="${project::get-base-directory()}">

View File

@ -68,7 +68,6 @@
<target name="build" depends="init" description="">
<nant buildfile="OpenSim.Framework/OpenSim.Framework.dll.build" target="build" />
<nant buildfile="OpenSim.Framework.Console/OpenSim.Framework.Console.dll.build" target="build" />
<nant buildfile="OpenSim.Framework/OpenSim.Framework.dll.build" target="build" />
<nant buildfile="Servers/OpenSim.Servers.dll.build" target="build" />
<nant buildfile="OpenGridServices.GridServer/OpenGridServices.GridServer.exe.build" target="build" />
<nant buildfile="OpenGridServices.UserServer/OpenGridServices.UserServer.exe.build" target="build" />

View File

@ -50,6 +50,7 @@
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="libsecondlife.dll"/>
<Reference name="Db4objects.Db4o.dll"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
@ -74,27 +75,6 @@
</Files>
</Project>
<Project name="OpenSim.Framework" path="OpenSim.Framework" type="Library">
<Configuration name="Debug">
<Options>
<OutputPath>../bin/</OutputPath>
</Options>
</Configuration>
<Configuration name="Release">
<Options>
<OutputPath>../bin/</OutputPath>
</Options>
</Configuration>
<ReferencePath>../bin/</ReferencePath>
<Reference name="System"/>
<Reference name="System.Xml"/>
<Reference name="libsecondlife.dll"/>
<Files>
<Match pattern="*.cs" recurse="true"/>
</Files>
</Project>
<Project name="OpenSim.Servers" path="Servers" type="Library">
<Configuration name="Debug">
<Options>
@ -167,6 +147,7 @@
<Reference name="OpenSim.Framework"/>
<Reference name="OpenSim.Framework.Console"/>
<Reference name="libsecondlife.dll"/>
<Reference name="Db4objects.Db4o.dll"/>
<Files>
<Match pattern="*.cs" recurse="true"/>