diff options
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLAssetData.cs | 10 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLDataStore.cs | 184 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLInventoryData.cs | 24 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLManager.cs | 16 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLUserData.cs | 20 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Properties/AssemblyInfo.cs | 10 |
6 files changed, 132 insertions, 132 deletions
diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index 7e6289b..e556352 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs | |||
@@ -79,7 +79,7 @@ namespace OpenSim.Data.MySQL | |||
79 | _dbConnection.Connection); | 79 | _dbConnection.Connection); |
80 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); | 80 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); |
81 | p.Value = assetID.GetBytes(); | 81 | p.Value = assetID.GetBytes(); |
82 | 82 | ||
83 | try | 83 | try |
84 | { | 84 | { |
85 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) | 85 | using (MySqlDataReader dbReader = cmd.ExecuteReader(CommandBehavior.SingleRow)) |
@@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL | |||
111 | } | 111 | } |
112 | 112 | ||
113 | override public void CreateAsset(AssetBase asset) | 113 | override public void CreateAsset(AssetBase asset) |
114 | { | 114 | { |
115 | lock (_dbConnection) | 115 | lock (_dbConnection) |
116 | { | 116 | { |
117 | MySqlCommand cmd = | 117 | MySqlCommand cmd = |
@@ -119,10 +119,10 @@ namespace OpenSim.Data.MySQL | |||
119 | "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + | 119 | "REPLACE INTO assets(id, name, description, assetType, invType, local, temporary, data)" + |
120 | "VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)", | 120 | "VALUES(?id, ?name, ?description, ?assetType, ?invType, ?local, ?temporary, ?data)", |
121 | _dbConnection.Connection); | 121 | _dbConnection.Connection); |
122 | 122 | ||
123 | // need to ensure we dispose | 123 | // need to ensure we dispose |
124 | try | 124 | try |
125 | { | 125 | { |
126 | using (cmd) | 126 | using (cmd) |
127 | { | 127 | { |
128 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); | 128 | MySqlParameter p = cmd.Parameters.Add("?id", MySqlDbType.Binary, 16); |
@@ -145,7 +145,7 @@ namespace OpenSim.Data.MySQL | |||
145 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() | 145 | "MySql failure creating asset {0} with name {1}" + Environment.NewLine + e.ToString() |
146 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); | 146 | + Environment.NewLine + "Attempting reconnection", asset.FullID, asset.Name); |
147 | _dbConnection.Reconnect(); | 147 | _dbConnection.Reconnect(); |
148 | } | 148 | } |
149 | } | 149 | } |
150 | } | 150 | } |
151 | 151 | ||
diff --git a/OpenSim/Data/MySQL/MySQLDataStore.cs b/OpenSim/Data/MySQL/MySQLDataStore.cs index ac0d382..3c39a5e 100644 --- a/OpenSim/Data/MySQL/MySQLDataStore.cs +++ b/OpenSim/Data/MySQL/MySQLDataStore.cs | |||
@@ -50,12 +50,12 @@ namespace OpenSim.Data.MySQL | |||
50 | private const string m_terrainSelect = "select * from terrain limit 1"; | 50 | private const string m_terrainSelect = "select * from terrain limit 1"; |
51 | private const string m_landSelect = "select * from land"; | 51 | private const string m_landSelect = "select * from land"; |
52 | private const string m_landAccessListSelect = "select * from landaccesslist"; | 52 | private const string m_landAccessListSelect = "select * from landaccesslist"; |
53 | 53 | ||
54 | 54 | ||
55 | /// <summary> | 55 | /// <summary> |
56 | /// We're only using this to version the table! | 56 | /// We're only using this to version the table! |
57 | /// </summary> | 57 | /// </summary> |
58 | 58 | ||
59 | 59 | ||
60 | private DataSet m_dataSet; | 60 | private DataSet m_dataSet; |
61 | private MySqlDataAdapter m_primDataAdapter; | 61 | private MySqlDataAdapter m_primDataAdapter; |
@@ -65,16 +65,16 @@ namespace OpenSim.Data.MySQL | |||
65 | private MySqlDataAdapter m_terrainDataAdapter; | 65 | private MySqlDataAdapter m_terrainDataAdapter; |
66 | private MySqlDataAdapter m_landDataAdapter; | 66 | private MySqlDataAdapter m_landDataAdapter; |
67 | private MySqlDataAdapter m_landAccessListDataAdapter; | 67 | private MySqlDataAdapter m_landAccessListDataAdapter; |
68 | 68 | ||
69 | private DataTable m_primTable; | 69 | private DataTable m_primTable; |
70 | private DataTable m_shapeTable; | 70 | private DataTable m_shapeTable; |
71 | private DataTable m_itemsTable; | 71 | private DataTable m_itemsTable; |
72 | private DataTable m_terrainTable; | 72 | private DataTable m_terrainTable; |
73 | private DataTable m_landTable; | 73 | private DataTable m_landTable; |
74 | private DataTable m_landAccessListTable; | 74 | private DataTable m_landAccessListTable; |
75 | 75 | ||
76 | // Temporary attribute while this is experimental | 76 | // Temporary attribute while this is experimental |
77 | private bool persistPrimInventories; | 77 | private bool persistPrimInventories; |
78 | 78 | ||
79 | /*********************************************************************** | 79 | /*********************************************************************** |
80 | * | 80 | * |
@@ -98,9 +98,9 @@ namespace OpenSim.Data.MySQL | |||
98 | 98 | ||
99 | MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, m_connection); | 99 | MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, m_connection); |
100 | m_shapeDataAdapter = new MySqlDataAdapter(shapeSelectCmd); | 100 | m_shapeDataAdapter = new MySqlDataAdapter(shapeSelectCmd); |
101 | 101 | ||
102 | MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, m_connection); | 102 | MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, m_connection); |
103 | m_itemsDataAdapter = new MySqlDataAdapter(itemsSelectCmd); | 103 | m_itemsDataAdapter = new MySqlDataAdapter(itemsSelectCmd); |
104 | 104 | ||
105 | MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, m_connection); | 105 | MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, m_connection); |
106 | m_terrainDataAdapter = new MySqlDataAdapter(terrainSelectCmd); | 106 | m_terrainDataAdapter = new MySqlDataAdapter(terrainSelectCmd); |
@@ -111,7 +111,7 @@ namespace OpenSim.Data.MySQL | |||
111 | MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection); | 111 | MySqlCommand landAccessListSelectCmd = new MySqlCommand(m_landAccessListSelect, m_connection); |
112 | m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd); | 112 | m_landAccessListDataAdapter = new MySqlDataAdapter(landAccessListSelectCmd); |
113 | 113 | ||
114 | 114 | ||
115 | TestTables(m_connection); | 115 | TestTables(m_connection); |
116 | 116 | ||
117 | lock (m_dataSet) | 117 | lock (m_dataSet) |
@@ -125,13 +125,13 @@ namespace OpenSim.Data.MySQL | |||
125 | m_dataSet.Tables.Add(m_shapeTable); | 125 | m_dataSet.Tables.Add(m_shapeTable); |
126 | SetupShapeCommands(m_shapeDataAdapter, m_connection); | 126 | SetupShapeCommands(m_shapeDataAdapter, m_connection); |
127 | m_shapeDataAdapter.Fill(m_shapeTable); | 127 | m_shapeDataAdapter.Fill(m_shapeTable); |
128 | 128 | ||
129 | if (persistPrimInventories) | 129 | if (persistPrimInventories) |
130 | { | 130 | { |
131 | m_itemsTable = createItemsTable(); | 131 | m_itemsTable = createItemsTable(); |
132 | m_dataSet.Tables.Add(m_itemsTable); | 132 | m_dataSet.Tables.Add(m_itemsTable); |
133 | SetupItemsCommands(m_itemsDataAdapter, m_connection); | 133 | SetupItemsCommands(m_itemsDataAdapter, m_connection); |
134 | m_itemsDataAdapter.Fill(m_itemsTable); | 134 | m_itemsDataAdapter.Fill(m_itemsTable); |
135 | } | 135 | } |
136 | 136 | ||
137 | m_terrainTable = createTerrainTable(); | 137 | m_terrainTable = createTerrainTable(); |
@@ -195,7 +195,7 @@ namespace OpenSim.Data.MySQL | |||
195 | 195 | ||
196 | UpgradeLandTable(tableList["land"], dbconn); | 196 | UpgradeLandTable(tableList["land"], dbconn); |
197 | //database.Close(); | 197 | //database.Close(); |
198 | 198 | ||
199 | } | 199 | } |
200 | 200 | ||
201 | /// <summary> | 201 | /// <summary> |
@@ -290,12 +290,12 @@ namespace OpenSim.Data.MySQL | |||
290 | { | 290 | { |
291 | shapeRow.Delete(); | 291 | shapeRow.Delete(); |
292 | } | 292 | } |
293 | 293 | ||
294 | if (persistPrimInventories) | 294 | if (persistPrimInventories) |
295 | { | 295 | { |
296 | RemoveItems(uuid); | 296 | RemoveItems(uuid); |
297 | } | 297 | } |
298 | 298 | ||
299 | // Remove prim row | 299 | // Remove prim row |
300 | row.Delete(); | 300 | row.Delete(); |
301 | } | 301 | } |
@@ -309,18 +309,18 @@ namespace OpenSim.Data.MySQL | |||
309 | /// </summary> | 309 | /// </summary> |
310 | private void RemoveItems(LLUUID uuid) | 310 | private void RemoveItems(LLUUID uuid) |
311 | { | 311 | { |
312 | String sql = String.Format("primID = '{0}'", uuid); | 312 | String sql = String.Format("primID = '{0}'", uuid); |
313 | DataRow[] itemRows = m_itemsTable.Select(sql); | 313 | DataRow[] itemRows = m_itemsTable.Select(sql); |
314 | 314 | ||
315 | foreach (DataRow itemRow in itemRows) | 315 | foreach (DataRow itemRow in itemRows) |
316 | { | 316 | { |
317 | itemRow.Delete(); | 317 | itemRow.Delete(); |
318 | } | 318 | } |
319 | } | 319 | } |
320 | 320 | ||
321 | /// <summary> | 321 | /// <summary> |
322 | /// Load persisted objects from region storage. | 322 | /// Load persisted objects from region storage. |
323 | /// </summary> | 323 | /// </summary> |
324 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) | 324 | public List<SceneObjectGroup> LoadObjects(LLUUID regionUUID) |
325 | { | 325 | { |
326 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); | 326 | Dictionary<LLUUID, SceneObjectGroup> createdObjects = new Dictionary<LLUUID, SceneObjectGroup>(); |
@@ -341,17 +341,17 @@ namespace OpenSim.Data.MySQL | |||
341 | 341 | ||
342 | foreach (DataRow primRow in primsForRegion) | 342 | foreach (DataRow primRow in primsForRegion) |
343 | { | 343 | { |
344 | try | 344 | try |
345 | { | 345 | { |
346 | string uuid = (string) primRow["UUID"]; | 346 | string uuid = (string) primRow["UUID"]; |
347 | string objID = (string) primRow["SceneGroupID"]; | 347 | string objID = (string) primRow["SceneGroupID"]; |
348 | 348 | ||
349 | SceneObjectPart prim = buildPrim(primRow); | 349 | SceneObjectPart prim = buildPrim(primRow); |
350 | 350 | ||
351 | if (uuid == objID) //is new SceneObjectGroup ? | 351 | if (uuid == objID) //is new SceneObjectGroup ? |
352 | { | 352 | { |
353 | SceneObjectGroup group = new SceneObjectGroup(); | 353 | SceneObjectGroup group = new SceneObjectGroup(); |
354 | 354 | ||
355 | DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); | 355 | DataRow shapeRow = shapes.Rows.Find(Util.ToRawUuidString(prim.UUID)); |
356 | if (shapeRow != null) | 356 | if (shapeRow != null) |
357 | { | 357 | { |
@@ -384,11 +384,11 @@ namespace OpenSim.Data.MySQL | |||
384 | } | 384 | } |
385 | createdObjects[new LLUUID(objID)].AddPart(prim); | 385 | createdObjects[new LLUUID(objID)].AddPart(prim); |
386 | } | 386 | } |
387 | 387 | ||
388 | if (persistPrimInventories) | 388 | if (persistPrimInventories) |
389 | { | 389 | { |
390 | LoadItems(prim); | 390 | LoadItems(prim); |
391 | } | 391 | } |
392 | } | 392 | } |
393 | catch (Exception e) | 393 | catch (Exception e) |
394 | { | 394 | { |
@@ -403,7 +403,7 @@ namespace OpenSim.Data.MySQL | |||
403 | } | 403 | } |
404 | return retvals; | 404 | return retvals; |
405 | } | 405 | } |
406 | 406 | ||
407 | /// <summary> | 407 | /// <summary> |
408 | /// Load in a prim's persisted inventory. | 408 | /// Load in a prim's persisted inventory. |
409 | /// </summary> | 409 | /// </summary> |
@@ -411,31 +411,31 @@ namespace OpenSim.Data.MySQL | |||
411 | private void LoadItems(SceneObjectPart prim) | 411 | private void LoadItems(SceneObjectPart prim) |
412 | { | 412 | { |
413 | //m_log.InfoFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); | 413 | //m_log.InfoFormat("[DATASTORE]: Loading inventory for {0}, {1}", prim.Name, prim.UUID); |
414 | 414 | ||
415 | DataTable dbItems = m_itemsTable; | 415 | DataTable dbItems = m_itemsTable; |
416 | 416 | ||
417 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); | 417 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); |
418 | DataRow[] dbItemRows = dbItems.Select(sql); | 418 | DataRow[] dbItemRows = dbItems.Select(sql); |
419 | 419 | ||
420 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 420 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
421 | 421 | ||
422 | foreach (DataRow row in dbItemRows) | 422 | foreach (DataRow row in dbItemRows) |
423 | { | 423 | { |
424 | TaskInventoryItem item = buildItem(row); | 424 | TaskInventoryItem item = buildItem(row); |
425 | inventory.Add(item); | 425 | inventory.Add(item); |
426 | 426 | ||
427 | //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); | 427 | //m_log.DebugFormat("[DATASTORE]: Restored item {0}, {1}", item.Name, item.ItemID); |
428 | } | 428 | } |
429 | 429 | ||
430 | prim.RestoreInventoryItems(inventory); | 430 | prim.RestoreInventoryItems(inventory); |
431 | 431 | ||
432 | // XXX A nasty little hack to recover the folder id for the prim (which is currently stored in | 432 | // XXX A nasty little hack to recover the folder id for the prim (which is currently stored in |
433 | // every item). This data should really be stored in the prim table itself. | 433 | // every item). This data should really be stored in the prim table itself. |
434 | if (dbItemRows.Length > 0) | 434 | if (dbItemRows.Length > 0) |
435 | { | 435 | { |
436 | prim.FolderID = inventory[0].ParentID; | 436 | prim.FolderID = inventory[0].ParentID; |
437 | } | 437 | } |
438 | } | 438 | } |
439 | 439 | ||
440 | public void StoreTerrain(double[,] ter, LLUUID regionID) | 440 | public void StoreTerrain(double[,] ter, LLUUID regionID) |
441 | { | 441 | { |
@@ -474,8 +474,8 @@ namespace OpenSim.Data.MySQL | |||
474 | { | 474 | { |
475 | m_connection.Open(); | 475 | m_connection.Open(); |
476 | } | 476 | } |
477 | 477 | ||
478 | lock (m_dataSet) | 478 | lock (m_dataSet) |
479 | { | 479 | { |
480 | using (MySqlDataReader row = cmd.ExecuteReader()) | 480 | using (MySqlDataReader row = cmd.ExecuteReader()) |
481 | { | 481 | { |
@@ -498,7 +498,7 @@ namespace OpenSim.Data.MySQL | |||
498 | m_log.Info("[REGION DB]: No terrain found for region"); | 498 | m_log.Info("[REGION DB]: No terrain found for region"); |
499 | return null; | 499 | return null; |
500 | } | 500 | } |
501 | 501 | ||
502 | m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString()); | 502 | m_log.Info("[REGION DB]: Loaded terrain revision r" + rev.ToString()); |
503 | } | 503 | } |
504 | } | 504 | } |
@@ -558,7 +558,7 @@ namespace OpenSim.Data.MySQL | |||
558 | fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); | 558 | fillLandAccessRow(newAccessRow, entry, parcel.landData.globalID); |
559 | landaccesslist.Rows.Add(newAccessRow); | 559 | landaccesslist.Rows.Add(newAccessRow); |
560 | } | 560 | } |
561 | 561 | ||
562 | Commit(); | 562 | Commit(); |
563 | } | 563 | } |
564 | } | 564 | } |
@@ -624,7 +624,7 @@ namespace OpenSim.Data.MySQL | |||
624 | /*********************************************************************** | 624 | /*********************************************************************** |
625 | * | 625 | * |
626 | * Database Definition Functions | 626 | * Database Definition Functions |
627 | * | 627 | * |
628 | * This should be db agnostic as we define them in ADO.NET terms | 628 | * This should be db agnostic as we define them in ADO.NET terms |
629 | * | 629 | * |
630 | **********************************************************************/ | 630 | **********************************************************************/ |
@@ -803,7 +803,7 @@ namespace OpenSim.Data.MySQL | |||
803 | 803 | ||
804 | return shapes; | 804 | return shapes; |
805 | } | 805 | } |
806 | 806 | ||
807 | private static DataTable createItemsTable() | 807 | private static DataTable createItemsTable() |
808 | { | 808 | { |
809 | DataTable items = new DataTable("primitems"); | 809 | DataTable items = new DataTable("primitems"); |
@@ -812,8 +812,8 @@ namespace OpenSim.Data.MySQL | |||
812 | createCol(items, "primID", typeof (String)); | 812 | createCol(items, "primID", typeof (String)); |
813 | createCol(items, "assetID", typeof (String)); | 813 | createCol(items, "assetID", typeof (String)); |
814 | createCol(items, "parentFolderID", typeof (String)); | 814 | createCol(items, "parentFolderID", typeof (String)); |
815 | 815 | ||
816 | createCol(items, "invType", typeof (Int32)); | 816 | createCol(items, "invType", typeof (Int32)); |
817 | createCol(items, "assetType", typeof (Int32)); | 817 | createCol(items, "assetType", typeof (Int32)); |
818 | 818 | ||
819 | createCol(items, "name", typeof (String)); | 819 | createCol(items, "name", typeof (String)); |
@@ -834,10 +834,10 @@ namespace OpenSim.Data.MySQL | |||
834 | items.PrimaryKey = new DataColumn[] {items.Columns["itemID"]}; | 834 | items.PrimaryKey = new DataColumn[] {items.Columns["itemID"]}; |
835 | 835 | ||
836 | return items; | 836 | return items; |
837 | } | 837 | } |
838 | 838 | ||
839 | /*********************************************************************** | 839 | /*********************************************************************** |
840 | * | 840 | * |
841 | * Convert between ADO.NET <=> OpenSim Objects | 841 | * Convert between ADO.NET <=> OpenSim Objects |
842 | * | 842 | * |
843 | * These should be database independant | 843 | * These should be database independant |
@@ -932,8 +932,8 @@ namespace OpenSim.Data.MySQL | |||
932 | } | 932 | } |
933 | return prim; | 933 | return prim; |
934 | } | 934 | } |
935 | 935 | ||
936 | 936 | ||
937 | /// <summary> | 937 | /// <summary> |
938 | /// Build a prim inventory item from the persisted data. | 938 | /// Build a prim inventory item from the persisted data. |
939 | /// </summary> | 939 | /// </summary> |
@@ -942,15 +942,15 @@ namespace OpenSim.Data.MySQL | |||
942 | private static TaskInventoryItem buildItem(DataRow row) | 942 | private static TaskInventoryItem buildItem(DataRow row) |
943 | { | 943 | { |
944 | TaskInventoryItem taskItem = new TaskInventoryItem(); | 944 | TaskInventoryItem taskItem = new TaskInventoryItem(); |
945 | 945 | ||
946 | taskItem.ItemID = new LLUUID((String)row["itemID"]); | 946 | taskItem.ItemID = new LLUUID((String)row["itemID"]); |
947 | taskItem.ParentPartID = new LLUUID((String)row["primID"]); | 947 | taskItem.ParentPartID = new LLUUID((String)row["primID"]); |
948 | taskItem.AssetID = new LLUUID((String)row["assetID"]); | 948 | taskItem.AssetID = new LLUUID((String)row["assetID"]); |
949 | taskItem.ParentID = new LLUUID((String)row["parentFolderID"]); | 949 | taskItem.ParentID = new LLUUID((String)row["parentFolderID"]); |
950 | 950 | ||
951 | taskItem.InvType = Convert.ToInt32(row["invType"]); | 951 | taskItem.InvType = Convert.ToInt32(row["invType"]); |
952 | taskItem.Type = Convert.ToInt32(row["assetType"]); | 952 | taskItem.Type = Convert.ToInt32(row["assetType"]); |
953 | 953 | ||
954 | taskItem.Name = (String)row["name"]; | 954 | taskItem.Name = (String)row["name"]; |
955 | taskItem.Description = (String)row["description"]; | 955 | taskItem.Description = (String)row["description"]; |
956 | taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); | 956 | taskItem.CreationDate = Convert.ToUInt32(row["creationDate"]); |
@@ -958,15 +958,15 @@ namespace OpenSim.Data.MySQL | |||
958 | taskItem.OwnerID = new LLUUID((String)row["ownerID"]); | 958 | taskItem.OwnerID = new LLUUID((String)row["ownerID"]); |
959 | taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]); | 959 | taskItem.LastOwnerID = new LLUUID((String)row["lastOwnerID"]); |
960 | taskItem.GroupID = new LLUUID((String)row["groupID"]); | 960 | taskItem.GroupID = new LLUUID((String)row["groupID"]); |
961 | 961 | ||
962 | taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]); | 962 | taskItem.NextOwnerMask = Convert.ToUInt32(row["nextPermissions"]); |
963 | taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]); | 963 | taskItem.OwnerMask = Convert.ToUInt32(row["currentPermissions"]); |
964 | taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]); | 964 | taskItem.BaseMask = Convert.ToUInt32(row["basePermissions"]); |
965 | taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]); | 965 | taskItem.EveryoneMask = Convert.ToUInt32(row["everyonePermissions"]); |
966 | taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]); | 966 | taskItem.GroupMask = Convert.ToUInt32(row["groupPermissions"]); |
967 | 967 | ||
968 | return taskItem; | 968 | return taskItem; |
969 | } | 969 | } |
970 | 970 | ||
971 | private static LandData buildLandData(DataRow row) | 971 | private static LandData buildLandData(DataRow row) |
972 | { | 972 | { |
@@ -1117,17 +1117,17 @@ namespace OpenSim.Data.MySQL | |||
1117 | } | 1117 | } |
1118 | } | 1118 | } |
1119 | } | 1119 | } |
1120 | 1120 | ||
1121 | private static void fillItemRow(DataRow row, TaskInventoryItem taskItem) | 1121 | private static void fillItemRow(DataRow row, TaskInventoryItem taskItem) |
1122 | { | 1122 | { |
1123 | row["itemID"] = taskItem.ItemID; | 1123 | row["itemID"] = taskItem.ItemID; |
1124 | row["primID"] = taskItem.ParentPartID; | 1124 | row["primID"] = taskItem.ParentPartID; |
1125 | row["assetID"] = taskItem.AssetID; | 1125 | row["assetID"] = taskItem.AssetID; |
1126 | row["parentFolderID"] = taskItem.ParentID; | 1126 | row["parentFolderID"] = taskItem.ParentID; |
1127 | 1127 | ||
1128 | row["invType"] = taskItem.InvType; | 1128 | row["invType"] = taskItem.InvType; |
1129 | row["assetType"] = taskItem.Type; | 1129 | row["assetType"] = taskItem.Type; |
1130 | 1130 | ||
1131 | row["name"] = taskItem.Name; | 1131 | row["name"] = taskItem.Name; |
1132 | row["description"] = taskItem.Description; | 1132 | row["description"] = taskItem.Description; |
1133 | row["creationDate"] = taskItem.CreationDate; | 1133 | row["creationDate"] = taskItem.CreationDate; |
@@ -1140,7 +1140,7 @@ namespace OpenSim.Data.MySQL | |||
1140 | row["basePermissions"] = taskItem.BaseMask; | 1140 | row["basePermissions"] = taskItem.BaseMask; |
1141 | row["everyonePermissions"] = taskItem.EveryoneMask; | 1141 | row["everyonePermissions"] = taskItem.EveryoneMask; |
1142 | row["groupPermissions"] = taskItem.GroupMask; | 1142 | row["groupPermissions"] = taskItem.GroupMask; |
1143 | } | 1143 | } |
1144 | 1144 | ||
1145 | private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) | 1145 | private static void fillLandRow(DataRow row, LandData land, LLUUID regionUUID) |
1146 | { | 1146 | { |
@@ -1322,39 +1322,39 @@ namespace OpenSim.Data.MySQL | |||
1322 | else | 1322 | else |
1323 | { | 1323 | { |
1324 | fillShapeRow(shapeRow, prim); | 1324 | fillShapeRow(shapeRow, prim); |
1325 | } | 1325 | } |
1326 | } | 1326 | } |
1327 | 1327 | ||
1328 | // see IRegionDatastore | 1328 | // see IRegionDatastore |
1329 | public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) | 1329 | public void StorePrimInventory(LLUUID primID, ICollection<TaskInventoryItem> items) |
1330 | { | 1330 | { |
1331 | if (!persistPrimInventories) | 1331 | if (!persistPrimInventories) |
1332 | return; | 1332 | return; |
1333 | 1333 | ||
1334 | m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID); | 1334 | m_log.InfoFormat("[REGION DB]: Persisting Prim Inventory with prim ID {0}", primID); |
1335 | 1335 | ||
1336 | // For now, we're just going to crudely remove all the previous inventory items | 1336 | // For now, we're just going to crudely remove all the previous inventory items |
1337 | // no matter whether they have changed or not, and replace them with the current set. | 1337 | // no matter whether they have changed or not, and replace them with the current set. |
1338 | lock (m_dataSet) | 1338 | lock (m_dataSet) |
1339 | { | 1339 | { |
1340 | RemoveItems(primID); | 1340 | RemoveItems(primID); |
1341 | 1341 | ||
1342 | // repalce with current inventory details | 1342 | // repalce with current inventory details |
1343 | foreach (TaskInventoryItem newItem in items) | 1343 | foreach (TaskInventoryItem newItem in items) |
1344 | { | 1344 | { |
1345 | // m_log.InfoFormat( | 1345 | // m_log.InfoFormat( |
1346 | // "[REGION DB]: " + | 1346 | // "[REGION DB]: " + |
1347 | // "Adding item {0}, {1} to prim ID {2}", | 1347 | // "Adding item {0}, {1} to prim ID {2}", |
1348 | // newItem.Name, newItem.ItemID, newItem.ParentPartID); | 1348 | // newItem.Name, newItem.ItemID, newItem.ParentPartID); |
1349 | 1349 | ||
1350 | DataRow newItemRow = m_itemsTable.NewRow(); | 1350 | DataRow newItemRow = m_itemsTable.NewRow(); |
1351 | fillItemRow(newItemRow, newItem); | 1351 | fillItemRow(newItemRow, newItem); |
1352 | m_itemsTable.Rows.Add(newItemRow); | 1352 | m_itemsTable.Rows.Add(newItemRow); |
1353 | } | 1353 | } |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | Commit(); | 1356 | Commit(); |
1357 | } | 1357 | } |
1358 | 1358 | ||
1359 | /*********************************************************************** | 1359 | /*********************************************************************** |
1360 | * | 1360 | * |
@@ -1447,9 +1447,9 @@ namespace OpenSim.Data.MySQL | |||
1447 | } | 1447 | } |
1448 | sql += subsql; | 1448 | sql += subsql; |
1449 | sql += ")"; | 1449 | sql += ")"; |
1450 | 1450 | ||
1451 | //m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql); | 1451 | //m_log.InfoFormat("[DATASTORE]: defineTable() sql {0}", sql); |
1452 | 1452 | ||
1453 | return sql; | 1453 | return sql; |
1454 | } | 1454 | } |
1455 | 1455 | ||
@@ -1466,7 +1466,7 @@ namespace OpenSim.Data.MySQL | |||
1466 | /// This is a convenience function that collapses 5 repetitive | 1466 | /// This is a convenience function that collapses 5 repetitive |
1467 | /// lines for defining MySqlParameters to 2 parameters: | 1467 | /// lines for defining MySqlParameters to 2 parameters: |
1468 | /// column name and database type. | 1468 | /// column name and database type. |
1469 | /// | 1469 | /// |
1470 | /// It assumes certain conventions like ?param as the param | 1470 | /// It assumes certain conventions like ?param as the param |
1471 | /// name to replace in parametrized queries, and that source | 1471 | /// name to replace in parametrized queries, and that source |
1472 | /// version is always current version, both of which are fine | 1472 | /// version is always current version, both of which are fine |
@@ -1498,7 +1498,7 @@ namespace OpenSim.Data.MySQL | |||
1498 | delete.Connection = conn; | 1498 | delete.Connection = conn; |
1499 | da.DeleteCommand = delete; | 1499 | da.DeleteCommand = delete; |
1500 | } | 1500 | } |
1501 | 1501 | ||
1502 | private void SetupItemsCommands(MySqlDataAdapter da, MySqlConnection conn) | 1502 | private void SetupItemsCommands(MySqlDataAdapter da, MySqlConnection conn) |
1503 | { | 1503 | { |
1504 | da.InsertCommand = createInsertCommand("primitems", m_itemsTable); | 1504 | da.InsertCommand = createInsertCommand("primitems", m_itemsTable); |
@@ -1511,7 +1511,7 @@ namespace OpenSim.Data.MySQL | |||
1511 | delete.Parameters.Add(createMySqlParameter("itemID", typeof (String))); | 1511 | delete.Parameters.Add(createMySqlParameter("itemID", typeof (String))); |
1512 | delete.Connection = conn; | 1512 | delete.Connection = conn; |
1513 | da.DeleteCommand = delete; | 1513 | da.DeleteCommand = delete; |
1514 | } | 1514 | } |
1515 | 1515 | ||
1516 | private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn) | 1516 | private void SetupTerrainCommands(MySqlDataAdapter da, MySqlConnection conn) |
1517 | { | 1517 | { |
@@ -1597,7 +1597,7 @@ namespace OpenSim.Data.MySQL | |||
1597 | { | 1597 | { |
1598 | m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e); | 1598 | m_log.WarnFormat("[REGION DB]: Shapes Table Already Exists: {0}", e); |
1599 | } | 1599 | } |
1600 | 1600 | ||
1601 | try | 1601 | try |
1602 | { | 1602 | { |
1603 | icmd.ExecuteNonQuery(); | 1603 | icmd.ExecuteNonQuery(); |
@@ -1605,7 +1605,7 @@ namespace OpenSim.Data.MySQL | |||
1605 | catch (MySqlException e) | 1605 | catch (MySqlException e) |
1606 | { | 1606 | { |
1607 | m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e); | 1607 | m_log.WarnFormat("[REGION DB]: Items Table Already Exists: {0}", e); |
1608 | } | 1608 | } |
1609 | 1609 | ||
1610 | try | 1610 | try |
1611 | { | 1611 | { |
@@ -1643,7 +1643,7 @@ namespace OpenSim.Data.MySQL | |||
1643 | MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, conn); | 1643 | MySqlCommand shapeSelectCmd = new MySqlCommand(m_shapeSelect, conn); |
1644 | MySqlDataAdapter sDa = new MySqlDataAdapter(shapeSelectCmd); | 1644 | MySqlDataAdapter sDa = new MySqlDataAdapter(shapeSelectCmd); |
1645 | MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, conn); | 1645 | MySqlCommand itemsSelectCmd = new MySqlCommand(m_itemsSelect, conn); |
1646 | MySqlDataAdapter iDa = new MySqlDataAdapter(itemsSelectCmd); | 1646 | MySqlDataAdapter iDa = new MySqlDataAdapter(itemsSelectCmd); |
1647 | MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, conn); | 1647 | MySqlCommand terrainSelectCmd = new MySqlCommand(m_terrainSelect, conn); |
1648 | MySqlDataAdapter tDa = new MySqlDataAdapter(terrainSelectCmd); | 1648 | MySqlDataAdapter tDa = new MySqlDataAdapter(terrainSelectCmd); |
1649 | MySqlCommand landSelectCmd = new MySqlCommand(m_landSelect, conn); | 1649 | MySqlCommand landSelectCmd = new MySqlCommand(m_landSelect, conn); |
@@ -1656,10 +1656,10 @@ namespace OpenSim.Data.MySQL | |||
1656 | { | 1656 | { |
1657 | pDa.Fill(tmpDS, "prims"); | 1657 | pDa.Fill(tmpDS, "prims"); |
1658 | sDa.Fill(tmpDS, "primshapes"); | 1658 | sDa.Fill(tmpDS, "primshapes"); |
1659 | 1659 | ||
1660 | if (persistPrimInventories) | 1660 | if (persistPrimInventories) |
1661 | iDa.Fill(tmpDS, "primitems"); | 1661 | iDa.Fill(tmpDS, "primitems"); |
1662 | 1662 | ||
1663 | tDa.Fill(tmpDS, "terrain"); | 1663 | tDa.Fill(tmpDS, "terrain"); |
1664 | lDa.Fill(tmpDS, "land"); | 1664 | lDa.Fill(tmpDS, "land"); |
1665 | lalDa.Fill(tmpDS, "landaccesslist"); | 1665 | lalDa.Fill(tmpDS, "landaccesslist"); |
@@ -1672,10 +1672,10 @@ namespace OpenSim.Data.MySQL | |||
1672 | 1672 | ||
1673 | pDa.Fill(tmpDS, "prims"); | 1673 | pDa.Fill(tmpDS, "prims"); |
1674 | sDa.Fill(tmpDS, "primshapes"); | 1674 | sDa.Fill(tmpDS, "primshapes"); |
1675 | 1675 | ||
1676 | if (persistPrimInventories) | 1676 | if (persistPrimInventories) |
1677 | iDa.Fill(tmpDS, "primitems"); | 1677 | iDa.Fill(tmpDS, "primitems"); |
1678 | 1678 | ||
1679 | tDa.Fill(tmpDS, "terrain"); | 1679 | tDa.Fill(tmpDS, "terrain"); |
1680 | lDa.Fill(tmpDS, "land"); | 1680 | lDa.Fill(tmpDS, "land"); |
1681 | lalDa.Fill(tmpDS, "landaccesslist"); | 1681 | lalDa.Fill(tmpDS, "landaccesslist"); |
@@ -1688,7 +1688,7 @@ namespace OpenSim.Data.MySQL | |||
1688 | return false; | 1688 | return false; |
1689 | } | 1689 | } |
1690 | } | 1690 | } |
1691 | 1691 | ||
1692 | foreach (DataColumn col in createShapeTable().Columns) | 1692 | foreach (DataColumn col in createShapeTable().Columns) |
1693 | { | 1693 | { |
1694 | if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName)) | 1694 | if (!tmpDS.Tables["primshapes"].Columns.Contains(col.ColumnName)) |
@@ -1697,9 +1697,9 @@ namespace OpenSim.Data.MySQL | |||
1697 | return false; | 1697 | return false; |
1698 | } | 1698 | } |
1699 | } | 1699 | } |
1700 | 1700 | ||
1701 | // XXX primitems should probably go here eventually | 1701 | // XXX primitems should probably go here eventually |
1702 | 1702 | ||
1703 | foreach (DataColumn col in createTerrainTable().Columns) | 1703 | foreach (DataColumn col in createTerrainTable().Columns) |
1704 | { | 1704 | { |
1705 | if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName)) | 1705 | if (!tmpDS.Tables["terrain"].Columns.Contains(col.ColumnName)) |
@@ -1708,7 +1708,7 @@ namespace OpenSim.Data.MySQL | |||
1708 | return false; | 1708 | return false; |
1709 | } | 1709 | } |
1710 | } | 1710 | } |
1711 | 1711 | ||
1712 | foreach (DataColumn col in createLandTable().Columns) | 1712 | foreach (DataColumn col in createLandTable().Columns) |
1713 | { | 1713 | { |
1714 | if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName)) | 1714 | if (!tmpDS.Tables["land"].Columns.Contains(col.ColumnName)) |
@@ -1717,7 +1717,7 @@ namespace OpenSim.Data.MySQL | |||
1717 | return false; | 1717 | return false; |
1718 | } | 1718 | } |
1719 | } | 1719 | } |
1720 | 1720 | ||
1721 | foreach (DataColumn col in createLandAccessListTable().Columns) | 1721 | foreach (DataColumn col in createLandAccessListTable().Columns) |
1722 | { | 1722 | { |
1723 | if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName)) | 1723 | if (!tmpDS.Tables["landaccesslist"].Columns.Contains(col.ColumnName)) |
@@ -1726,7 +1726,7 @@ namespace OpenSim.Data.MySQL | |||
1726 | return false; | 1726 | return false; |
1727 | } | 1727 | } |
1728 | } | 1728 | } |
1729 | 1729 | ||
1730 | return true; | 1730 | return true; |
1731 | } | 1731 | } |
1732 | 1732 | ||
@@ -1783,7 +1783,7 @@ namespace OpenSim.Data.MySQL | |||
1783 | else if (type == typeof (Int64)) | 1783 | else if (type == typeof (Int64)) |
1784 | { | 1784 | { |
1785 | return "bigint"; | 1785 | return "bigint"; |
1786 | } | 1786 | } |
1787 | else if (type == typeof (Double)) | 1787 | else if (type == typeof (Double)) |
1788 | { | 1788 | { |
1789 | return "float"; | 1789 | return "float"; |
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs index 90664ff..92b005d 100644 --- a/OpenSim/Data/MySQL/MySQLInventoryData.cs +++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs | |||
@@ -40,7 +40,7 @@ namespace OpenSim.Data.MySQL | |||
40 | /// </summary> | 40 | /// </summary> |
41 | public class MySQLInventoryData : IInventoryData | 41 | public class MySQLInventoryData : IInventoryData |
42 | { | 42 | { |
43 | private static readonly ILog m_log | 43 | private static readonly ILog m_log |
44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 44 | = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
45 | 45 | ||
46 | /// <summary> | 46 | /// <summary> |
@@ -249,7 +249,7 @@ namespace OpenSim.Data.MySQL | |||
249 | 249 | ||
250 | // There should only ever be one root folder for a user. However, if there's more | 250 | // There should only ever be one root folder for a user. However, if there's more |
251 | // than one we'll simply use the first one rather than failing. It would be even | 251 | // than one we'll simply use the first one rather than failing. It would be even |
252 | // nicer to print some message to this effect, but this feels like it's too low a | 252 | // nicer to print some message to this effect, but this feels like it's too low a |
253 | // to put such a message out, and it's too minor right now to spare the time to | 253 | // to put such a message out, and it's too minor right now to spare the time to |
254 | // suitably refactor. | 254 | // suitably refactor. |
255 | if (items.Count > 0) | 255 | if (items.Count > 0) |
@@ -332,13 +332,13 @@ namespace OpenSim.Data.MySQL | |||
332 | item.InvType = (int) reader["invType"]; | 332 | item.InvType = (int) reader["invType"]; |
333 | item.Creator = new LLUUID((string) reader["creatorID"]); | 333 | item.Creator = new LLUUID((string) reader["creatorID"]); |
334 | item.BasePermissions = (uint) reader["inventoryBasePermissions"]; | 334 | item.BasePermissions = (uint) reader["inventoryBasePermissions"]; |
335 | item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; | 335 | item.EveryOnePermissions = (uint) reader["inventoryEveryOnePermissions"]; |
336 | item.SalePrice = (int) reader["salePrice"]; | 336 | item.SalePrice = (int) reader["salePrice"]; |
337 | item.SaleType = Convert.ToByte(reader["saleType"]); | 337 | item.SaleType = Convert.ToByte(reader["saleType"]); |
338 | item.CreationDate = (int) reader["creationDate"]; | 338 | item.CreationDate = (int) reader["creationDate"]; |
339 | item.GroupID = new LLUUID(reader["groupID"].ToString()); | 339 | item.GroupID = new LLUUID(reader["groupID"].ToString()); |
340 | item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); | 340 | item.GroupOwned = Convert.ToBoolean(reader["groupOwned"]); |
341 | item.Flags = (uint) reader["flags"]; | 341 | item.Flags = (uint) reader["flags"]; |
342 | 342 | ||
343 | return item; | 343 | return item; |
344 | } | 344 | } |
@@ -483,12 +483,12 @@ namespace OpenSim.Data.MySQL | |||
483 | result.Parameters.AddWithValue("?groupID", item.GroupID); | 483 | result.Parameters.AddWithValue("?groupID", item.GroupID); |
484 | result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); | 484 | result.Parameters.AddWithValue("?groupOwned", item.GroupOwned); |
485 | result.Parameters.AddWithValue("?flags", item.Flags); | 485 | result.Parameters.AddWithValue("?flags", item.Flags); |
486 | 486 | ||
487 | lock (database) | 487 | lock (database) |
488 | { | 488 | { |
489 | result.ExecuteNonQuery(); | 489 | result.ExecuteNonQuery(); |
490 | } | 490 | } |
491 | 491 | ||
492 | result.Dispose(); | 492 | result.Dispose(); |
493 | } | 493 | } |
494 | catch (MySqlException e) | 494 | catch (MySqlException e) |
@@ -507,7 +507,7 @@ namespace OpenSim.Data.MySQL | |||
507 | } | 507 | } |
508 | 508 | ||
509 | /// <summary> | 509 | /// <summary> |
510 | /// | 510 | /// |
511 | /// </summary> | 511 | /// </summary> |
512 | /// <param name="item"></param> | 512 | /// <param name="item"></param> |
513 | public void deleteInventoryItem(LLUUID itemID) | 513 | public void deleteInventoryItem(LLUUID itemID) |
@@ -517,7 +517,7 @@ namespace OpenSim.Data.MySQL | |||
517 | MySqlCommand cmd = | 517 | MySqlCommand cmd = |
518 | new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); | 518 | new MySqlCommand("DELETE FROM inventoryitems WHERE inventoryID=?uuid", database.Connection); |
519 | cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); | 519 | cmd.Parameters.AddWithValue("?uuid", itemID.ToString()); |
520 | 520 | ||
521 | lock (database) | 521 | lock (database) |
522 | { | 522 | { |
523 | cmd.ExecuteNonQuery(); | 523 | cmd.ExecuteNonQuery(); |
@@ -596,7 +596,7 @@ namespace OpenSim.Data.MySQL | |||
596 | } | 596 | } |
597 | 597 | ||
598 | /// <summary> | 598 | /// <summary> |
599 | /// Append a list of all the child folders of a parent folder | 599 | /// Append a list of all the child folders of a parent folder |
600 | /// </summary> | 600 | /// </summary> |
601 | /// <param name="folders">list where folders will be appended</param> | 601 | /// <param name="folders">list where folders will be appended</param> |
602 | /// <param name="parentID">ID of parent</param> | 602 | /// <param name="parentID">ID of parent</param> |
@@ -623,11 +623,11 @@ namespace OpenSim.Data.MySQL | |||
623 | protected void deleteOneFolder(LLUUID folderID) | 623 | protected void deleteOneFolder(LLUUID folderID) |
624 | { | 624 | { |
625 | try | 625 | try |
626 | { | 626 | { |
627 | MySqlCommand cmd = | 627 | MySqlCommand cmd = |
628 | new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", database.Connection); | 628 | new MySqlCommand("DELETE FROM inventoryfolders WHERE folderID=?uuid", database.Connection); |
629 | cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); | 629 | cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); |
630 | 630 | ||
631 | lock (database) | 631 | lock (database) |
632 | { | 632 | { |
633 | cmd.ExecuteNonQuery(); | 633 | cmd.ExecuteNonQuery(); |
@@ -647,7 +647,7 @@ namespace OpenSim.Data.MySQL | |||
647 | MySqlCommand cmd = | 647 | MySqlCommand cmd = |
648 | new MySqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=?uuid", database.Connection); | 648 | new MySqlCommand("DELETE FROM inventoryitems WHERE parentFolderID=?uuid", database.Connection); |
649 | cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); | 649 | cmd.Parameters.AddWithValue("?uuid", folderID.ToString()); |
650 | 650 | ||
651 | lock (database) | 651 | lock (database) |
652 | { | 652 | { |
653 | cmd.ExecuteNonQuery(); | 653 | cmd.ExecuteNonQuery(); |
diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 4455c3b..f7baadc 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs | |||
@@ -302,7 +302,7 @@ namespace OpenSim.Data.MySQL | |||
302 | // Region Main gotta-have-or-we-return-null parts | 302 | // Region Main gotta-have-or-we-return-null parts |
303 | UInt64 tmp64; | 303 | UInt64 tmp64; |
304 | if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64)) | 304 | if (!UInt64.TryParse(reader["regionHandle"].ToString(), out tmp64)) |
305 | { | 305 | { |
306 | return null; | 306 | return null; |
307 | } | 307 | } |
308 | else | 308 | else |
@@ -310,7 +310,7 @@ namespace OpenSim.Data.MySQL | |||
310 | retval.regionHandle = tmp64; | 310 | retval.regionHandle = tmp64; |
311 | } | 311 | } |
312 | LLUUID tmp_uuid; | 312 | LLUUID tmp_uuid; |
313 | if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) | 313 | if (!LLUUID.TryParse((string)reader["uuid"], out tmp_uuid)) |
314 | { | 314 | { |
315 | return null; | 315 | return null; |
316 | } | 316 | } |
@@ -321,7 +321,7 @@ namespace OpenSim.Data.MySQL | |||
321 | 321 | ||
322 | // non-critical parts | 322 | // non-critical parts |
323 | retval.regionName = (string)reader["regionName"]; | 323 | retval.regionName = (string)reader["regionName"]; |
324 | retval.originUUID = new LLUUID((string) reader["originUUID"]); | 324 | retval.originUUID = new LLUUID((string) reader["originUUID"]); |
325 | 325 | ||
326 | // Secrets | 326 | // Secrets |
327 | retval.regionRecvKey = (string) reader["regionRecvKey"]; | 327 | retval.regionRecvKey = (string) reader["regionRecvKey"]; |
@@ -360,8 +360,8 @@ namespace OpenSim.Data.MySQL | |||
360 | 360 | ||
361 | // World Map Addition | 361 | // World Map Addition |
362 | LLUUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID); | 362 | LLUUID.TryParse((string)reader["regionMapTexture"], out retval.regionMapTextureID); |
363 | LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid); | 363 | LLUUID.TryParse((string)reader["owner_uuid"], out retval.owner_uuid); |
364 | } | 364 | } |
365 | else | 365 | else |
366 | { | 366 | { |
367 | return null; | 367 | return null; |
@@ -418,7 +418,7 @@ namespace OpenSim.Data.MySQL | |||
418 | 418 | ||
419 | LLUUID.TryParse((string) reader["sessionID"], out tmp); | 419 | LLUUID.TryParse((string) reader["sessionID"], out tmp); |
420 | retval.SessionID = tmp; | 420 | retval.SessionID = tmp; |
421 | 421 | ||
422 | LLUUID.TryParse((string)reader["secureSessionID"], out tmp); | 422 | LLUUID.TryParse((string)reader["secureSessionID"], out tmp); |
423 | retval.SecureSessionID = tmp; | 423 | retval.SecureSessionID = tmp; |
424 | 424 | ||
@@ -488,7 +488,7 @@ namespace OpenSim.Data.MySQL | |||
488 | 488 | ||
489 | if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) | 489 | if (reader.IsDBNull(reader.GetOrdinal("profileAboutText"))) |
490 | retval.AboutText = ""; | 490 | retval.AboutText = ""; |
491 | else | 491 | else |
492 | retval.AboutText = (string) reader["profileAboutText"]; | 492 | retval.AboutText = (string) reader["profileAboutText"]; |
493 | 493 | ||
494 | if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) | 494 | if (reader.IsDBNull(reader.GetOrdinal("profileFirstText"))) |
@@ -511,7 +511,7 @@ namespace OpenSim.Data.MySQL | |||
511 | LLUUID.TryParse((string)reader["profileFirstImage"], out tmp); | 511 | LLUUID.TryParse((string)reader["profileFirstImage"], out tmp); |
512 | retval.FirstLifeImage = tmp; | 512 | retval.FirstLifeImage = tmp; |
513 | } | 513 | } |
514 | 514 | ||
515 | if (reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) | 515 | if (reader.IsDBNull(reader.GetOrdinal("webLoginKey"))) |
516 | { | 516 | { |
517 | retval.WebLoginKey = LLUUID.Zero; | 517 | retval.WebLoginKey = LLUUID.Zero; |
diff --git a/OpenSim/Data/MySQL/MySQLUserData.cs b/OpenSim/Data/MySQL/MySQLUserData.cs index a1e1094..0acf47b 100644 --- a/OpenSim/Data/MySQL/MySQLUserData.cs +++ b/OpenSim/Data/MySQL/MySQLUserData.cs | |||
@@ -59,7 +59,7 @@ namespace OpenSim.Data.MySQL | |||
59 | { | 59 | { |
60 | // TODO: actually do something with our connect string | 60 | // TODO: actually do something with our connect string |
61 | // instead of loading the second config | 61 | // instead of loading the second config |
62 | 62 | ||
63 | IniFile iniFile = new IniFile("mysql_connection.ini"); | 63 | IniFile iniFile = new IniFile("mysql_connection.ini"); |
64 | string settingHostname = iniFile.ParseFileReadValue("hostname"); | 64 | string settingHostname = iniFile.ParseFileReadValue("hostname"); |
65 | string settingDatabase = iniFile.ParseFileReadValue("database"); | 65 | string settingDatabase = iniFile.ParseFileReadValue("database"); |
@@ -67,7 +67,7 @@ namespace OpenSim.Data.MySQL | |||
67 | string settingPassword = iniFile.ParseFileReadValue("password"); | 67 | string settingPassword = iniFile.ParseFileReadValue("password"); |
68 | string settingPooling = iniFile.ParseFileReadValue("pooling"); | 68 | string settingPooling = iniFile.ParseFileReadValue("pooling"); |
69 | string settingPort = iniFile.ParseFileReadValue("port"); | 69 | string settingPort = iniFile.ParseFileReadValue("port"); |
70 | 70 | ||
71 | m_usersTableName = iniFile.ParseFileReadValue("userstablename"); | 71 | m_usersTableName = iniFile.ParseFileReadValue("userstablename"); |
72 | if (m_usersTableName == null) | 72 | if (m_usersTableName == null) |
73 | { | 73 | { |
@@ -206,15 +206,15 @@ namespace OpenSim.Data.MySQL | |||
206 | param["?friendID"] = friend.UUID.ToString(); | 206 | param["?friendID"] = friend.UUID.ToString(); |
207 | param["?friendPerms"] = perms.ToString(); | 207 | param["?friendPerms"] = perms.ToString(); |
208 | param["?datetimestamp"] = dtvalue.ToString(); | 208 | param["?datetimestamp"] = dtvalue.ToString(); |
209 | 209 | ||
210 | try | 210 | try |
211 | { | 211 | { |
212 | lock (database) | 212 | lock (database) |
213 | { | 213 | { |
214 | IDbCommand adder = | 214 | IDbCommand adder = |
215 | database.Query( | 215 | database.Query( |
216 | "INSERT INTO `" + m_userFriendsTableName + "` " + | 216 | "INSERT INTO `" + m_userFriendsTableName + "` " + |
217 | "(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " + | 217 | "(`ownerID`,`friendID`,`friendPerms`,`datetimestamp`) " + |
218 | "VALUES " + | 218 | "VALUES " + |
219 | "(?ownerID,?friendID,?friendPerms,?datetimestamp)", | 219 | "(?ownerID,?friendID,?friendPerms,?datetimestamp)", |
220 | param); | 220 | param); |
@@ -325,7 +325,7 @@ namespace OpenSim.Data.MySQL | |||
325 | 325 | ||
326 | // This is not a real column in the database table, it's a joined column from the opposite record | 326 | // This is not a real column in the database table, it's a joined column from the opposite record |
327 | fli.FriendListOwnerPerms = (uint)Convert.ToInt32(reader["ownerperms"]); | 327 | fli.FriendListOwnerPerms = (uint)Convert.ToInt32(reader["ownerperms"]); |
328 | 328 | ||
329 | Lfli.Add(fli); | 329 | Lfli.Add(fli); |
330 | } | 330 | } |
331 | reader.Close(); | 331 | reader.Close(); |
@@ -599,7 +599,7 @@ namespace OpenSim.Data.MySQL | |||
599 | user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, | 599 | user.UserAssetURI, user.CanDoMask, user.WantDoMask, user.AboutText, |
600 | user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); | 600 | user.FirstLifeAboutText, user.Image, user.FirstLifeImage, user.WebLoginKey); |
601 | } | 601 | } |
602 | 602 | ||
603 | return true; | 603 | return true; |
604 | } | 604 | } |
605 | 605 | ||
@@ -630,7 +630,7 @@ namespace OpenSim.Data.MySQL | |||
630 | 630 | ||
631 | /// Appearance | 631 | /// Appearance |
632 | /// TODO: stubs for now to get us to a compiling state gently | 632 | /// TODO: stubs for now to get us to a compiling state gently |
633 | // override public AvatarAppearance GetUserAppearance(LLUUID user) | 633 | // override public AvatarAppearance GetUserAppearance(LLUUID user) |
634 | // { | 634 | // { |
635 | // return new AvatarAppearance(); | 635 | // return new AvatarAppearance(); |
636 | // } | 636 | // } |
@@ -644,12 +644,12 @@ namespace OpenSim.Data.MySQL | |||
644 | { | 644 | { |
645 | return; | 645 | return; |
646 | } | 646 | } |
647 | 647 | ||
648 | override public void RemoveAttachment(LLUUID user, LLUUID item) | 648 | override public void RemoveAttachment(LLUUID user, LLUUID item) |
649 | { | 649 | { |
650 | return; | 650 | return; |
651 | } | 651 | } |
652 | 652 | ||
653 | override public List<LLUUID> GetAttachments(LLUUID user) | 653 | override public List<LLUUID> GetAttachments(LLUUID user) |
654 | { | 654 | { |
655 | return new List<LLUUID>(); | 655 | return new List<LLUUID>(); |
diff --git a/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs b/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs index 16b2a4f..b3e08a3 100644 --- a/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs +++ b/OpenSim/Data/MySQL/Properties/AssemblyInfo.cs | |||
@@ -28,7 +28,7 @@ | |||
28 | using System.Reflection; | 28 | using System.Reflection; |
29 | using System.Runtime.InteropServices; | 29 | using System.Runtime.InteropServices; |
30 | 30 | ||
31 | // General Information about an assembly is controlled through the following | 31 | // General information about an assembly is controlled through the following |
32 | // set of attributes. Change these attribute values to modify the information | 32 | // set of attributes. Change these attribute values to modify the information |
33 | // associated with an assembly. | 33 | // associated with an assembly. |
34 | 34 | ||
@@ -41,8 +41,8 @@ using System.Runtime.InteropServices; | |||
41 | [assembly : AssemblyTrademark("")] | 41 | [assembly : AssemblyTrademark("")] |
42 | [assembly : AssemblyCulture("")] | 42 | [assembly : AssemblyCulture("")] |
43 | 43 | ||
44 | // Setting ComVisible to false makes the types in this assembly not visible | 44 | // Setting ComVisible to false makes the types in this assembly not visible |
45 | // to COM components. If you need to access a type in this assembly from | 45 | // to COM components. If you need to access a type in this assembly from |
46 | // COM, set the ComVisible attribute to true on that type. | 46 | // COM, set the ComVisible attribute to true on that type. |
47 | 47 | ||
48 | [assembly : ComVisible(false)] | 48 | [assembly : ComVisible(false)] |
@@ -54,11 +54,11 @@ using System.Runtime.InteropServices; | |||
54 | // Version information for an assembly consists of the following four values: | 54 | // Version information for an assembly consists of the following four values: |
55 | // | 55 | // |
56 | // Major Version | 56 | // Major Version |
57 | // Minor Version | 57 | // Minor Version |
58 | // Build Number | 58 | // Build Number |
59 | // Revision | 59 | // Revision |
60 | // | 60 | // |
61 | // You can specify all the values or you can default the Revision and Build Numbers | 61 | // You can specify all the values or you can default the Revision and Build Numbers |
62 | // by using the '*' as shown below: | 62 | // by using the '*' as shown below: |
63 | 63 | ||
64 | [assembly : AssemblyVersion("1.0.0.0")] | 64 | [assembly : AssemblyVersion("1.0.0.0")] |