From e985e05a5ad7df4c5f01763dfe6b82cc1b37ab83 Mon Sep 17 00:00:00 2001 From: gareth Date: Mon, 2 Apr 2007 00:48:25 +0000 Subject: Added new REST protocol (partially complete) Made sim profiles load from DB Updated build files for grid server Added sim login --- OpenGridServices.GridServer/SimProfiles.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'OpenGridServices.GridServer/SimProfiles.cs') 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; using System.Collections.Generic; using libsecondlife; using OpenSim.Framework.Utilities; +using OpenSim.Framework.Console; using OpenSim.Framework.Sims; +using Db4objects.Db4o; namespace OpenGridServices.GridServer { @@ -46,8 +48,15 @@ namespace OpenGridServices.GridServer public SimProfileManager() { } - public void InitSimProfiles() { - // TODO: need to load from database + public void LoadProfiles() { // should abstract this out + IObjectContainer db; + db = Db4oFactory.OpenFile("simprofiles.yap"); + IObjectSet result = db.Get(typeof(SimProfileBase)); + foreach (SimProfileBase simprof in result) { + SimProfiles.Add(simprof.UUID, simprof); + } + MainConsole.Instance.WriteLine("SimProfiles.Cs:LoadProfiles() - Successfully loaded " + result.Count.ToString() + " from database"); + db.Close(); } public SimProfileBase GetProfileByHandle(ulong reqhandle) { -- cgit v1.1