diff options
Diffstat (limited to '')
-rw-r--r-- | OpenGridServices.GridServer/SimProfiles.cs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/OpenGridServices.GridServer/SimProfiles.cs b/OpenGridServices.GridServer/SimProfiles.cs index 253c2d4..7aff434 100644 --- a/OpenGridServices.GridServer/SimProfiles.cs +++ b/OpenGridServices.GridServer/SimProfiles.cs | |||
@@ -33,7 +33,9 @@ using System.Collections; | |||
33 | using System.Collections.Generic; | 33 | using System.Collections.Generic; |
34 | using libsecondlife; | 34 | using libsecondlife; |
35 | using OpenSim.Framework.Utilities; | 35 | using OpenSim.Framework.Utilities; |
36 | using OpenSim.Framework.Console; | ||
36 | using OpenSim.Framework.Sims; | 37 | using OpenSim.Framework.Sims; |
38 | using Db4objects.Db4o; | ||
37 | 39 | ||
38 | namespace OpenGridServices.GridServer | 40 | namespace OpenGridServices.GridServer |
39 | { | 41 | { |
@@ -46,8 +48,15 @@ namespace OpenGridServices.GridServer | |||
46 | public SimProfileManager() { | 48 | public SimProfileManager() { |
47 | } | 49 | } |
48 | 50 | ||
49 | public void InitSimProfiles() { | 51 | public void LoadProfiles() { // should abstract this out |
50 | // TODO: need to load from database | 52 | IObjectContainer db; |
53 | db = Db4oFactory.OpenFile("simprofiles.yap"); | ||
54 | IObjectSet result = db.Get(typeof(SimProfileBase)); | ||
55 | foreach (SimProfileBase simprof in result) { | ||
56 | SimProfiles.Add(simprof.UUID, simprof); | ||
57 | } | ||
58 | MainConsole.Instance.WriteLine("SimProfiles.Cs:LoadProfiles() - Successfully loaded " + result.Count.ToString() + " from database"); | ||
59 | db.Close(); | ||
51 | } | 60 | } |
52 | 61 | ||
53 | public SimProfileBase GetProfileByHandle(ulong reqhandle) { | 62 | public SimProfileBase GetProfileByHandle(ulong reqhandle) { |