aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MSSQL
diff options
context:
space:
mode:
authorAleric Inglewood2013-08-04 19:19:11 +0200
committerteravus2013-09-22 21:10:01 -0500
commit2dc92e7de11086c7649d3ee0f8adc974efce6805 (patch)
treee69a633127525a5967ddadeef723a99f38e5d4aa /OpenSim/Data/MSSQL
parentminor: Recomment out log message uncommented in previous cbdfe969 (diff)
downloadopensim-SC_OLD-2dc92e7de11086c7649d3ee0f8adc974efce6805.zip
opensim-SC_OLD-2dc92e7de11086c7649d3ee0f8adc974efce6805.tar.gz
opensim-SC_OLD-2dc92e7de11086c7649d3ee0f8adc974efce6805.tar.bz2
opensim-SC_OLD-2dc92e7de11086c7649d3ee0f8adc974efce6805.tar.xz
Preserve attachment point & position when attachment is rezzed in world
Patch taken from http://opensimulator.org/mantis/view.php?id=4905 originally by Greg C. Fixed to apply to r/23314 commit ba9daf849e7c8db48e7c03e7cdedb77776b2052f (cherry picked from commit 4ff9fbca441110cc2b93edc7286e0e9339e61cbe)
Diffstat (limited to 'OpenSim/Data/MSSQL')
-rw-r--r--OpenSim/Data/MSSQL/MSSQLSimulationData.cs17
-rw-r--r--OpenSim/Data/MSSQL/Resources/RegionStore.migrations12
2 files changed, 25 insertions, 4 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLSimulationData.cs b/OpenSim/Data/MSSQL/MSSQLSimulationData.cs
index 5135050..f41f60c 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, DynAttrs = @DynAttrs, 354 LinkNumber = @LinkNumber, MediaURL = @MediaURL, AttachedPosX = @AttachedPosX, AttachedPosY = @AttachedPosY, AttachedPosZ = @AttachedPosZ, DynAttrs = @DynAttrs,
355 PhysicsShapeType = @PhysicsShapeType, Density = @Density, GravityModifier = @GravityModifier, Friction = @Friction, Restitution = @Restitution 355 PhysicsShapeType = @PhysicsShapeType, Density = @Density, GravityModifier = @GravityModifier, Friction = @Friction, Restitution = @Restitution
356 WHERE UUID = @UUID 356 WHERE UUID = @UUID
357 END 357 END
@@ -367,7 +367,7 @@ ELSE
367 PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX, 367 PayPrice, PayButton1, PayButton2, PayButton3, PayButton4, LoopedSound, LoopedSoundGain, TextureAnimation, OmegaX,
368 OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ, 368 OmegaY, OmegaZ, CameraEyeOffsetX, CameraEyeOffsetY, CameraEyeOffsetZ, CameraAtOffsetX, CameraAtOffsetY, CameraAtOffsetZ,
369 ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA, 369 ForceMouselook, ScriptAccessPin, AllowedDrop, DieAtEdge, SalePrice, SaleType, ColorR, ColorG, ColorB, ColorA,
370 ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, DynAttrs, 370 ParticleSystem, ClickAction, Material, CollisionSound, CollisionSoundVolume, PassTouches, LinkNumber, MediaURL, AttachedPosX, AttachedPosY, AttachedPosZ, DynAttrs,
371 PhysicsShapeType, Density, GravityModifier, Friction, Restitution 371 PhysicsShapeType, Density, GravityModifier, Friction, Restitution
372 ) VALUES ( 372 ) VALUES (
373 @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask, 373 @UUID, @CreationDate, @Name, @Text, @Description, @SitName, @TouchName, @ObjectFlags, @OwnerMask, @NextOwnerMask, @GroupMask,
@@ -378,7 +378,7 @@ ELSE
378 @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX, 378 @PayPrice, @PayButton1, @PayButton2, @PayButton3, @PayButton4, @LoopedSound, @LoopedSoundGain, @TextureAnimation, @OmegaX,
379 @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ, 379 @OmegaY, @OmegaZ, @CameraEyeOffsetX, @CameraEyeOffsetY, @CameraEyeOffsetZ, @CameraAtOffsetX, @CameraAtOffsetY, @CameraAtOffsetZ,
380 @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA, 380 @ForceMouselook, @ScriptAccessPin, @AllowedDrop, @DieAtEdge, @SalePrice, @SaleType, @ColorR, @ColorG, @ColorB, @ColorA,
381 @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @DynAttrs, 381 @ParticleSystem, @ClickAction, @Material, @CollisionSound, @CollisionSoundVolume, @PassTouches, @LinkNumber, @MediaURL, @AttachedPosX, @AttachedPosY, @AttachedPosZ, @DynAttrs,
382 @PhysicsShapeType, @Density, @GravityModifier, @Friction, @Restitution 382 @PhysicsShapeType, @Density, @GravityModifier, @Friction, @Restitution
383 ) 383 )
384 END"; 384 END";
@@ -1695,6 +1695,12 @@ VALUES
1695 if (!(primRow["MediaURL"] is System.DBNull)) 1695 if (!(primRow["MediaURL"] is System.DBNull))
1696 prim.MediaUrl = (string)primRow["MediaURL"]; 1696 prim.MediaUrl = (string)primRow["MediaURL"];
1697 1697
1698 if (!(primRow["AttachedPosX"] is System.DBNull))
1699 prim.AttachedPos = new Vector3(
1700 Convert.ToSingle(primRow["AttachedPosX"]),
1701 Convert.ToSingle(primRow["AttachedPosY"]),
1702 Convert.ToSingle(primRow["AttachedPosZ"]));
1703
1698 if (!(primRow["DynAttrs"] is System.DBNull)) 1704 if (!(primRow["DynAttrs"] is System.DBNull))
1699 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]); 1705 prim.DynAttrs = DAMap.FromXml((string)primRow["DynAttrs"]);
1700 else 1706 else
@@ -2099,7 +2105,10 @@ VALUES
2099 parameters.Add(_Database.CreateParameter("PassTouches", 0)); 2105 parameters.Add(_Database.CreateParameter("PassTouches", 0));
2100 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum)); 2106 parameters.Add(_Database.CreateParameter("LinkNumber", prim.LinkNum));
2101 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl)); 2107 parameters.Add(_Database.CreateParameter("MediaURL", prim.MediaUrl));
2102 2108 parameters.Add(_Database.CreateParameter("AttachedPosX", prim.AttachedPos.X));
2109 parameters.Add(_Database.CreateParameter("AttachedPosY", prim.AttachedPos.Y));
2110 parameters.Add(_Database.CreateParameter("AttachedPosZ", prim.AttachedPos.Z));
2111
2103 if (prim.DynAttrs.CountNamespaces > 0) 2112 if (prim.DynAttrs.CountNamespaces > 0)
2104 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml())); 2113 parameters.Add(_Database.CreateParameter("DynAttrs", prim.DynAttrs.ToXml()));
2105 else 2114 else
diff --git a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations
index 4549801..bb89884 100644
--- a/OpenSim/Data/MSSQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MSSQL/Resources/RegionStore.migrations
@@ -1168,3 +1168,15 @@ ALTER TABLE prims ADD `Friction` double NOT NULL default '0.6';
1168ALTER TABLE prims ADD `Restitution` double NOT NULL default '0.5'; 1168ALTER TABLE prims ADD `Restitution` double NOT NULL default '0.5';
1169 1169
1170COMMIT 1170COMMIT
1171
1172:VERSION 40 #---------------- Save Attachment info
1173
1174BEGIN TRANSACTION
1175
1176ALTER TABLE prims ADD AttachedPosX float(53) default 0.0;
1177ALTER TABLE prims ADD AttachedPosY float(53) default 0.0;
1178ALTER TABLE prims ADD AttachedPosZ float(53) default 0.0;
1179ALTER TABLE primshapes ADD LastAttachPoint int not null default 0;
1180
1181COMMIT
1182