From 3e997772eaddb3c0273c002fb1d8b0cab85cf8d8 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Wed, 21 May 2008 20:36:34 +0000 Subject: implement in memory appearance cache for sqlite. This isn't db backed, but will hang around between reboots. --- OpenSim/Data/SQLite/SQLiteUserData.cs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index d943f53..85dd47b 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -59,6 +59,7 @@ namespace OpenSim.Data.SQLite private const string AvatarPickerAndSQL = "select * from users where username like :username and surname like :surname"; private const string AvatarPickerOrSQL = "select * from users where username like :username or surname like :surname"; + private Dictionary aplist = new Dictionary(); private DataSet ds; private SqliteDataAdapter da; private SqliteDataAdapter daf; @@ -479,15 +480,23 @@ namespace OpenSim.Data.SQLite } /// Appearance - /// TODO: stubs for now to get us to a compiling state gently + /// TODO: stubs for now to do in memory appearance. override public AvatarAppearance GetUserAppearance(LLUUID user) { - return new AvatarAppearance(); + AvatarAppearance aa = null; + try { + aa = aplist[user]; + m_log.Info("[APPEARANCE] Found appearance for " + user.ToString() + aa.ToString()); + } catch (System.Collections.Generic.KeyNotFoundException e) { + m_log.Info("[APPEARANCE] No appearance found for " + user.ToString()); + } + return aa; } override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { - return; + appearance.Owner = user; + aplist[user] = appearance; } override public void AddAttachment(LLUUID user, LLUUID item) -- cgit v1.1