aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-04-30 19:28:36 +0000
committerJustin Clarke Casey2008-04-30 19:28:36 +0000
commit8ed9e578968539ff991ffa8215e715c0e4c3be5d (patch)
tree36a5de69d383f9219d53cb17783331d97a911e3c /OpenSim/Data/MSSQL/MSSQLInventoryData.cs
parent* Change new inventory groupID field to 36 rather than 63 (diff)
downloadopensim-SC_OLD-8ed9e578968539ff991ffa8215e715c0e4c3be5d.zip
opensim-SC_OLD-8ed9e578968539ff991ffa8215e715c0e4c3be5d.tar.gz
opensim-SC_OLD-8ed9e578968539ff991ffa8215e715c0e4c3be5d.tar.bz2
opensim-SC_OLD-8ed9e578968539ff991ffa8215e715c0e4c3be5d.tar.xz
* Add a scratch implementation of the new inventory fields to the mssql database adapter
* I don't use mssql so this may not work, corrections (in the form of patches) are welcome. * Unlike mysql, mssql requires manual updating of existing tables here (which should mean just adding the new fields manually)
Diffstat (limited to 'OpenSim/Data/MSSQL/MSSQLInventoryData.cs')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLInventoryData.cs26
1 files changed, 23 insertions, 3 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
index c524fc0..e23178c 100644
--- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
@@ -321,6 +321,13 @@ namespace OpenSim.Data.MSSQL
321 item.Creator = new LLUUID((string) reader["creatorID"]); 321 item.Creator = new LLUUID((string) reader["creatorID"]);
322 item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]); 322 item.BasePermissions = Convert.ToUInt32(reader["inventoryBasePermissions"]);
323 item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]); 323 item.EveryOnePermissions = Convert.ToUInt32(reader["inventoryEveryOnePermissions"]);
324 item.SalePrice = (int) reader["salePrice"];
325 item.SaleType = Convert.ToByte(reader["saleType"]);
326 item.CreationDate = (int) reader["creationDate"];
327 item.GroupID = new LLUUID(reader["groupID"].ToString());
328 item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]);
329 item.Flags = (uint) reader["flags"];
330
324 return item; 331 return item;
325 } 332 }
326 catch (SqlException e) 333 catch (SqlException e)
@@ -440,10 +447,16 @@ namespace OpenSim.Data.MSSQL
440 447
441 string sql = "INSERT INTO inventoryitems"; 448 string sql = "INSERT INTO inventoryitems";
442 sql += 449 sql +=
443 "([inventoryID], [assetID], [assetType], [parentFolderID], [avatarID], [inventoryName], [inventoryDescription], [inventoryNextPermissions], [inventoryCurrentPermissions], [invType], [creatorID], [inventoryBasePermissions], [inventoryEveryOnePermissions]) VALUES "; 450 "([inventoryID], [assetID], [assetType], [parentFolderID], [avatarID], [inventoryName]"
451 + ", [inventoryDescription], [inventoryNextPermissions], [inventoryCurrentPermissions]"
452 + ", [invType], [creatorID], [inventoryBasePermissions], [inventoryEveryOnePermissions]"
453 + ", [salePrice], [saleType], [creationDate], [groupID], [groupOwned], [flags]) VALUES ";
444 sql += 454 sql +=
445 "(@inventoryID, @assetID, @assetType, @parentFolderID, @avatarID, @inventoryName, @inventoryDescription, @inventoryNextPermissions, @inventoryCurrentPermissions, @invType, @creatorID, @inventoryBasePermissions, @inventoryEveryOnePermissions);"; 455 "(@inventoryID, @assetID, @assetType, @parentFolderID, @avatarID, @inventoryName, @inventoryDescription"
446 456 + ", @inventoryNextPermissions, @inventoryCurrentPermissions, @invType, @creatorID"
457 + ", @inventoryBasePermissions, @inventoryEveryOnePermissions, @salePrice, @saleType"
458 + ", @creationDate, @groupID, @groupOwned, @flags);";
459
447 try 460 try
448 { 461 {
449 Dictionary<string, string> param = new Dictionary<string, string>(); 462 Dictionary<string, string> param = new Dictionary<string, string>();
@@ -460,6 +473,13 @@ namespace OpenSim.Data.MSSQL
460 param["creatorID"] = item.Creator.ToString(); 473 param["creatorID"] = item.Creator.ToString();
461 param["inventoryBasePermissions"] = Convert.ToString(item.BasePermissions); 474 param["inventoryBasePermissions"] = Convert.ToString(item.BasePermissions);
462 param["inventoryEveryOnePermissions"] = Convert.ToString(item.EveryOnePermissions); 475 param["inventoryEveryOnePermissions"] = Convert.ToString(item.EveryOnePermissions);
476
477 param["salePrice"] = Convert.ToString(item.SalePrice);
478 param["saleType"] = Convert.ToString(item.SaleType);
479 param["creationDate"] = Convert.ToString(item.CreationDate);
480 param["groupID"] = item.GroupID.ToString();
481 param["groupOwned"] = Convert.ToString(item.GroupOwned);
482 param["flags"] = Convert.ToString(item.Flags);
463 483
464 IDbCommand result = database.Query(sql, param); 484 IDbCommand result = database.Query(sql, param);
465 result.ExecuteNonQuery(); 485 result.ExecuteNonQuery();