aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
diff options
context:
space:
mode:
authorBlueWall2011-06-01 17:01:40 -0400
committerBlueWall2011-06-01 17:01:40 -0400
commitac4d080aaff6058e0855ebc842577b479c47b72a (patch)
tree918dba006ce1dbcffa7600f1546414c1b201def3 /OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
parentMerge branch 'master' of /home/opensim/src/opensim (diff)
parentAdding boolean alias for commandline switches like -save_crashes=yes (diff)
downloadopensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.zip
opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.tar.gz
opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.tar.bz2
opensim-SC_OLD-ac4d080aaff6058e0855ebc842577b479c47b72a.tar.xz
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLXInventoryData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLXInventoryData.cs32
1 files changed, 29 insertions, 3 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
index 01689a4..10b0f29 100644
--- a/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLXInventoryData.cs
@@ -66,11 +66,18 @@ namespace OpenSim.Data.MSSQL
66 66
67 public bool StoreFolder(XInventoryFolder folder) 67 public bool StoreFolder(XInventoryFolder folder)
68 { 68 {
69 if (folder.folderName.Length > 64)
70 folder.folderName = folder.folderName.Substring(0, 64);
69 return m_Folders.Store(folder); 71 return m_Folders.Store(folder);
70 } 72 }
71 73
72 public bool StoreItem(XInventoryItem item) 74 public bool StoreItem(XInventoryItem item)
73 { 75 {
76 if (item.inventoryName.Length > 64)
77 item.inventoryName = item.inventoryName.Substring(0, 64);
78 if (item.inventoryDescription.Length > 128)
79 item.inventoryDescription = item.inventoryDescription.Substring(0, 128);
80
74 return m_Items.Store(item); 81 return m_Items.Store(item);
75 } 82 }
76 83
@@ -78,7 +85,6 @@ namespace OpenSim.Data.MSSQL
78 { 85 {
79 return m_Folders.Delete(field, val); 86 return m_Folders.Delete(field, val);
80 } 87 }
81
82 public bool DeleteFolders(string[] fields, string[] vals) 88 public bool DeleteFolders(string[] fields, string[] vals)
83 { 89 {
84 return m_Folders.Delete(fields, vals); 90 return m_Folders.Delete(fields, vals);
@@ -88,12 +94,10 @@ namespace OpenSim.Data.MSSQL
88 { 94 {
89 return m_Items.Delete(field, val); 95 return m_Items.Delete(field, val);
90 } 96 }
91
92 public bool DeleteItems(string[] fields, string[] vals) 97 public bool DeleteItems(string[] fields, string[] vals)
93 { 98 {
94 return m_Items.Delete(fields, vals); 99 return m_Items.Delete(fields, vals);
95 } 100 }
96
97 public bool MoveItem(string id, string newParent) 101 public bool MoveItem(string id, string newParent)
98 { 102 {
99 return m_Items.MoveItem(id, newParent); 103 return m_Items.MoveItem(id, newParent);
@@ -172,5 +176,27 @@ namespace OpenSim.Data.MSSQL
172 176
173 } 177 }
174 } 178 }
179 public override bool Store(XInventoryItem item)
180 {
181 if (!base.Store(item))
182 return false;
183 string sql = "update inventoryfolders set version=version+1 where folderID = @folderID";
184 using (SqlConnection conn = new SqlConnection(m_ConnectionString))
185 using (SqlCommand cmd = new SqlCommand(sql, conn))
186 {
187 conn.Open();
188
189 cmd.Parameters.AddWithValue("@folderID", item.parentFolderID.ToString());
190 try
191 {
192 cmd.ExecuteNonQuery();
193 }
194 catch (Exception e)
195 {
196 return false;
197 }
198 }
199 return true;
200 }
175 } 201 }
176} 202}