From 1bd0b06ec1a0a5a7d6302d8017edcea7faf557e0 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Aug 2010 20:38:20 +0100 Subject: Implement Dynamic Attributes for SOP and PBS. Implement storage in SQLite --- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 29cac3c..b97653b 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1232,6 +1232,8 @@ namespace OpenSim.Data.SQLite createCol(prims, "VolumeDetect", typeof(Int16)); createCol(prims, "MediaURL", typeof(String)); + + createCol(prims, "DynAttrs", typeof(String)); // Add in contraints prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; @@ -1280,6 +1282,7 @@ namespace OpenSim.Data.SQLite createCol(shapes, "Texture", typeof(Byte[])); createCol(shapes, "ExtraParams", typeof(Byte[])); createCol(shapes, "Media", typeof(String)); + createCol(shapes, "DynAttrs", typeof(String)); shapes.PrimaryKey = new DataColumn[] { shapes.Columns["UUID"] }; @@ -1711,6 +1714,16 @@ namespace OpenSim.Data.SQLite // m_log.DebugFormat("[SQLITE]: MediaUrl type [{0}]", row["MediaURL"].GetType()); prim.MediaUrl = (string)row["MediaURL"]; } + + if (!(row["DynAttrs"] is System.DBNull)) + { + //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); + prim.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + } + else + { + prim.DynAttrs = new DynAttrsOSDMap(); + } return prim; } @@ -2133,6 +2146,7 @@ namespace OpenSim.Data.SQLite row["VolumeDetect"] = 0; row["MediaURL"] = prim.MediaUrl; + row["DynAttrs"] = prim.DynAttrs.ToXml(); } /// @@ -2393,6 +2407,11 @@ namespace OpenSim.Data.SQLite if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); + if (!(row["DynAttrs"] is System.DBNull)) + s.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + else + s.DynAttrs = new DynAttrsOSDMap(); + return s; } @@ -2439,6 +2458,8 @@ namespace OpenSim.Data.SQLite if (s.Media != null) row["Media"] = s.Media.ToXml(); + + row["DynAttrs"] = s.DynAttrs.ToXml(); } /// -- cgit v1.1 From a3e1e6dd611a179eb2d894a45ae45ef278ae2e85 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Aug 2010 21:57:08 +0100 Subject: Implement dynamic attribute persistence on mysql and mssql mssql is untested --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 23 ++++++++++++++++------ .../Data/MSSQL/Resources/RegionStore.migrations | 9 +++++++++ OpenSim/Data/MySQL/MySQLSimulationData.cs | 16 +++++++++++++-- .../Data/MySQL/Resources/RegionStore.migrations | 9 +++++++++ 4 files changed, 49 insertions(+), 8 deletions(-) (limited to 'OpenSim/Data') 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) ScriptAccessPin = @ScriptAccessPin, AllowedDrop = @AllowedDrop, DieAtEdge = @DieAtEdge, SalePrice = @SalePrice, SaleType = @SaleType, ColorR = @ColorR, ColorG = @ColorG, ColorB = @ColorB, ColorA = @ColorA, ParticleSystem = @ParticleSystem, ClickAction = @ClickAction, Material = @Material, CollisionSound = @CollisionSound, CollisionSoundVolume = @CollisionSoundVolume, PassTouches = @PassTouches, - LinkNumber = @LinkNumber, MediaURL = @MediaURL + LinkNumber = @LinkNumber, MediaURL = @MediaURL, DynAttrs = @DynAttrs WHERE UUID = @UUID END ELSE @@ -366,7 +366,7 @@ ELSE PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, - ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL + ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs ) VALUES ( @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, @EveryoneMask, @BaseMask, @PositionX, @PositionY, @PositionZ, @GroupPositionX, @GroupPositionY, @GroupPositionZ, @VelocityX, @@ -376,7 +376,7 @@ ELSE @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, - @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL + @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs ) END"; @@ -409,7 +409,7 @@ IF EXISTS (SELECT UUID FROM primshapes WHERE UUID = @UUID) PathSkew = @PathSkew, PathCurve = @PathCurve, PathRadiusOffset = @PathRadiusOffset, PathRevolutions = @PathRevolutions, PathTaperX = @PathTaperX, PathTaperY = @PathTaperY, PathTwist = @PathTwist, PathTwistBegin = @PathTwistBegin, ProfileBegin = @ProfileBegin, ProfileEnd = @ProfileEnd, ProfileCurve = @ProfileCurve, ProfileHollow = @ProfileHollow, - Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media + Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media, DynAttrs = @DynAttrs WHERE UUID = @UUID END ELSE @@ -418,11 +418,11 @@ ELSE primshapes ( UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, - ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media + ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media, DynAttrs ) VALUES ( @UUID, @Shape, @ScaleX, @ScaleY, @ScaleZ, @PCode, @PathBegin, @PathEnd, @PathScaleX, @PathScaleY, @PathShearX, @PathShearY, @PathSkew, @PathCurve, @PathRadiusOffset, @PathRevolutions, @PathTaperX, @PathTaperY, @PathTwist, @PathTwistBegin, @ProfileBegin, - @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media + @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media, @DynAttrs ) END"; @@ -1691,6 +1691,11 @@ VALUES if (!(primRow["MediaURL"] is System.DBNull)) prim.MediaUrl = (string)primRow["MediaURL"]; + + if (!(primRow["DynAttrs"] is System.DBNull)) + prim.DynAttrs = DynAttrsOSDMap.FromXml((string)primRow["DynAttrs"]); + else + prim.DynAttrs = new DynAttrsOSDMap(); return prim; } @@ -1749,6 +1754,10 @@ VALUES baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); } + if (!(shapeRow["DynAttrs"] is System.DBNull)) + baseShape.DynAttrs = DynAttrsOSDMap.FromXml((string)shapeRow["DynAttrs"]); + else + baseShape.DynAttrs = new DynAttrsOSDMap(); return baseShape; } @@ -2086,6 +2095,7 @@ VALUES parameters.Add(_Database.CreateParameter("PassTouches", 0)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); + parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); return parameters.ToArray(); } @@ -2143,6 +2153,7 @@ VALUES parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml())); } + parameters.Add(_Database.CreateParameter("DynAttrs", s.DynAttrs.ToXml())); return parameters.ToArray(); } 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]( ) ON [PRIMARY] COMMIT + +:VERSION 38 #---------------- Dynamic attributes + +BEGIN TRANSACTION + +ALTER TABLE prims ADD COLUMN DynAttrs TEXT; +ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; + +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 "?SaleType, ?ColorR, ?ColorG, " + "?ColorB, ?ColorA, ?ParticleSystem, " + "?ClickAction, ?Material, ?CollisionSound, " + - "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; + "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL, ?DynAttrs)"; FillPrimCommand(cmd, prim, obj.UUID, regionUUID); @@ -230,7 +230,7 @@ namespace OpenSim.Data.MySQL "?PathTwistBegin, ?ProfileBegin, " + "?ProfileEnd, ?ProfileCurve, " + "?ProfileHollow, ?Texture, ?ExtraParams, " + - "?State, ?Media)"; + "?State, ?Media, ?DynAttrs)"; FillShapeCommand(cmd, prim); @@ -1291,6 +1291,11 @@ namespace OpenSim.Data.MySQL if (!(row["MediaURL"] is System.DBNull)) prim.MediaUrl = (string)row["MediaURL"]; + + if (!(row["DynAttrs"] is System.DBNull)) + prim.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + else + prim.DynAttrs = new DynAttrsOSDMap(); return prim; } @@ -1637,6 +1642,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); + cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); } /// @@ -1829,6 +1835,11 @@ namespace OpenSim.Data.MySQL if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); + + if (!(row["DynAttrs"] is System.DBNull)) + s.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + else + s.DynAttrs = new DynAttrsOSDMap(); return s; } @@ -1873,6 +1884,7 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams); cmd.Parameters.AddWithValue("State", s.State); cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); + cmd.Parameters.AddWithValue("DynAttrs", s.DynAttrs.ToXml()); } public void StorePrimInventory(UUID primID, ICollection 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; CREATE TABLE `regionextra` (`RegionID` char(36) not null, `Name` varchar(32) not null, `value` text, primary key(`RegionID`, `Name`)); COMMIT; + +:VERSION 46 #---------------- Dynamic attributes + +BEGIN; + +ALTER TABLE prims ADD COLUMN DynAttrs TEXT; +ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; + +COMMIT; -- cgit v1.1 From a6d9c263650cc23d60f941718f87a64aa2f360b2 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 16 Aug 2010 22:21:46 +0100 Subject: Encapsulate an OSDMap in DAMap (was DynAttrsOSDMap) rather than inheriting from it This is the easier way to give us control over locking, rather than asking that OSDMap IDictionary methods be virtual --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 8 ++++---- OpenSim/Data/MySQL/MySQLSimulationData.cs | 8 ++++---- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index e949738..e0e260d 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -1693,9 +1693,9 @@ VALUES prim.MediaUrl = (string)primRow["MediaURL"]; if (!(primRow["DynAttrs"] is System.DBNull)) - prim.DynAttrs = DynAttrsOSDMap.FromXml((string)primRow["DynAttrs"]); + prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); else - prim.DynAttrs = new DynAttrsOSDMap(); + prim.DynAttrs = new DAMap(); return prim; } @@ -1755,9 +1755,9 @@ VALUES } if (!(shapeRow["DynAttrs"] is System.DBNull)) - baseShape.DynAttrs = DynAttrsOSDMap.FromXml((string)shapeRow["DynAttrs"]); + baseShape.DynAttrs = DAMap.FromXml((string)shapeRow["DynAttrs"]); else - baseShape.DynAttrs = new DynAttrsOSDMap(); + baseShape.DynAttrs = new DAMap(); return baseShape; } diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index b7f39fb..e558702 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1293,9 +1293,9 @@ namespace OpenSim.Data.MySQL prim.MediaUrl = (string)row["MediaURL"]; if (!(row["DynAttrs"] is System.DBNull)) - prim.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); else - prim.DynAttrs = new DynAttrsOSDMap(); + prim.DynAttrs = new DAMap(); return prim; } @@ -1837,9 +1837,9 @@ namespace OpenSim.Data.MySQL s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); if (!(row["DynAttrs"] is System.DBNull)) - s.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + s.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); else - s.DynAttrs = new DynAttrsOSDMap(); + s.DynAttrs = new DAMap(); return s; } diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index b97653b..6875ed6 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1718,11 +1718,11 @@ namespace OpenSim.Data.SQLite if (!(row["DynAttrs"] is System.DBNull)) { //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); - prim.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); } else { - prim.DynAttrs = new DynAttrsOSDMap(); + prim.DynAttrs = new DAMap(); } return prim; @@ -2408,9 +2408,9 @@ namespace OpenSim.Data.SQLite s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); if (!(row["DynAttrs"] is System.DBNull)) - s.DynAttrs = DynAttrsOSDMap.FromXml((string)row["DynAttrs"]); + s.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); else - s.DynAttrs = new DynAttrsOSDMap(); + s.DynAttrs = new DAMap(); return s; } -- cgit v1.1 From 918b06286607a06e73eae5f24762b45eee76fd6a Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Mon, 21 Jan 2013 18:45:01 +0200 Subject: Added missing DynAttrs references in MySQL --- OpenSim/Data/MySQL/MySQLSimulationData.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index e558702..77fa1ec 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -171,7 +171,8 @@ namespace OpenSim.Data.MySQL "ParticleSystem, ClickAction, Material, " + "CollisionSound, CollisionSoundVolume, " + "PassTouches, " + - "LinkNumber, MediaURL) values (" + "?UUID, " + + "LinkNumber, MediaURL, DynAttrs) " + + "values (?UUID, " + "?CreationDate, ?Name, ?Text, " + "?Description, ?SitName, ?TouchName, " + "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + @@ -202,7 +203,8 @@ namespace OpenSim.Data.MySQL "?SaleType, ?ColorR, ?ColorG, " + "?ColorB, ?ColorA, ?ParticleSystem, " + "?ClickAction, ?Material, ?CollisionSound, " + - "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL, ?DynAttrs)"; + "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, " + + "?MediaURL, ?DynAttrs)"; FillPrimCommand(cmd, prim, obj.UUID, regionUUID); @@ -219,7 +221,8 @@ namespace OpenSim.Data.MySQL "PathTaperX, PathTaperY, PathTwist, " + "PathTwistBegin, ProfileBegin, ProfileEnd, " + "ProfileCurve, ProfileHollow, Texture, " + - "ExtraParams, State, Media) values (?UUID, " + + "ExtraParams, State, Media, DynAttrs) " + + "values (?UUID, " + "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + "?PCode, ?PathBegin, ?PathEnd, " + "?PathScaleX, ?PathScaleY, " + -- cgit v1.1 From fdec05a15ef126f344c03427e9ef264b4248646b Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Jan 2013 08:49:36 +0200 Subject: Stopped storing dynamic attributes in the PrimShape --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 13 +++---------- OpenSim/Data/MSSQL/Resources/RegionStore.migrations | 1 - OpenSim/Data/MySQL/MySQLSimulationData.cs | 10 ++-------- OpenSim/Data/MySQL/Resources/RegionStore.migrations | 1 - OpenSim/Data/SQLite/SQLiteSimulationData.cs | 8 -------- 5 files changed, 5 insertions(+), 28 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index e0e260d..24252ad 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -409,7 +409,7 @@ IF EXISTS (SELECT UUID FROM primshapes WHERE UUID = @UUID) PathSkew = @PathSkew, PathCurve = @PathCurve, PathRadiusOffset = @PathRadiusOffset, PathRevolutions = @PathRevolutions, PathTaperX = @PathTaperX, PathTaperY = @PathTaperY, PathTwist = @PathTwist, PathTwistBegin = @PathTwistBegin, ProfileBegin = @ProfileBegin, ProfileEnd = @ProfileEnd, ProfileCurve = @ProfileCurve, ProfileHollow = @ProfileHollow, - Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media, DynAttrs = @DynAttrs + Texture = @Texture, ExtraParams = @ExtraParams, State = @State, Media = @Media WHERE UUID = @UUID END ELSE @@ -418,11 +418,11 @@ ELSE primshapes ( UUID, Shape, ScaleX, ScaleY, ScaleZ, PCode, PathBegin, PathEnd, PathScaleX, PathScaleY, PathShearX, PathShearY, PathSkew, PathCurve, PathRadiusOffset, PathRevolutions, PathTaperX, PathTaperY, PathTwist, PathTwistBegin, ProfileBegin, - ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media, DynAttrs + ProfileEnd, ProfileCurve, ProfileHollow, Texture, ExtraParams, State, Media ) VALUES ( @UUID, @Shape, @ScaleX, @ScaleY, @ScaleZ, @PCode, @PathBegin, @PathEnd, @PathScaleX, @PathScaleY, @PathShearX, @PathShearY, @PathSkew, @PathCurve, @PathRadiusOffset, @PathRevolutions, @PathTaperX, @PathTaperY, @PathTwist, @PathTwistBegin, @ProfileBegin, - @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media, @DynAttrs + @ProfileEnd, @ProfileCurve, @ProfileHollow, @Texture, @ExtraParams, @State, @Media ) END"; @@ -1754,11 +1754,6 @@ VALUES baseShape.Media = PrimitiveBaseShape.MediaList.FromXml((string)shapeRow["Media"]); } - if (!(shapeRow["DynAttrs"] is System.DBNull)) - baseShape.DynAttrs = DAMap.FromXml((string)shapeRow["DynAttrs"]); - else - baseShape.DynAttrs = new DAMap(); - return baseShape; } @@ -2153,8 +2148,6 @@ VALUES parameters.Add(_Database.CreateParameter("Media", s.Media.ToXml())); } - parameters.Add(_Database.CreateParameter("DynAttrs", s.DynAttrs.ToXml())); - return parameters.ToArray(); } diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations index 5e88e36..92cc38a 100644 --- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations @@ -1154,6 +1154,5 @@ COMMIT BEGIN TRANSACTION ALTER TABLE prims ADD COLUMN DynAttrs TEXT; -ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; COMMIT diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 77fa1ec..1a6a0fb 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -221,7 +221,7 @@ namespace OpenSim.Data.MySQL "PathTaperX, PathTaperY, PathTwist, " + "PathTwistBegin, ProfileBegin, ProfileEnd, " + "ProfileCurve, ProfileHollow, Texture, " + - "ExtraParams, State, Media, DynAttrs) " + + "ExtraParams, State, Media) " + "values (?UUID, " + "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + "?PCode, ?PathBegin, ?PathEnd, " + @@ -233,7 +233,7 @@ namespace OpenSim.Data.MySQL "?PathTwistBegin, ?ProfileBegin, " + "?ProfileEnd, ?ProfileCurve, " + "?ProfileHollow, ?Texture, ?ExtraParams, " + - "?State, ?Media, ?DynAttrs)"; + "?State, ?Media)"; FillShapeCommand(cmd, prim); @@ -1838,11 +1838,6 @@ namespace OpenSim.Data.MySQL if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); - - if (!(row["DynAttrs"] is System.DBNull)) - s.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); - else - s.DynAttrs = new DAMap(); return s; } @@ -1887,7 +1882,6 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("ExtraParams", s.ExtraParams); cmd.Parameters.AddWithValue("State", s.State); cmd.Parameters.AddWithValue("Media", null == s.Media ? null : s.Media.ToXml()); - cmd.Parameters.AddWithValue("DynAttrs", s.DynAttrs.ToXml()); } public void StorePrimInventory(UUID primID, ICollection items) diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index 1a38836..c48aec2 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations @@ -908,6 +908,5 @@ COMMIT; BEGIN; ALTER TABLE prims ADD COLUMN DynAttrs TEXT; -ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; COMMIT; diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index 6875ed6..fda7728 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -1282,7 +1282,6 @@ namespace OpenSim.Data.SQLite createCol(shapes, "Texture", typeof(Byte[])); createCol(shapes, "ExtraParams", typeof(Byte[])); createCol(shapes, "Media", typeof(String)); - createCol(shapes, "DynAttrs", typeof(String)); shapes.PrimaryKey = new DataColumn[] { shapes.Columns["UUID"] }; @@ -2406,11 +2405,6 @@ namespace OpenSim.Data.SQLite if (!(row["Media"] is System.DBNull)) s.Media = PrimitiveBaseShape.MediaList.FromXml((string)row["Media"]); - - if (!(row["DynAttrs"] is System.DBNull)) - s.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); - else - s.DynAttrs = new DAMap(); return s; } @@ -2458,8 +2452,6 @@ namespace OpenSim.Data.SQLite if (s.Media != null) row["Media"] = s.Media.ToXml(); - - row["DynAttrs"] = s.DynAttrs.ToXml(); } /// -- cgit v1.1 From 86802bcf937e19ea99c2f9b7bc757b4e9daf3d16 Mon Sep 17 00:00:00 2001 From: Oren Hurvitz Date: Tue, 22 Jan 2013 08:55:15 +0200 Subject: Store NULL in the 'DynAttrs' column if the prim doesn't have any dynamic attributes --- OpenSim/Data/MSSQL/MSSQLSimulationData.cs | 6 +++++- OpenSim/Data/MySQL/MySQLSimulationData.cs | 6 +++++- OpenSim/Data/SQLite/SQLiteSimulationData.cs | 6 +++++- 3 files changed, 15 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs index 24252ad..276a190 100644 --- a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs +++ b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs @@ -2090,7 +2090,11 @@ VALUES parameters.Add(_Database.CreateParameter("PassTouches", 0)); parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); - parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); + + if (prim.DynAttrs.Count > 0) + parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); + else + parameters.Add(_Database.CreateParameter("DynAttrs", null)); return parameters.ToArray(); } diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 1a6a0fb..c95311e 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs @@ -1645,7 +1645,11 @@ namespace OpenSim.Data.MySQL cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); - cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); + + if (prim.DynAttrs.Count > 0) + cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); + else + cmd.Parameters.AddWithValue("DynAttrs", null); } /// diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index fda7728..91fc704 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs @@ -2145,7 +2145,11 @@ namespace OpenSim.Data.SQLite row["VolumeDetect"] = 0; row["MediaURL"] = prim.MediaUrl; - row["DynAttrs"] = prim.DynAttrs.ToXml(); + + if (prim.DynAttrs.Count > 0) + row["DynAttrs"] = prim.DynAttrs.ToXml(); + else + row["DynAttrs"] = null; } /// -- cgit v1.1 From 77894151485e4e6ad397cee85a551a4593e57cdd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Jan 2013 04:22:32 +0000 Subject: Fix tests by adding DynAttrs add column commands to RegionStore.migrations (these were originally in 021_RegionStore.sql which I might have forgotton to add 2 years ago). --- OpenSim/Data/SQLite/Resources/RegionStore.migrations | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index e872977..4c3c55d 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -575,3 +575,9 @@ CREATE TABLE `regionenvironment` ( ); COMMIT; + +:VERSION 27 +BEGIN; +ALTER TABLE prims ADD COLUMN DynAttrs TEXT; +ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; +COMMIT; \ No newline at end of file -- cgit v1.1 From 7a139f8e5324c68c58249fc21e4ac78328cfa3bf Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Fri, 25 Jan 2013 04:35:06 +0000 Subject: Remove the accidental PrimShapes column that I added back to the SQLite region store --- OpenSim/Data/SQLite/Resources/RegionStore.migrations | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'OpenSim/Data') diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index 4c3c55d..e583dc2 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations @@ -579,5 +579,4 @@ COMMIT; :VERSION 27 BEGIN; ALTER TABLE prims ADD COLUMN DynAttrs TEXT; -ALTER TABLE primshapes ADD COLUMN DynAttrs TEXT; -COMMIT; \ No newline at end of file +COMMIT; -- cgit v1.1