From 129e7e19c5d017e9b00e3792d73a01ad7d6eff51 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 15 May 2008 21:14:42 +0000 Subject: [PATCH] fixed the key issue that caused appearance to go wonky --- OpenSim/Data/UserDataBase.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index a4e2941ff7..7066f58b9e 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs @@ -25,14 +25,18 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +using System.Reflection; using System.Collections.Generic; using libsecondlife; +using log4net; using OpenSim.Framework; namespace OpenSim.Data { public abstract class UserDataBase : IUserData { + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); + private Dictionary aplist = new Dictionary(); public abstract UserProfileData GetUserByUUID(LLUUID user); @@ -56,14 +60,21 @@ namespace OpenSim.Data public abstract void Initialise(string connect); public abstract List GeneratePickerResults(LLUUID queryID, string query); public AvatarAppearance GetUserAppearance(LLUUID user) { - if (aplist[user] != null) { + AvatarAppearance aa; + try { + m_log.Info("[APPEARANCE] Found appearance for " + user.ToString()); + aa = aplist[user]; + } catch (System.Collections.Generic.KeyNotFoundException e) { + m_log.Info("[APPEARANCE] Setting up default appearance for " + user.ToString()); aplist[user] = new AvatarAppearance(); aplist[user].Owner = user; + aa = aplist[user]; } - return aplist[user]; + return aa; } public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { aplist[user] = appearance; + m_log.Info("[APPEARANCE] Setting appearance for " + user.ToString()); } public abstract void AddAttachment(LLUUID user, LLUUID item); public abstract void RemoveAttachment(LLUUID user, LLUUID item);