aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/SQLite
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Data/SQLite')
-rw-r--r--OpenSim/Data/SQLite/Resources/020_RegionStore.sql6
-rw-r--r--OpenSim/Data/SQLite/SQLiteRegionData.cs24
2 files changed, 26 insertions, 4 deletions
diff --git a/OpenSim/Data/SQLite/Resources/020_RegionStore.sql b/OpenSim/Data/SQLite/Resources/020_RegionStore.sql
new file mode 100644
index 0000000..39cb752
--- /dev/null
+++ b/OpenSim/Data/SQLite/Resources/020_RegionStore.sql
@@ -0,0 +1,6 @@
1BEGIN;
2
3ALTER TABLE prims ADD COLUMN MediaURL varchar(255);
4ALTER TABLE primshapes ADD COLUMN Media TEXT;
5
6COMMIT; \ No newline at end of file
diff --git a/OpenSim/Data/SQLite/SQLiteRegionData.cs b/OpenSim/Data/SQLite/SQLiteRegionData.cs
index 81d0ac4..4208050 100644
--- a/OpenSim/Data/SQLite/SQLiteRegionData.cs
+++ b/OpenSim/Data/SQLite/SQLiteRegionData.cs
@@ -34,6 +34,7 @@ using System.Reflection;
34using log4net; 34using log4net;
35using Mono.Data.Sqlite; 35using Mono.Data.Sqlite;
36using OpenMetaverse; 36using OpenMetaverse;
37using OpenMetaverse.StructuredData;
37using OpenSim.Framework; 38using OpenSim.Framework;
38using OpenSim.Region.Framework.Interfaces; 39using OpenSim.Region.Framework.Interfaces;
39using OpenSim.Region.Framework.Scenes; 40using OpenSim.Region.Framework.Scenes;
@@ -974,6 +975,8 @@ namespace OpenSim.Data.SQLite
974 createCol(prims, "CollisionSoundVolume", typeof(Double)); 975 createCol(prims, "CollisionSoundVolume", typeof(Double));
975 976
976 createCol(prims, "VolumeDetect", typeof(Int16)); 977 createCol(prims, "VolumeDetect", typeof(Int16));
978
979 createCol(prims, "MediaURL", typeof(String));
977 980
978 // Add in contraints 981 // Add in contraints
979 prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]}; 982 prims.PrimaryKey = new DataColumn[] {prims.Columns["UUID"]};
@@ -1021,6 +1024,7 @@ namespace OpenSim.Data.SQLite
1021 // way to specify this as a blob atm 1024 // way to specify this as a blob atm
1022 createCol(shapes, "Texture", typeof (Byte[])); 1025 createCol(shapes, "Texture", typeof (Byte[]));
1023 createCol(shapes, "ExtraParams", typeof (Byte[])); 1026 createCol(shapes, "ExtraParams", typeof (Byte[]));
1027 createCol(shapes, "Media", typeof(String));
1024 1028
1025 shapes.PrimaryKey = new DataColumn[] {shapes.Columns["UUID"]}; 1029 shapes.PrimaryKey = new DataColumn[] {shapes.Columns["UUID"]};
1026 1030
@@ -1339,6 +1343,12 @@ namespace OpenSim.Data.SQLite
1339 1343
1340 if (Convert.ToInt16(row["VolumeDetect"]) != 0) 1344 if (Convert.ToInt16(row["VolumeDetect"]) != 0)
1341 prim.VolumeDetectActive = true; 1345 prim.VolumeDetectActive = true;
1346
1347 if (!(row["MediaURL"] is System.DBNull))
1348 {
1349 //m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType());
1350 prim.MediaUrl = (string)row["MediaURL"];
1351 }
1342 1352
1343 return prim; 1353 return prim;
1344 } 1354 }
@@ -1614,7 +1624,6 @@ namespace OpenSim.Data.SQLite
1614 row["PayButton3"] = prim.PayPrice[3]; 1624 row["PayButton3"] = prim.PayPrice[3];
1615 row["PayButton4"] = prim.PayPrice[4]; 1625 row["PayButton4"] = prim.PayPrice[4];
1616 1626
1617
1618 row["TextureAnimation"] = Convert.ToBase64String(prim.TextureAnimation); 1627 row["TextureAnimation"] = Convert.ToBase64String(prim.TextureAnimation);
1619 row["ParticleSystem"] = Convert.ToBase64String(prim.ParticleSystem); 1628 row["ParticleSystem"] = Convert.ToBase64String(prim.ParticleSystem);
1620 1629
@@ -1674,7 +1683,8 @@ namespace OpenSim.Data.SQLite
1674 row["VolumeDetect"] = 1; 1683 row["VolumeDetect"] = 1;
1675 else 1684 else
1676 row["VolumeDetect"] = 0; 1685 row["VolumeDetect"] = 0;
1677 1686
1687 row["MediaURL"] = prim.MediaUrl;
1678 } 1688 }
1679 1689
1680 /// <summary> 1690 /// <summary>
@@ -1849,6 +1859,10 @@ namespace OpenSim.Data.SQLite
1849 s.TextureEntry = textureEntry; 1859 s.TextureEntry = textureEntry;
1850 1860
1851 s.ExtraParams = (byte[]) row["ExtraParams"]; 1861 s.ExtraParams = (byte[]) row["ExtraParams"];
1862
1863 if (!(row["Media"] is System.DBNull))
1864 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
1865
1852 return s; 1866 return s;
1853 } 1867 }
1854 1868
@@ -1892,17 +1906,19 @@ namespace OpenSim.Data.SQLite
1892 1906
1893 row["Texture"] = s.TextureEntry; 1907 row["Texture"] = s.TextureEntry;
1894 row["ExtraParams"] = s.ExtraParams; 1908 row["ExtraParams"] = s.ExtraParams;
1909
1910 if (s.Media != null)
1911 row["Media"] = s.Media.ToXml();
1895 } 1912 }
1896 1913
1897 /// <summary> 1914 /// <summary>
1898 /// 1915 /// Persistently store a prim.
1899 /// </summary> 1916 /// </summary>
1900 /// <param name="prim"></param> 1917 /// <param name="prim"></param>
1901 /// <param name="sceneGroupID"></param> 1918 /// <param name="sceneGroupID"></param>
1902 /// <param name="regionUUID"></param> 1919 /// <param name="regionUUID"></param>
1903 private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID) 1920 private void addPrim(SceneObjectPart prim, UUID sceneGroupID, UUID regionUUID)
1904 { 1921 {
1905
1906 DataTable prims = ds.Tables["prims"]; 1922 DataTable prims = ds.Tables["prims"];
1907 DataTable shapes = ds.Tables["primshapes"]; 1923 DataTable shapes = ds.Tables["primshapes"];
1908 1924