diff options
author | Justin Clark-Casey (justincc) | 2010-08-16 21:57:08 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2013-01-25 04:03:09 +0000 |
commit | a3e1e6dd611a179eb2d894a45ae45ef278ae2e85 (patch) | |
tree | b37946a51c993b9c0ee94851391b41cfff497e28 | |
parent | Add DAExampleModule to demonstrate dynamic attributes (diff) | |
download | opensim-SC_OLD-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.zip opensim-SC_OLD-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.tar.gz opensim-SC_OLD-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.tar.bz2 opensim-SC_OLD-a3e1e6dd611a179eb2d894a45ae45ef278ae2e85.tar.xz |
Implement dynamic attribute persistence on mysql and mssql
mssql is untested
-rw-r--r-- | OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 23 | ||||
-rw-r--r-- | OpenSim/Data/MSSQL/Resources/RegionStore.migrations | 9 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 16 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 9 |
4 files changed, 49 insertions, 8 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index 17f42e1..e949738 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs | |||
@@ -351,7 +351,7 @@ IF EXISTS (SELECT UUID FROM prims WHERE UUID = @UUID) | |||
351 | ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice, | 351 | ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice, |
352 | SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem, | 352 | SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem, |
353 | ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches, | 353 | ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches, |
354 | LinkNumber = @LinkNumber, MediaURL = @MediaURL | 354 | LinkNumber = @LinkNumber, MediaURL = @MediaURL, DynAttrs = @DynAttrs |
355 | WHERE UUID = @UUID | 355 | WHERE UUID = @UUID |
356 | END | 356 | END |
357 | ELSE | 357 | ELSE |
@@ -366,7 +366,7 @@ ELSE | |||
366 | PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, | 366 | PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, |
367 | OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, | 367 | OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, |
368 | ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, | 368 | ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, |
369 | ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL | 369 | ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs |
370 | ) VALUES ( | 370 | ) VALUES ( |
371 | @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, | 371 | @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, |
372 | @EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX, | 372 | @EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX, |
@@ -376,7 +376,7 @@ ELSE | |||
376 | @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, | 376 | @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, |
377 | @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, | 377 | @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, |
378 | @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, | 378 | @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, |
379 | @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL | 379 | @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs |
380 | ) | 380 | ) |
381 | END"; | 381 | END"; |
382 | 382 | ||
@@ -409,7 +409,7 @@ IF EXISTS (SELECT UUID FROM primshapes WHERE UUID = @UUID) | |||
409 | PathSkew = @PathSkew, PathCurve = @PathCurve, PathRadiusOffset = @PathRadiusOffset, PathRevolutions = @PathRevolutions, | 409 | PathSkew = @PathSkew, PathCurve = @PathCurve, PathRadiusOffset = @PathRadiusOffset, PathRevolutions = @PathRevolutions, |
410 | PathTaperX = @PathTaperX, PathTaperY = @PathTaperY, PathTwist = @PathTwist, PathTwistBegin = @PathTwistBegin, | 410 | PathTaperX = @PathTaperX, PathTaperY = @PathTaperY, PathTwist = @PathTwist, PathTwistBegin = @PathTwistBegin, |
411 | ProfileBegin = @ProfileBegin, ProfileEnd = @ProfileEnd, ProfileCurve = @ProfileCurve, ProfileHollow = @ProfileHollow, | 411 | ProfileBegin = @ProfileBegin, ProfileEnd = @ProfileEnd, ProfileCurve = @ProfileCurve, ProfileHollow = @ProfileHollow, |
412 | Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media | 412 | Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media, DynAttrs = @DynAttrs |
413 | WHERE UUID = @UUID | 413 | WHERE UUID = @UUID |
414 | END | 414 | END |
415 | ELSE | 415 | ELSE |
@@ -418,11 +418,11 @@ ELSE | |||
418 | primshapes ( | 418 | primshapes ( |
419 | UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, | 419 | UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, |
420 | PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, | 420 | PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, |
421 | ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media | 421 | ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media, DynAttrs |
422 | ) VALUES ( | 422 | ) VALUES ( |
423 | @UUID, @Shape, @ScaleX, @ScaleY, @ScaleZ, @PCode, @PathBegin, @PathEnd, @PathScaleX, @PathScaleY, @PathShearX, @PathShearY, | 423 | @UUID, @Shape, @ScaleX, @ScaleY, @ScaleZ, @PCode, @PathBegin, @PathEnd, @PathScaleX, @PathScaleY, @PathShearX, @PathShearY, |
424 | @PathSkew, @PathCurve, @PathRadiusOffset, @PathRevolutions, @PathTaperX, @PathTaperY, @PathTwist, @PathTwistBegin, @ProfileBegin, | 424 | @PathSkew, @PathCurve, @PathRadiusOffset, @PathRevolutions, @PathTaperX, @PathTaperY, @PathTwist, @PathTwistBegin, @ProfileBegin, |
425 | @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media | 425 | @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media, @DynAttrs |
426 | ) | 426 | ) |
427 | END"; | 427 | END"; |
428 | 428 | ||
@@ -1691,6 +1691,11 @@ VALUES | |||
1691 | 1691 | ||
1692 | if (!(primRow["MediaURL"] is System.DBNull)) | 1692 | if (!(primRow["MediaURL"] is System.DBNull)) |
1693 | prim.MediaUrl = (string)primRow["MediaURL"]; | 1693 | prim.MediaUrl = (string)primRow["MediaURL"]; |
1694 | |||
1695 | if (!(primRow["DynAttrs"] is System.DBNull)) | ||
1696 | prim.DynAttrs = DynAttrsOSDMap.FromXml((string)primRow["DynAttrs"]); | ||
1697 | else | ||
1698 | prim.DynAttrs = new DynAttrsOSDMap(); | ||
1694 | 1699 | ||
1695 | return prim; | 1700 | return prim; |
1696 | } | 1701 | } |
@@ -1749,6 +1754,10 @@ VALUES | |||
1749 | baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); | 1754 | baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); |
1750 | } | 1755 | } |
1751 | 1756 | ||
1757 | if (!(shapeRow["DynAttrs"] is System.DBNull)) | ||
1758 | baseShape.DynAttrs = DynAttrsOSDMap.FromXml((string)shapeRow["DynAttrs"]); | ||
1759 | else | ||
1760 | baseShape.DynAttrs = new DynAttrsOSDMap(); | ||
1752 | 1761 | ||
1753 | return baseShape; | 1762 | return baseShape; |
1754 | } | 1763 | } |
@@ -2086,6 +2095,7 @@ VALUES | |||
2086 | parameters.Add(_Database.CreateParameter("PassTouches", 0)); | 2095 | parameters.Add(_Database.CreateParameter("PassTouches", 0)); |
2087 | parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); | 2096 | parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); |
2088 | parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); | 2097 | parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); |
2098 | parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); | ||
2089 | 2099 | ||
2090 | return parameters.ToArray(); | 2100 | return parameters.ToArray(); |
2091 | } | 2101 | } |
@@ -2143,6 +2153,7 @@ VALUES | |||
2143 | parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml())); | 2153 | parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml())); |
2144 | } | 2154 | } |
2145 | 2155 | ||
2156 | parameters.Add(_Database.CreateParameter("DynAttrs", s.DynAttrs.ToXml())); | ||
2146 | 2157 | ||
2147 | return parameters.ToArray(); | 2158 | return parameters.ToArray(); |
2148 | } | 2159 | } |
diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index 350e548..5e88e36 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations | |||
@@ -1148,3 +1148,12 @@ CREATE TABLE [dbo].[regionenvironment]( | |||
1148 | ) ON [PRIMARY] | 1148 | ) ON [PRIMARY] |
1149 | 1149 | ||
1150 | COMMIT | 1150 | COMMIT |
1151 | |||
1152 | :VERSION 38 #---------------- Dynamic attributes | ||
1153 | |||
1154 | BEGIN TRANSACTION | ||
1155 | |||
1156 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; | ||
1157 | ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; | ||
1158 | |||
1159 | COMMIT | ||
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; | |||
902 | CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); | 902 | CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); |
903 | 903 | ||
904 | COMMIT; | 904 | COMMIT; |
905 | |||
906 | :VERSION 46 #---------------- Dynamic attributes | ||
907 | |||
908 | BEGIN; | ||
909 | |||
910 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; | ||
911 | ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; | ||
912 | |||
913 | COMMIT; | ||