diff options
author | Melanie Thielker | 2010-05-03 23:45:05 +0200 |
---|---|---|
committer | Melanie Thielker | 2010-05-03 23:45:05 +0200 |
commit | 8ec6e42e34c8ef72474852085c4d5531a6d5ac93 (patch) | |
tree | 590d96ec0218a81ceb2e1f38cbed72dceec1ba34 | |
parent | Store given items in correct parent folder. Fixes items given to offline avatars (diff) | |
download | opensim-SC-8ec6e42e34c8ef72474852085c4d5531a6d5ac93.zip opensim-SC-8ec6e42e34c8ef72474852085c4d5531a6d5ac93.tar.gz opensim-SC-8ec6e42e34c8ef72474852085c4d5531a6d5ac93.tar.bz2 opensim-SC-8ec6e42e34c8ef72474852085c4d5531a6d5ac93.tar.xz |
Add folder version uncrementing to XInventoryService. Fixes offline give
for avatar->avatar
-rw-r--r-- | OpenSim/Data/MySQL/MySQLXInventoryData.cs | 31 |
1 files changed, 31 insertions, 0 deletions
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 | |||
160 | } | 160 | } |
161 | } | 161 | } |
162 | } | 162 | } |
163 | |||
164 | public override bool Store(XInventoryItem item) | ||
165 | { | ||
166 | if (base.Store(item)) | ||
167 | return false; | ||
168 | |||
169 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | ||
170 | { | ||
171 | dbcon.Open(); | ||
172 | |||
173 | using (MySqlCommand cmd = new MySqlCommand()) | ||
174 | { | ||
175 | cmd.Connection = dbcon; | ||
176 | |||
177 | cmd.CommandText = String.Format("update inventoryfolders set version=version+1 where folderID = ?folderID"); | ||
178 | cmd.Parameters.AddWithValue("?folderID", item.parentFolderID.ToString()); | ||
179 | |||
180 | try | ||
181 | { | ||
182 | cmd.ExecuteNonQuery(); | ||
183 | } | ||
184 | catch (Exception e) | ||
185 | { | ||
186 | return false; | ||
187 | } | ||
188 | cmd.Dispose(); | ||
189 | } | ||
190 | dbcon.Close(); | ||
191 | } | ||
192 | return true; | ||
193 | } | ||
163 | } | 194 | } |
164 | } | 195 | } |