diff options
author | Adam Frisby | 2007-05-05 21:49:24 +0000 |
---|---|---|
committer | Adam Frisby | 2007-05-05 21:49:24 +0000 |
commit | 51da80a8506f08511c45e8fd87044989f8221b87 (patch) | |
tree | b7951215e4a07f1742766540ea4f9464fbdd4061 /OpenGrid.Framework.Data.DB4o/DB4oGridData.cs | |
parent | Run prebuild to generate working project files. (diff) | |
download | opensim-SC_OLD-51da80a8506f08511c45e8fd87044989f8221b87.zip opensim-SC_OLD-51da80a8506f08511c45e8fd87044989f8221b87.tar.gz opensim-SC_OLD-51da80a8506f08511c45e8fd87044989f8221b87.tar.bz2 opensim-SC_OLD-51da80a8506f08511c45e8fd87044989f8221b87.tar.xz |
Grid Framework for DB4o - supports all framework.data interfaces.
*** Important Note *** Framework.Data interfaces are not yet complete (they are strictly read-only right now), because of this, write support is not yet implemented.
Diffstat (limited to 'OpenGrid.Framework.Data.DB4o/DB4oGridData.cs')
-rw-r--r-- | OpenGrid.Framework.Data.DB4o/DB4oGridData.cs | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs b/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs new file mode 100644 index 0000000..d15e343 --- /dev/null +++ b/OpenGrid.Framework.Data.DB4o/DB4oGridData.cs | |||
@@ -0,0 +1,63 @@ | |||
1 | using System; | ||
2 | using System.Collections.Generic; | ||
3 | using System.Text; | ||
4 | using OpenGrid.Framework.Data; | ||
5 | using libsecondlife; | ||
6 | |||
7 | |||
8 | namespace OpenGrid.Framework.Data.DB4o | ||
9 | { | ||
10 | class DB4oGridData : IGridData | ||
11 | { | ||
12 | DB4oManager manager; | ||
13 | |||
14 | public void Initialise() { | ||
15 | manager = new DB4oManager("gridserver.yap"); | ||
16 | } | ||
17 | |||
18 | public SimProfileData GetProfileByHandle(ulong handle) { | ||
19 | lock (manager.profiles) | ||
20 | { | ||
21 | foreach (LLUUID UUID in manager.profiles.Keys) | ||
22 | { | ||
23 | if (manager.profiles[UUID].regionHandle == handle) | ||
24 | { | ||
25 | return manager.profiles[UUID]; | ||
26 | } | ||
27 | } | ||
28 | } | ||
29 | throw new Exception("Unable to find profile with handle (" + handle.ToString() + ")"); | ||
30 | } | ||
31 | |||
32 | public SimProfileData GetProfileByLLUUID(LLUUID uuid) | ||
33 | { | ||
34 | lock (manager.profiles) | ||
35 | { | ||
36 | if (manager.profiles.ContainsKey(uuid)) | ||
37 | return manager.profiles[uuid]; | ||
38 | } | ||
39 | throw new Exception("Unable to find profile with UUID (" + uuid.ToStringHyphenated() + ")"); | ||
40 | } | ||
41 | |||
42 | public bool AuthenticateSim(LLUUID uuid, ulong handle, string key) { | ||
43 | if (manager.profiles[uuid].regionRecvKey == key) | ||
44 | return true; | ||
45 | return false; | ||
46 | } | ||
47 | |||
48 | public void Close() | ||
49 | { | ||
50 | manager = null; | ||
51 | } | ||
52 | |||
53 | public string getName() | ||
54 | { | ||
55 | return "DB4o Grid Provider"; | ||
56 | } | ||
57 | |||
58 | public string getVersion() | ||
59 | { | ||
60 | return "0.1"; | ||
61 | } | ||
62 | } | ||
63 | } | ||