blob: c21d7e22d2b09f80635f691262b2b2cbb3e7792a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
using System;
using System.Collections.Generic;
using System.Text;
using OpenGrid.Framework.Data;
using libsecondlife;
namespace OpenGrid.Framework.Data.DB4o
{
public class DB4oUserData : IUserData
{
DB4oUserManager manager = new DB4oUserManager("userprofiles.yap");
public UserProfileData getUserByUUID(LLUUID uuid)
{
if(manager.userProfiles.ContainsKey(uuid))
return manager.userProfiles[uuid];
return null;
}
public UserProfileData getUserByName(string name)
{
return getUserByName(name.Split(' ')[0], name.Split(' ')[1]);
}
public UserProfileData getUserByName(string fname, string lname)
{
foreach (UserProfileData profile in manager.userProfiles.Values)
{
if (profile.username == fname && profile.surname == lname)
return profile;
}
return null;
}
public UserAgentData getAgentByUUID(LLUUID uuid)
{
try
{
return getUserByUUID(uuid).currentAgent;
}
catch (Exception e)
{
return null;
}
}
public UserAgentData getAgentByName(string name)
{
return getAgentByName(name.Split(' ')[0], name.Split(' ')[1]);
}
public UserAgentData getAgentByName(string fname, string lname)
{
try
{
return getUserByName(fname,lname).currentAgent;
}
catch (Exception e)
{
return null;
}
}
public bool moneyTransferRequest(LLUUID from, LLUUID to, uint amount)
{
return true;
}
public bool inventoryTransferRequest(LLUUID from, LLUUID to, LLUUID item)
{
return true;
}
}
}
|