Add folder version uncrementing to XInventoryService. Fixes offline give

for avatar->avatar
avinationmerge
Melanie Thielker 2010-05-03 23:45:05 +02:00
parent 4df87631ed
commit 8ec6e42e34
1 changed files with 31 additions and 0 deletions

View File

@ -160,5 +160,36 @@ namespace OpenSim.Data.MySQL
}
}
}
public override bool Store(XInventoryItem item)
{
if (base.Store(item))
return false;
using (MySqlConnection dbcon = new MySqlConnection(m_connectionString))
{
dbcon.Open();
using (MySqlCommand cmd = new MySqlCommand())
{
cmd.Connection = dbcon;
cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID");
cmd.Parameters.AddWithValue("?folderID", item.parentFolderID.ToString());
try
{
cmd.ExecuteNonQuery();
}
catch (Exception e)
{
return false;
}
cmd.Dispose();
}
dbcon.Close();
}
return true;
}
}
}