aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2010-08-16 21:57:08 +0100
committerJustin Clark-Casey (justincc)2013-01-25 04:03:09 +0000
commita3e1e6dd611a179eb2d894a45ae45ef278ae2e85 (patch)
treeb37946a51c993b9c0ee94851391b41cfff497e28 /OpenSim/Data/MySQL
parentAdd DAExampleModule to demonstrate dynamic attributes (diff)
downloadopensim-SC-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.zip
opensim-SC-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.tar.gz
opensim-SC-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.tar.bz2
opensim-SC-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.tar.xz
Implement dynamic attribute persistence on mysql and mssql
mssql is untested
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs16
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations9
2 files changed, 23 insertions, 2 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index d562783..b7f39fb 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -202,7 +202,7 @@ namespace OpenSim.Data.MySQL
202 "?SaleType, ?ColorR, ?ColorG, " + 202 "?SaleType, ?ColorR, ?ColorG, " +
203 "?ColorB, ?ColorA, ?ParticleSystem, " + 203 "?ColorB, ?ColorA, ?ParticleSystem, " +
204 "?ClickAction, ?Material, ?CollisionSound, " + 204 "?ClickAction, ?Material, ?CollisionSound, " +
205 "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; 205 "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL, ?DynAttrs)";
206 206
207 FillPrimCommand(cmd, prim, obj.UUID, regionUUID); 207 FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
208 208
@@ -230,7 +230,7 @@ namespace OpenSim.Data.MySQL
230 "?PathTwistBegin, ?ProfileBegin, " + 230 "?PathTwistBegin, ?ProfileBegin, " +
231 "?ProfileEnd, ?ProfileCurve, " + 231 "?ProfileEnd, ?ProfileCurve, " +
232 "?ProfileHollow, ?Texture, ?ExtraParams, " + 232 "?ProfileHollow, ?Texture, ?ExtraParams, " +
233 "?State, ?Media)"; 233 "?State, ?Media, ?DynAttrs)";
234 234
235 FillShapeCommand(cmd, prim); 235 FillShapeCommand(cmd, prim);
236 236
@@ -1291,6 +1291,11 @@ namespace OpenSim.Data.MySQL
1291 1291
1292 if (!(row["MediaURL"] is System.DBNull)) 1292 if (!(row["MediaURL"] is System.DBNull))
1293 prim.MediaUrl = (string)row["MediaURL"]; 1293 prim.MediaUrl = (string)row["MediaURL"];
1294
1295 if (!(row["DynAttrs"] is System.DBNull))
1296 prim.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]);
1297 else
1298 prim.DynAttrs = new DynAttrsOSDMap();
1294 1299
1295 return prim; 1300 return prim;
1296 } 1301 }
@@ -1637,6 +1642,7 @@ namespace OpenSim.Data.MySQL
1637 1642
1638 cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); 1643 cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum);
1639 cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); 1644 cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl);
1645 cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml());
1640 } 1646 }
1641 1647
1642 /// <summary> 1648 /// <summary>
@@ -1829,6 +1835,11 @@ namespace OpenSim.Data.MySQL
1829 1835
1830 if (!(row["Media"] is System.DBNull)) 1836 if (!(row["Media"] is System.DBNull))
1831 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); 1837 s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]);
1838
1839 if (!(row["DynAttrs"] is System.DBNull))
1840 s.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]);
1841 else
1842 s.DynAttrs = new DynAttrsOSDMap();
1832 1843
1833 return s; 1844 return s;
1834 } 1845 }
@@ -1873,6 +1884,7 @@ namespace OpenSim.Data.MySQL
1873 cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams); 1884 cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams);
1874 cmd.Parameters.AddWithValue("State", s.State); 1885 cmd.Parameters.AddWithValue("State", s.State);
1875 cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); 1886 cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml());
1887 cmd.Parameters.AddWithValue("DynAttrs", s.DynAttrs.ToXml());
1876 } 1888 }
1877 1889
1878 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items) 1890 public void StorePrimInventory(UUID primID, ICollection<TaskInventoryItem> items)
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index 5b59779..1a38836 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -902,3 +902,12 @@ BEGIN;
902CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); 902CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`));
903 903
904COMMIT; 904COMMIT;
905
906:VERSION 46 #---------------- Dynamic attributes
907
908BEGIN;
909
910ALTER TABLE prims ADD COLUMN DynAttrs TEXT;
911ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT;
912
913COMMIT;