aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-11-09 00:59:18 +0000
committerJustin Clark-Casey (justincc)2012-11-09 01:13:19 +0000
commit75c880a6f3631a527b532773a8a493309a96028e (patch)
treed07023ef4a277420b66f3b144df3be1287c26d92 /OpenSim/Data/SQLite
parentODECharacter overrides TargetVelocity. No change to existing behavior (diff)
downloadopensim-SC-75c880a6f3631a527b532773a8a493309a96028e.zip
opensim-SC-75c880a6f3631a527b532773a8a493309a96028e.tar.gz
opensim-SC-75c880a6f3631a527b532773a8a493309a96028e.tar.bz2
opensim-SC-75c880a6f3631a527b532773a8a493309a96028e.tar.xz
Update parent inventory folder version numbers when folders are moved/created/deleted to match version numbers cached by viewers.
This is done in the way that one would expect (e.g. moving a folder increments version number on both source and destination parent folders). This should hopefully improve viewer reuse of its cached inventory information. Currently MySQL only but will be implement for SQLite/MSSQL if there are no issues.
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/SQLiteXInventoryData.cs30
1 files changed, 27 insertions, 3 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
index 1f36986..75f8c87 100644
--- a/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
+++ b/OpenSim/Data/SQLite/SQLiteXInventoryData.cs
@@ -47,7 +47,7 @@ namespace OpenSim.Data.SQLite
47 { 47 {
48// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 48// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
49 49
50 private SQLiteGenericTableHandler<XInventoryFolder> m_Folders; 50 private SqliteFolderHandler m_Folders;
51 private SqliteItemHandler m_Items; 51 private SqliteItemHandler m_Items;
52 52
53 public SQLiteXInventoryData(string conn, string realm) 53 public SQLiteXInventoryData(string conn, string realm)
@@ -55,7 +55,7 @@ namespace OpenSim.Data.SQLite
55 if (Util.IsWindows()) 55 if (Util.IsWindows())
56 Util.LoadArchSpecificWindowsDll("sqlite3.dll"); 56 Util.LoadArchSpecificWindowsDll("sqlite3.dll");
57 57
58 m_Folders = new SQLiteGenericTableHandler<XInventoryFolder>( 58 m_Folders = new SqliteFolderHandler(
59 conn, "inventoryfolders", "XInventoryStore"); 59 conn, "inventoryfolders", "XInventoryStore");
60 m_Items = new SqliteItemHandler( 60 m_Items = new SqliteItemHandler(
61 conn, "inventoryitems", String.Empty); 61 conn, "inventoryitems", String.Empty);
@@ -114,6 +114,11 @@ namespace OpenSim.Data.SQLite
114 return m_Items.MoveItem(id, newParent); 114 return m_Items.MoveItem(id, newParent);
115 } 115 }
116 116
117 public bool MoveFolder(string id, string newParent)
118 {
119 return m_Folders.MoveFolder(id, newParent);
120 }
121
117 public XInventoryItem[] GetActiveGestures(UUID principalID) 122 public XInventoryItem[] GetActiveGestures(UUID principalID)
118 { 123 {
119 return m_Items.GetActiveGestures(principalID); 124 return m_Items.GetActiveGestures(principalID);
@@ -177,4 +182,23 @@ namespace OpenSim.Data.SQLite
177 return perms; 182 return perms;
178 } 183 }
179 } 184 }
180} 185
186 public class SqliteFolderHandler : SQLiteGenericTableHandler<XInventoryFolder>
187 {
188 public SqliteFolderHandler(string c, string t, string m) :
189 base(c, t, m)
190 {
191 }
192
193 public bool MoveFolder(string id, string newParentFolderID)
194 {
195 SqliteCommand cmd = new SqliteCommand();
196
197 cmd.CommandText = String.Format("update {0} set parentFolderID = :ParentFolderID where folderID = :FolderID", m_Realm);
198 cmd.Parameters.Add(new SqliteParameter(":ParentFolderID", newParentFolderID));
199 cmd.Parameters.Add(new SqliteParameter(":FolderID", id));
200
201 return ExecuteNonQuery(cmd, m_Connection) == 0 ? false : true;
202 }
203 }
204} \ No newline at end of file