Tweak to update appearance calls
Fix for deleting inventory items from a folder.
Thanks StrawberryFride!
0.6.9-post-fixes
Justin Clark-Casey (justincc) 2010-05-21 22:40:15 +01:00
parent e589a31bc4
commit 3bd2ec7b2e
2 changed files with 17 additions and 4 deletions

View File

@ -635,9 +635,9 @@ namespace OpenSim.Data.MSSQL
/// <param name="connection">connection to the database</param>
private void DeleteItemsInFolder(UUID folderID, SqlConnection connection)
{
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryitems WHERE folderID=@folderID", connection))
using (SqlCommand command = new SqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=@parentFolderID", connection))
{
command.Parameters.Add(database.CreateParameter("folderID", folderID));
command.Parameters.Add(database.CreateParameter("parentFolderID", folderID));
try
{

View File

@ -582,8 +582,21 @@ namespace OpenSim.Data.MSSQL
/// <param name="appearance">the appearence</param>
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,