diff options
author | John Hurliman | 2010-09-12 14:21:51 -0700 |
---|---|---|
committer | John Hurliman | 2010-09-12 14:21:51 -0700 |
commit | c03b24cbfdc449cf326cf0f560395753339169dc (patch) | |
tree | d62a666839d3c638b5c9799c70be971a2d6d6c18 /OpenSim/Data/SQLite/SQLiteSimulationData.cs | |
parent | * Added ISimulationDataService and IEstateDataService (diff) | |
parent | Formatting cleanup. (diff) | |
download | opensim-SC_OLD-c03b24cbfdc449cf326cf0f560395753339169dc.zip opensim-SC_OLD-c03b24cbfdc449cf326cf0f560395753339169dc.tar.gz opensim-SC_OLD-c03b24cbfdc449cf326cf0f560395753339169dc.tar.bz2 opensim-SC_OLD-c03b24cbfdc449cf326cf0f560395753339169dc.tar.xz |
Merged
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteSimulationData.cs')
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 57 |
1 files changed, 27 insertions, 30 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 7e62e84..3e9bc3f 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -185,7 +185,7 @@ namespace OpenSim.Data.SQLite | |||
185 | { | 185 | { |
186 | m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); | 186 | m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); |
187 | } | 187 | } |
188 | 188 | ||
189 | try | 189 | try |
190 | { | 190 | { |
191 | terrainDa.Fill(ds.Tables["terrain"]); | 191 | terrainDa.Fill(ds.Tables["terrain"]); |
@@ -519,7 +519,7 @@ namespace OpenSim.Data.SQLite | |||
519 | "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); | 519 | "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); |
520 | prim.Shape = PrimitiveBaseShape.Default; | 520 | prim.Shape = PrimitiveBaseShape.Default; |
521 | } | 521 | } |
522 | 522 | ||
523 | createdObjects[new UUID(objID)].AddPart(prim); | 523 | createdObjects[new UUID(objID)].AddPart(prim); |
524 | LoadItems(prim); | 524 | LoadItems(prim); |
525 | } | 525 | } |
@@ -543,17 +543,17 @@ namespace OpenSim.Data.SQLite | |||
543 | /// </summary> | 543 | /// </summary> |
544 | /// <param name="prim">the prim</param> | 544 | /// <param name="prim">the prim</param> |
545 | private void LoadItems(SceneObjectPart prim) | 545 | private void LoadItems(SceneObjectPart prim) |
546 | { | 546 | { |
547 | // m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); | 547 | // m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); |
548 | 548 | ||
549 | DataTable dbItems = ds.Tables["primitems"]; | 549 | DataTable dbItems = ds.Tables["primitems"]; |
550 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); | 550 | String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); |
551 | DataRow[] dbItemRows = dbItems.Select(sql); | 551 | DataRow[] dbItemRows = dbItems.Select(sql); |
552 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); | 552 | IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); |
553 | 553 | ||
554 | // m_log.DebugFormat( | 554 | // m_log.DebugFormat( |
555 | // "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); | 555 | // "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); |
556 | 556 | ||
557 | foreach (DataRow row in dbItemRows) | 557 | foreach (DataRow row in dbItemRows) |
558 | { | 558 | { |
559 | TaskInventoryItem item = buildItem(row); | 559 | TaskInventoryItem item = buildItem(row); |
@@ -702,8 +702,6 @@ namespace OpenSim.Data.SQLite | |||
702 | { | 702 | { |
703 | landaccesslist.Rows.Remove(rowsToDelete[iter]); | 703 | landaccesslist.Rows.Remove(rowsToDelete[iter]); |
704 | } | 704 | } |
705 | |||
706 | |||
707 | } | 705 | } |
708 | Commit(); | 706 | Commit(); |
709 | } | 707 | } |
@@ -813,7 +811,7 @@ namespace OpenSim.Data.SQLite | |||
813 | try | 811 | try |
814 | { | 812 | { |
815 | regionSettingsDa.Update(ds, "regionsettings"); | 813 | regionSettingsDa.Update(ds, "regionsettings"); |
816 | } | 814 | } |
817 | catch (SqliteException SqlEx) | 815 | catch (SqliteException SqlEx) |
818 | { | 816 | { |
819 | throw new Exception( | 817 | throw new Exception( |
@@ -983,7 +981,7 @@ namespace OpenSim.Data.SQLite | |||
983 | createCol(prims, "CollisionSoundVolume", typeof(Double)); | 981 | createCol(prims, "CollisionSoundVolume", typeof(Double)); |
984 | 982 | ||
985 | createCol(prims, "VolumeDetect", typeof(Int16)); | 983 | createCol(prims, "VolumeDetect", typeof(Int16)); |
986 | 984 | ||
987 | createCol(prims, "MediaURL", typeof(String)); | 985 | createCol(prims, "MediaURL", typeof(String)); |
988 | 986 | ||
989 | // Add in contraints | 987 | // Add in contraints |
@@ -1200,10 +1198,10 @@ namespace OpenSim.Data.SQLite | |||
1200 | private SceneObjectPart buildPrim(DataRow row) | 1198 | private SceneObjectPart buildPrim(DataRow row) |
1201 | { | 1199 | { |
1202 | // Code commented. Uncomment to test the unit test inline. | 1200 | // Code commented. Uncomment to test the unit test inline. |
1203 | 1201 | ||
1204 | // The unit test mentions this commented code for the purposes | 1202 | // The unit test mentions this commented code for the purposes |
1205 | // of debugging a unit test failure | 1203 | // of debugging a unit test failure |
1206 | 1204 | ||
1207 | // SceneObjectGroup sog = new SceneObjectGroup(); | 1205 | // SceneObjectGroup sog = new SceneObjectGroup(); |
1208 | // SceneObjectPart sop = new SceneObjectPart(); | 1206 | // SceneObjectPart sop = new SceneObjectPart(); |
1209 | // sop.LocalId = 1; | 1207 | // sop.LocalId = 1; |
@@ -1220,7 +1218,7 @@ namespace OpenSim.Data.SQLite | |||
1220 | // TODO: this doesn't work yet because something more | 1218 | // TODO: this doesn't work yet because something more |
1221 | // interesting has to be done to actually get these values | 1219 | // interesting has to be done to actually get these values |
1222 | // back out. Not enough time to figure it out yet. | 1220 | // back out. Not enough time to figure it out yet. |
1223 | 1221 | ||
1224 | SceneObjectPart prim = new SceneObjectPart(); | 1222 | SceneObjectPart prim = new SceneObjectPart(); |
1225 | prim.UUID = new UUID((String) row["UUID"]); | 1223 | prim.UUID = new UUID((String) row["UUID"]); |
1226 | // explicit conversion of integers is required, which sort | 1224 | // explicit conversion of integers is required, which sort |
@@ -1350,7 +1348,7 @@ namespace OpenSim.Data.SQLite | |||
1350 | 1348 | ||
1351 | if (Convert.ToInt16(row["VolumeDetect"]) != 0) | 1349 | if (Convert.ToInt16(row["VolumeDetect"]) != 0) |
1352 | prim.VolumeDetectActive = true; | 1350 | prim.VolumeDetectActive = true; |
1353 | 1351 | ||
1354 | if (!(row["MediaURL"] is System.DBNull)) | 1352 | if (!(row["MediaURL"] is System.DBNull)) |
1355 | { | 1353 | { |
1356 | //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); | 1354 | //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); |
@@ -1689,7 +1687,7 @@ namespace OpenSim.Data.SQLite | |||
1689 | row["VolumeDetect"] = 1; | 1687 | row["VolumeDetect"] = 1; |
1690 | else | 1688 | else |
1691 | row["VolumeDetect"] = 0; | 1689 | row["VolumeDetect"] = 0; |
1692 | 1690 | ||
1693 | row["MediaURL"] = prim.MediaUrl; | 1691 | row["MediaURL"] = prim.MediaUrl; |
1694 | } | 1692 | } |
1695 | 1693 | ||
@@ -1767,12 +1765,12 @@ namespace OpenSim.Data.SQLite | |||
1767 | row["UserLookAtZ"] = land.UserLookAt.Z; | 1765 | row["UserLookAtZ"] = land.UserLookAt.Z; |
1768 | row["AuthbuyerID"] = land.AuthBuyerID.ToString(); | 1766 | row["AuthbuyerID"] = land.AuthBuyerID.ToString(); |
1769 | row["OtherCleanTime"] = land.OtherCleanTime; | 1767 | row["OtherCleanTime"] = land.OtherCleanTime; |
1770 | row["MediaType"] = land.MediaType; | 1768 | row["MediaType"] = land.MediaType; |
1771 | row["MediaDescription"] = land.MediaDescription; | 1769 | row["MediaDescription"] = land.MediaDescription; |
1772 | row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); | 1770 | row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); |
1773 | row["MediaLoop"] = land.MediaLoop.ToString(); | 1771 | row["MediaLoop"] = land.MediaLoop.ToString(); |
1774 | row["ObscureMusic"] = land.ObscureMusic.ToString(); | 1772 | row["ObscureMusic"] = land.ObscureMusic.ToString(); |
1775 | row["ObscureMedia"] = land.ObscureMedia.ToString(); | 1773 | row["ObscureMedia"] = land.ObscureMedia.ToString(); |
1776 | } | 1774 | } |
1777 | 1775 | ||
1778 | /// <summary> | 1776 | /// <summary> |
@@ -1870,10 +1868,10 @@ namespace OpenSim.Data.SQLite | |||
1870 | s.TextureEntry = textureEntry; | 1868 | s.TextureEntry = textureEntry; |
1871 | 1869 | ||
1872 | s.ExtraParams = (byte[]) row["ExtraParams"]; | 1870 | s.ExtraParams = (byte[]) row["ExtraParams"]; |
1873 | 1871 | ||
1874 | if (!(row["Media"] is System.DBNull)) | 1872 | if (!(row["Media"] is System.DBNull)) |
1875 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); | 1873 | s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); |
1876 | 1874 | ||
1877 | return s; | 1875 | return s; |
1878 | } | 1876 | } |
1879 | 1877 | ||
@@ -1917,7 +1915,7 @@ namespace OpenSim.Data.SQLite | |||
1917 | 1915 | ||
1918 | row["Texture"] = s.TextureEntry; | 1916 | row["Texture"] = s.TextureEntry; |
1919 | row["ExtraParams"] = s.ExtraParams; | 1917 | row["ExtraParams"] = s.ExtraParams; |
1920 | 1918 | ||
1921 | if (s.Media != null) | 1919 | if (s.Media != null) |
1922 | row["Media"] = s.Media.ToXml(); | 1920 | row["Media"] = s.Media.ToXml(); |
1923 | } | 1921 | } |
@@ -2255,7 +2253,6 @@ namespace OpenSim.Data.SQLite | |||
2255 | delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); | 2253 | delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); |
2256 | da.DeleteCommand = delete; | 2254 | da.DeleteCommand = delete; |
2257 | da.DeleteCommand.Connection = conn; | 2255 | da.DeleteCommand.Connection = conn; |
2258 | |||
2259 | } | 2256 | } |
2260 | 2257 | ||
2261 | private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) | 2258 | private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) |
@@ -2327,7 +2324,7 @@ namespace OpenSim.Data.SQLite | |||
2327 | return DbType.String; | 2324 | return DbType.String; |
2328 | } | 2325 | } |
2329 | } | 2326 | } |
2330 | 2327 | ||
2331 | static void PrintDataSet(DataSet ds) | 2328 | static void PrintDataSet(DataSet ds) |
2332 | { | 2329 | { |
2333 | // Print out any name and extended properties. | 2330 | // Print out any name and extended properties. |