aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
diff options
context:
space:
mode:
authorMW2007-05-07 16:53:22 +0000
committerMW2007-05-07 16:53:22 +0000
commitca785403a10bc0a185d9f2e90479b0f8fb75ca31 (patch)
tree8d3433651a8670bb892b4f56c9feb27017a68253 /OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
parentRenamed to DEVEL (diff)
downloadopensim-SC_OLD-ca785403a10bc0a185d9f2e90479b0f8fb75ca31.zip
opensim-SC_OLD-ca785403a10bc0a185d9f2e90479b0f8fb75ca31.tar.gz
opensim-SC_OLD-ca785403a10bc0a185d9f2e90479b0f8fb75ca31.tar.bz2
opensim-SC_OLD-ca785403a10bc0a185d9f2e90479b0f8fb75ca31.tar.xz
merged in missing file from 0.1-prestable
Diffstat (limited to '')
-rw-r--r--OpenGrid.Framework.Data.DB4o/DB4oUserData.cs75
1 files changed, 75 insertions, 0 deletions
diff --git a/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs b/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
new file mode 100644
index 0000000..c21d7e2
--- /dev/null
+++ b/OpenGrid.Framework.Data.DB4o/DB4oUserData.cs
@@ -0,0 +1,75 @@
1using System;
2using System.Collections.Generic;
3using System.Text;
4using OpenGrid.Framework.Data;
5using libsecondlife;
6
7namespace OpenGrid.Framework.Data.DB4o
8{
9 public class DB4oUserData : IUserData
10 {
11 DB4oUserManager manager = new DB4oUserManager("userprofiles.yap");
12
13 public UserProfileData getUserByUUID(LLUUID uuid)
14 {
15 if(manager.userProfiles.ContainsKey(uuid))
16 return manager.userProfiles[uuid];
17 return null;
18 }
19
20 public UserProfileData getUserByName(string name)
21 {
22 return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
23 }
24
25 public UserProfileData getUserByName(string fname, string lname)
26 {
27 foreach (UserProfileData profile in manager.userProfiles.Values)
28 {
29 if (profile.username == fname && profile.surname == lname)
30 return profile;
31 }
32 return null;
33 }
34
35 public UserAgentData getAgentByUUID(LLUUID uuid)
36 {
37 try
38 {
39 return getUserByUUID(uuid).currentAgent;
40 }
41 catch (Exception e)
42 {
43 return null;
44 }
45 }
46
47 public UserAgentData getAgentByName(string name)
48 {
49 return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
50 }
51
52 public UserAgentData getAgentByName(string fname, string lname)
53 {
54 try
55 {
56 return getUserByName(fname,lname).currentAgent;
57 }
58 catch (Exception e)
59 {
60 return null;
61 }
62 }
63
64 public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
65 {
66 return true;
67 }
68
69 public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
70 {
71 return true;
72 }
73
74 }
75}