From 92dff5edb1333a798e21f956ea6291b357dd0c20 Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Mon, 3 May 2010 23:45:05 +0200 Subject: Add folder version incrementing to XInventoryService. Fixes offline give for avatar->avatar --- OpenSim/Data/MySQL/MySQLXInventoryData.cs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/OpenSim/Data/MySQL/MySQLXInventoryData.cs b/OpenSim/Data/MySQL/MySQLXInventoryData.cs index 307a4c7..a3b728b 100644 --- a/OpenSim/Data/MySQL/MySQLXInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLXInventoryData.cs @@ -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; + } } } -- cgit v1.1