From 3bd2ec7b2e9eeaaff62872c5a61b6cee358f51a1 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 21 May 2010 22:40:15 +0100 Subject: Apply http://opensimulator.org/mantis/view.php?id=4724 Tweak to update appearance calls Fix for deleting inventory items from a folder. Thanks StrawberryFride! --- OpenSim/Data/MSSQL/MSSQLUserData.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'OpenSim/Data/MSSQL/MSSQLUserData.cs') diff --git a/OpenSim/Data/MSSQL/MSSQLUserData.cs b/OpenSim/Data/MSSQL/MSSQLUserData.cs index 3ef1053..7fe8ed0 100644 --- a/OpenSim/Data/MSSQL/MSSQLUserData.cs +++ b/OpenSim/Data/MSSQL/MSSQLUserData.cs @@ -582,8 +582,21 @@ namespace OpenSim.Data.MSSQL /// the appearence override public void UpdateUserAppearance(UUID user, AvatarAppearance appearance) { - string sql = @"DELETE FROM avatarappearance WHERE owner=@owner; - INSERT INTO avatarappearance + string sql = @"DELETE FROM avatarappearance WHERE owner=@owner"; + using (AutoClosingSqlCommand cmd = database.Query(sql)) + { + cmd.Parameters.Add(database.CreateParameter("@owner", appearance.Owner)); + try + { + cmd.ExecuteNonQuery(); + } + catch (Exception e) + { + m_log.ErrorFormat("[USER DB] Error deleting old user appearance, error: {0}", e.Message); + } + } + + sql=@"INSERT INTO avatarappearance (owner, serial, visual_params, texture, avatar_height, body_item, body_asset, skin_item, skin_asset, hair_item, hair_asset, eyes_item, eyes_asset, shirt_item, shirt_asset, -- cgit v1.1