diff options
author | gareth | 2007-04-02 11:41:45 +0000 |
---|---|---|
committer | gareth | 2007-04-02 11:41:45 +0000 |
commit | 906526bb9a28898771592fca12758ef19c19e56e (patch) | |
tree | f38b928b570e820442366f4b8d6de9f7c3146ee0 /OpenSim.Framework/UserProfileManagerBase.cs | |
parent | Moved database storage of the world map to the Db4LocalStorage so its in the ... (diff) | |
download | opensim-SC-906526bb9a28898771592fca12758ef19c19e56e.zip opensim-SC-906526bb9a28898771592fca12758ef19c19e56e.tar.gz opensim-SC-906526bb9a28898771592fca12758ef19c19e56e.tar.bz2 opensim-SC-906526bb9a28898771592fca12758ef19c19e56e.tar.xz |
Finished adding Db4o support to user profile manager
Diffstat (limited to 'OpenSim.Framework/UserProfileManagerBase.cs')
-rw-r--r-- | OpenSim.Framework/UserProfileManagerBase.cs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/OpenSim.Framework/UserProfileManagerBase.cs b/OpenSim.Framework/UserProfileManagerBase.cs index 218a98c..73f325d 100644 --- a/OpenSim.Framework/UserProfileManagerBase.cs +++ b/OpenSim.Framework/UserProfileManagerBase.cs | |||
@@ -4,6 +4,7 @@ using System.Text; | |||
4 | using libsecondlife; | 4 | using libsecondlife; |
5 | using OpenSim.Framework.Utilities; | 5 | using OpenSim.Framework.Utilities; |
6 | using OpenSim.Framework.Inventory; | 6 | using OpenSim.Framework.Inventory; |
7 | using Db4objects.Db4o; | ||
7 | 8 | ||
8 | namespace OpenSim.Framework.User | 9 | namespace OpenSim.Framework.User |
9 | { | 10 | { |
@@ -12,13 +13,19 @@ namespace OpenSim.Framework.User | |||
12 | 13 | ||
13 | public Dictionary<LLUUID, UserProfile> UserProfiles = new Dictionary<LLUUID, UserProfile>(); | 14 | public Dictionary<LLUUID, UserProfile> UserProfiles = new Dictionary<LLUUID, UserProfile>(); |
14 | 15 | ||
15 | public UserProfileManagerBase() | 16 | public UserProfileManagerBase() { |
16 | { | 17 | } |
17 | } | ||
18 | 18 | ||
19 | public virtual void InitUserProfiles() | 19 | public virtual void InitUserProfiles() |
20 | { | 20 | { |
21 | // TODO: need to load from database | 21 | IObjectContainer db; |
22 | db = Db4oFactory.OpenFile("userprofiles.yap"); | ||
23 | IObjectSet result = db.Get(typeof(UserProfile)); | ||
24 | foreach (UserProfile userprof in result) { | ||
25 | UserProfiles.Add(userprof.UUID, userprof); | ||
26 | } | ||
27 | Console.WriteLine("UserProfiles.Cs:InitUserProfiles() - Successfully loaded " + result.Count.ToString() + " from database"); | ||
28 | db.Close(); | ||
22 | } | 29 | } |
23 | 30 | ||
24 | public UserProfile GetProfileByName(string firstname, string lastname) | 31 | public UserProfile GetProfileByName(string firstname, string lastname) |