aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite/SQLiteSimulationData.cs
diff options
context:
space:
mode:
authorJeff Ames2010-09-12 13:43:49 -0400
committerJeff Ames2010-09-12 13:43:49 -0400
commitf1f0bc23f4501ba99035283d3407ddad2b21b785 (patch)
tree2b62a244eddf18f5608405abcefa9f763ab54340 /OpenSim/Data/SQLite/SQLiteSimulationData.cs
parentAdd copyright headers. (diff)
downloadopensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.zip
opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.gz
opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.bz2
opensim-SC_OLD-f1f0bc23f4501ba99035283d3407ddad2b21b785.tar.xz
Formatting cleanup.
Diffstat (limited to 'OpenSim/Data/SQLite/SQLiteSimulationData.cs')
-rw-r--r--OpenSim/Data/SQLite/SQLiteSimulationData.cs57
1 files changed, 27 insertions, 30 deletions
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
index 1820f78..7460961 100644
--- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs
+++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs
@@ -176,7 +176,7 @@ namespace OpenSim.Data.SQLite
176 { 176 {
177 m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table"); 177 m_log.Info("[SQLITE REGION DB]: Caught fill error on primitems table");
178 } 178 }
179 179
180 try 180 try
181 { 181 {
182 terrainDa.Fill(ds.Tables["terrain"]); 182 terrainDa.Fill(ds.Tables["terrain"]);
@@ -510,7 +510,7 @@ namespace OpenSim.Data.SQLite
510 "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape"); 510 "[SQLITE REGION DB]: No shape found for prim in storage, so setting default box shape");
511 prim.Shape = PrimitiveBaseShape.Default; 511 prim.Shape = PrimitiveBaseShape.Default;
512 } 512 }
513 513
514 createdObjects[new UUID(objID)].AddPart(prim); 514 createdObjects[new UUID(objID)].AddPart(prim);
515 LoadItems(prim); 515 LoadItems(prim);
516 } 516 }
@@ -534,17 +534,17 @@ namespace OpenSim.Data.SQLite
534 /// </summary> 534 /// </summary>
535 /// <param name="prim">the prim</param> 535 /// <param name="prim">the prim</param>
536 private void LoadItems(SceneObjectPart prim) 536 private void LoadItems(SceneObjectPart prim)
537 { 537 {
538// m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID); 538// m_log.DebugFormat("[SQLITE REGION DB]: Loading inventory for {0} {1}", prim.Name, prim.UUID);
539 539
540 DataTable dbItems = ds.Tables["primitems"]; 540 DataTable dbItems = ds.Tables["primitems"];
541 String sql = String.Format("primID = '{0}'", prim.UUID.ToString()); 541 String sql = String.Format("primID = '{0}'", prim.UUID.ToString());
542 DataRow[] dbItemRows = dbItems.Select(sql); 542 DataRow[] dbItemRows = dbItems.Select(sql);
543 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>(); 543 IList<TaskInventoryItem> inventory = new List<TaskInventoryItem>();
544 544
545// m_log.DebugFormat( 545// m_log.DebugFormat(
546// "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID); 546// "[SQLITE REGION DB]: Found {0} items for {1} {2}", dbItemRows.Length, prim.Name, prim.UUID);
547 547
548 foreach (DataRow row in dbItemRows) 548 foreach (DataRow row in dbItemRows)
549 { 549 {
550 TaskInventoryItem item = buildItem(row); 550 TaskInventoryItem item = buildItem(row);
@@ -693,8 +693,6 @@ namespace OpenSim.Data.SQLite
693 { 693 {
694 landaccesslist.Rows.Remove(rowsToDelete[iter]); 694 landaccesslist.Rows.Remove(rowsToDelete[iter]);
695 } 695 }
696
697
698 } 696 }
699 Commit(); 697 Commit();
700 } 698 }
@@ -804,7 +802,7 @@ namespace OpenSim.Data.SQLite
804 try 802 try
805 { 803 {
806 regionSettingsDa.Update(ds, "regionsettings"); 804 regionSettingsDa.Update(ds, "regionsettings");
807 } 805 }
808 catch (SqliteException SqlEx) 806 catch (SqliteException SqlEx)
809 { 807 {
810 throw new Exception( 808 throw new Exception(
@@ -974,7 +972,7 @@ namespace OpenSim.Data.SQLite
974 createCol(prims, "CollisionSoundVolume", typeof(Double)); 972 createCol(prims, "CollisionSoundVolume", typeof(Double));
975 973
976 createCol(prims, "VolumeDetect", typeof(Int16)); 974 createCol(prims, "VolumeDetect", typeof(Int16));
977 975
978 createCol(prims, "MediaURL", typeof(String)); 976 createCol(prims, "MediaURL", typeof(String));
979 977
980 // Add in contraints 978 // Add in contraints
@@ -1191,10 +1189,10 @@ namespace OpenSim.Data.SQLite
1191 private SceneObjectPart buildPrim(DataRow row) 1189 private SceneObjectPart buildPrim(DataRow row)
1192 { 1190 {
1193 // Code commented. Uncomment to test the unit test inline. 1191 // Code commented. Uncomment to test the unit test inline.
1194 1192
1195 // The unit test mentions this commented code for the purposes 1193 // The unit test mentions this commented code for the purposes
1196 // of debugging a unit test failure 1194 // of debugging a unit test failure
1197 1195
1198 // SceneObjectGroup sog = new SceneObjectGroup(); 1196 // SceneObjectGroup sog = new SceneObjectGroup();
1199 // SceneObjectPart sop = new SceneObjectPart(); 1197 // SceneObjectPart sop = new SceneObjectPart();
1200 // sop.LocalId = 1; 1198 // sop.LocalId = 1;
@@ -1211,7 +1209,7 @@ namespace OpenSim.Data.SQLite
1211 // TODO: this doesn't work yet because something more 1209 // TODO: this doesn't work yet because something more
1212 // interesting has to be done to actually get these values 1210 // interesting has to be done to actually get these values
1213 // back out. Not enough time to figure it out yet. 1211 // back out. Not enough time to figure it out yet.
1214 1212
1215 SceneObjectPart prim = new SceneObjectPart(); 1213 SceneObjectPart prim = new SceneObjectPart();
1216 prim.UUID = new UUID((String) row["UUID"]); 1214 prim.UUID = new UUID((String) row["UUID"]);
1217 // explicit conversion of integers is required, which sort 1215 // explicit conversion of integers is required, which sort
@@ -1341,7 +1339,7 @@ namespace OpenSim.Data.SQLite
1341 1339
1342 if (Convert.ToInt16(row["VolumeDetect"]) != 0) 1340 if (Convert.ToInt16(row["VolumeDetect"]) != 0)
1343 prim.VolumeDetectActive = true; 1341 prim.VolumeDetectActive = true;
1344 1342
1345 if (!(row["MediaURL"] is System.DBNull)) 1343 if (!(row["MediaURL"] is System.DBNull))
1346 { 1344 {
1347 //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); 1345 //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
@@ -1680,7 +1678,7 @@ namespace OpenSim.Data.SQLite
1680 row["VolumeDetect"] = 1; 1678 row["VolumeDetect"] = 1;
1681 else 1679 else
1682 row["VolumeDetect"] = 0; 1680 row["VolumeDetect"] = 0;
1683 1681
1684 row["MediaURL"] = prim.MediaUrl; 1682 row["MediaURL"] = prim.MediaUrl;
1685 } 1683 }
1686 1684
@@ -1758,12 +1756,12 @@ namespace OpenSim.Data.SQLite
1758 row["UserLookAtZ"] = land.UserLookAt.Z; 1756 row["UserLookAtZ"] = land.UserLookAt.Z;
1759 row["AuthbuyerID"] = land.AuthBuyerID.ToString(); 1757 row["AuthbuyerID"] = land.AuthBuyerID.ToString();
1760 row["OtherCleanTime"] = land.OtherCleanTime; 1758 row["OtherCleanTime"] = land.OtherCleanTime;
1761 row["MediaType"] = land.MediaType; 1759 row["MediaType"] = land.MediaType;
1762 row["MediaDescription"] = land.MediaDescription; 1760 row["MediaDescription"] = land.MediaDescription;
1763 row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString(); 1761 row["MediaSize"] = land.MediaWidth.ToString() + "," + land.MediaHeight.ToString();
1764 row["MediaLoop"] = land.MediaLoop.ToString(); 1762 row["MediaLoop"] = land.MediaLoop.ToString();
1765 row["ObscureMusic"] = land.ObscureMusic.ToString(); 1763 row["ObscureMusic"] = land.ObscureMusic.ToString();
1766 row["ObscureMedia"] = land.ObscureMedia.ToString(); 1764 row["ObscureMedia"] = land.ObscureMedia.ToString();
1767 } 1765 }
1768 1766
1769 /// <summary> 1767 /// <summary>
@@ -1861,10 +1859,10 @@ namespace OpenSim.Data.SQLite
1861 s.TextureEntry = textureEntry; 1859 s.TextureEntry = textureEntry;
1862 1860
1863 s.ExtraParams = (byte[]) row["ExtraParams"]; 1861 s.ExtraParams = (byte[]) row["ExtraParams"];
1864 1862
1865 if (!(row["Media"] is System.DBNull)) 1863 if (!(row["Media"] is System.DBNull))
1866 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); 1864 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
1867 1865
1868 return s; 1866 return s;
1869 } 1867 }
1870 1868
@@ -1908,7 +1906,7 @@ namespace OpenSim.Data.SQLite
1908 1906
1909 row["Texture"] = s.TextureEntry; 1907 row["Texture"] = s.TextureEntry;
1910 row["ExtraParams"] = s.ExtraParams; 1908 row["ExtraParams"] = s.ExtraParams;
1911 1909
1912 if (s.Media != null) 1910 if (s.Media != null)
1913 row["Media"] = s.Media.ToXml(); 1911 row["Media"] = s.Media.ToXml();
1914 } 1912 }
@@ -2246,7 +2244,6 @@ namespace OpenSim.Data.SQLite
2246 delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String))); 2244 delete.Parameters.Add(createSqliteParameter("AccessUUID", typeof(String)));
2247 da.DeleteCommand = delete; 2245 da.DeleteCommand = delete;
2248 da.DeleteCommand.Connection = conn; 2246 da.DeleteCommand.Connection = conn;
2249
2250 } 2247 }
2251 2248
2252 private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn) 2249 private void setupRegionSettingsCommands(SqliteDataAdapter da, SqliteConnection conn)
@@ -2318,7 +2315,7 @@ namespace OpenSim.Data.SQLite
2318 return DbType.String; 2315 return DbType.String;
2319 } 2316 }
2320 } 2317 }
2321 2318
2322 static void PrintDataSet(DataSet ds) 2319 static void PrintDataSet(DataSet ds)
2323 { 2320 {
2324 // Print out any name and extended properties. 2321 // Print out any name and extended properties.