aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim.Framework
diff options
context:
space:
mode:
authorgareth2007-04-02 12:19:13 +0000
committergareth2007-04-02 12:19:13 +0000
commit9a0b105ad78f802d6fe08806a1b975cd9fdf317f (patch)
treecdabea85cb406c085cfdd68ecb5460f042cb8555 /OpenSim.Framework
parentFinished adding Db4o support to user profile manager (diff)
downloadopensim-SC_OLD-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.zip
opensim-SC_OLD-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.tar.gz
opensim-SC_OLD-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.tar.bz2
opensim-SC_OLD-9a0b105ad78f802d6fe08806a1b975cd9fdf317f.tar.xz
Added DB backing for user profiles
Added "create profile command"
Diffstat (limited to 'OpenSim.Framework')
-rw-r--r--OpenSim.Framework/UserProfileManagerBase.cs20
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim.Framework/UserProfileManagerBase.cs b/OpenSim.Framework/UserProfileManagerBase.cs
index 73f325d..c022feb 100644
--- a/OpenSim.Framework/UserProfileManagerBase.cs
+++ b/OpenSim.Framework/UserProfileManagerBase.cs
@@ -28,6 +28,22 @@ namespace OpenSim.Framework.User
28 db.Close(); 28 db.Close();
29 } 29 }
30 30
31 public virtual void SaveUserProfiles() // ZOMG! INEFFICIENT!
32 {
33 IObjectContainer db;
34 db = Db4oFactory.OpenFile("userprofiles.yap");
35 IObjectSet result = db.Get(typeof(UserProfile));
36 foreach (UserProfile userprof in result) {
37 db.Delete(userprof);
38 db.Commit();
39 }
40 foreach (UserProfile userprof in UserProfiles.Values) {
41 db.Set(userprof);
42 db.Commit();
43 }
44 db.Close();
45 }
46
31 public UserProfile GetProfileByName(string firstname, string lastname) 47 public UserProfile GetProfileByName(string firstname, string lastname)
32 { 48 {
33 foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys) 49 foreach (libsecondlife.LLUUID UUID in UserProfiles.Keys)
@@ -86,8 +102,8 @@ namespace OpenSim.Framework.User
86 newprofile.UUID = LLUUID.Random(); 102 newprofile.UUID = LLUUID.Random();
87 newprofile.Inventory.CreateRootFolder(newprofile.UUID, true); 103 newprofile.Inventory.CreateRootFolder(newprofile.UUID, true);
88 this.UserProfiles.Add(newprofile.UUID, newprofile); 104 this.UserProfiles.Add(newprofile.UUID, newprofile);
89 return newprofile; 105 return newprofile;
90 } 106 }
91 107
92 public virtual AgentInventory GetUsersInventory(LLUUID agentID) 108 public virtual AgentInventory GetUsersInventory(LLUUID agentID)
93 { 109 {