From 4a9ee9f870b53abbc5ba8814c35d694c3fd186a1 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 15 May 2008 20:25:42 +0000 Subject: testing avatar appearance as a user service --- OpenSim/Data/MSSQL/MSSQLUserData.cs | 18 +++++++++--------- OpenSim/Data/MySQL/MySQLUserData.cs | 18 +++++++++--------- OpenSim/Data/NHibernate/NHibernateUserData.cs | 4 ++-- OpenSim/Data/SQLite/SQLiteUserData.cs | 18 +++++++++--------- OpenSim/Data/UserDataBase.cs | 14 ++++++++++++-- 5 files changed, 41 insertions(+), 31 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 4904bfe..844b7fa 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -747,15 +747,15 @@ namespace OpenSim.Data.MSSQL /// Appearance /// TODO: stubs for now to get us to a compiling state gently - override public AvatarAppearance GetUserAppearance(LLUUID user) - { - return new AvatarAppearance(); - } - - override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) - { - return; - } + // override public AvatarAppearance GetUserAppearance(LLUUID user) + // { + // return new AvatarAppearance(); + // } + + // override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) + // { + // return; + // } override public void AddAttachment(LLUUID user, LLUUID item) { diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index 622a618..a1e1094 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs @@ -630,15 +630,15 @@ namespace OpenSim.Data.MySQL /// Appearance /// TODO: stubs for now to get us to a compiling state gently - override public AvatarAppearance GetUserAppearance(LLUUID user) - { - return new AvatarAppearance(); - } - - override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) - { - return; - } + // override public AvatarAppearance GetUserAppearance(LLUUID user) + // { + // return new AvatarAppearance(); + // } + + // override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) + // { + // return; + // } override public void AddAttachment(LLUUID user, LLUUID item) { diff --git a/OpenSim/Data/NHibernate/NHibernateUserData.cs b/OpenSim/Data/NHibernate/NHibernateUserData.cs index 81af4d4..6ba2783 100644 --- a/OpenSim/Data/NHibernate/NHibernateUserData.cs +++ b/OpenSim/Data/NHibernate/NHibernateUserData.cs @@ -306,7 +306,7 @@ namespace OpenSim.Data.NHibernate /// Appearance /// TODO: stubs for now to get us to a compiling state gently - override public AvatarAppearance GetUserAppearance(LLUUID user) + public AvatarAppearance GetUserAppearance(LLUUID user) { AvatarAppearance appearance; // TODO: I'm sure I'll have to do something silly here @@ -328,7 +328,7 @@ namespace OpenSim.Data.NHibernate } - override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) + public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { bool exists = ExistsAppearance(user); using (ISession session = factory.OpenSession()) diff --git a/OpenSim/Data/SQLite/SQLiteUserData.cs b/OpenSim/Data/SQLite/SQLiteUserData.cs index e80a0a9..8f78e0b 100644 --- a/OpenSim/Data/SQLite/SQLiteUserData.cs +++ b/OpenSim/Data/SQLite/SQLiteUserData.cs @@ -480,15 +480,15 @@ namespace OpenSim.Data.SQLite /// Appearance /// TODO: stubs for now to get us to a compiling state gently - override public AvatarAppearance GetUserAppearance(LLUUID user) - { - return new AvatarAppearance(); - } - - override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) - { - return; - } + // override public AvatarAppearance GetUserAppearance(LLUUID user) + // { + // return new AvatarAppearance(); + // } + + // override public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) + // { + // return; + // } override public void AddAttachment(LLUUID user, LLUUID item) { diff --git a/OpenSim/Data/UserDataBase.cs b/OpenSim/Data/UserDataBase.cs index fb784dc..a4e2941 100644 --- a/OpenSim/Data/UserDataBase.cs +++ b/OpenSim/Data/UserDataBase.cs @@ -33,6 +33,8 @@ namespace OpenSim.Data { public abstract class UserDataBase : IUserData { + private Dictionary aplist = new Dictionary(); + public abstract UserProfileData GetUserByUUID(LLUUID user); public abstract UserProfileData GetUserByName(string fname, string lname); public abstract UserAgentData GetAgentByUUID(LLUUID user); @@ -53,8 +55,16 @@ namespace OpenSim.Data public abstract string Name {get;} public abstract void Initialise(string connect); public abstract List GeneratePickerResults(LLUUID queryID, string query); - public abstract AvatarAppearance GetUserAppearance(LLUUID user); - public abstract void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance); + public AvatarAppearance GetUserAppearance(LLUUID user) { + if (aplist[user] != null) { + aplist[user] = new AvatarAppearance(); + aplist[user].Owner = user; + } + return aplist[user]; + } + public void UpdateUserAppearance(LLUUID user, AvatarAppearance appearance) { + aplist[user] = appearance; + } public abstract void AddAttachment(LLUUID user, LLUUID item); public abstract void RemoveAttachment(LLUUID user, LLUUID item); public abstract List GetAttachments(LLUUID user); -- cgit v1.1