aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Data/MySQL
diff options
context:
space:
mode:
authorMelanie2013-06-06 03:17:38 +0100
committerMelanie2013-06-06 03:17:38 +0100
commita3210d1cf812554b53afb407fd76dbb67ce2ac28 (patch)
tree2457f674b32aa082d1548a20af872eb0ae61abc9 /OpenSim/Data/MySQL
parentHook up Keyframe motion to almost everything. Failing to cross a sim border (diff)
downloadopensim-SC_OLD-a3210d1cf812554b53afb407fd76dbb67ce2ac28.zip
opensim-SC_OLD-a3210d1cf812554b53afb407fd76dbb67ce2ac28.tar.gz
opensim-SC_OLD-a3210d1cf812554b53afb407fd76dbb67ce2ac28.tar.bz2
opensim-SC_OLD-a3210d1cf812554b53afb407fd76dbb67ce2ac28.tar.xz
Database persistence for keyframes. Contains a Migration.
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r--OpenSim/Data/MySQL/MySQLSimulationData.cs29
-rw-r--r--OpenSim/Data/MySQL/Resources/RegionStore.migrations7
2 files changed, 32 insertions, 4 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs
index 2d20eaf..448962a 100644
--- a/OpenSim/Data/MySQL/MySQLSimulationData.cs
+++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs
@@ -173,9 +173,9 @@ namespace OpenSim.Data.MySQL
173 "ParticleSystem, ClickAction, Material, " + 173 "ParticleSystem, ClickAction, Material, " +
174 "CollisionSound, CollisionSoundVolume, " + 174 "CollisionSound, CollisionSoundVolume, " +
175 "PassTouches, " + 175 "PassTouches, " +
176 "LinkNumber, MediaURL, DynAttrs, " + 176 "LinkNumber, MediaURL, KeyframeMotion, " +
177 "PhysicsShapeType, Density, GravityModifier, " + 177 "PhysicsShapeType, Density, GravityModifier, " +
178 "Friction, Restitution " + 178 "Friction, Restitution, DynAttrs " +
179 ") values (" + "?UUID, " + 179 ") values (" + "?UUID, " +
180 "?CreationDate, ?Name, ?Text, " + 180 "?CreationDate, ?Name, ?Text, " +
181 "?Description, ?SitName, ?TouchName, " + 181 "?Description, ?SitName, ?TouchName, " +
@@ -208,9 +208,9 @@ namespace OpenSim.Data.MySQL
208 "?ColorB, ?ColorA, ?ParticleSystem, " + 208 "?ColorB, ?ColorA, ?ParticleSystem, " +
209 "?ClickAction, ?Material, ?CollisionSound, " + 209 "?ClickAction, ?Material, ?CollisionSound, " +
210 "?CollisionSoundVolume, ?PassTouches, " + 210 "?CollisionSoundVolume, ?PassTouches, " +
211 "?LinkNumber, ?MediaURL, ?DynAttrs, " + 211 "?LinkNumber, ?MediaURL, ?KeyframeMotion, " +
212 "?PhysicsShapeType, ?Density, ?GravityModifier, " + 212 "?PhysicsShapeType, ?Density, ?GravityModifier, " +
213 "?Friction, ?Restitution)"; 213 "?Friction, ?Restitution, ?DynAttrs)";
214 214
215 FillPrimCommand(cmd, prim, obj.UUID, regionUUID); 215 FillPrimCommand(cmd, prim, obj.UUID, regionUUID);
216 216
@@ -455,7 +455,11 @@ namespace OpenSim.Data.MySQL
455 foreach (SceneObjectPart prim in prims.Values) 455 foreach (SceneObjectPart prim in prims.Values)
456 { 456 {
457 if (prim.ParentUUID == UUID.Zero) 457 if (prim.ParentUUID == UUID.Zero)
458 {
458 objects[prim.UUID] = new SceneObjectGroup(prim); 459 objects[prim.UUID] = new SceneObjectGroup(prim);
460 if (prim.KeyframeMotion != null)
461 prim.KeyframeMotion.UpdateSceneObject(objects[prim.UUID]);
462 }
459 } 463 }
460 464
461 // Add all of the children objects to the SOGs 465 // Add all of the children objects to the SOGs
@@ -1307,6 +1311,19 @@ namespace OpenSim.Data.MySQL
1307 else 1311 else
1308 prim.DynAttrs = new DAMap(); 1312 prim.DynAttrs = new DAMap();
1309 1313
1314 if (!(row["KeyframeMotion"] is DBNull))
1315 {
1316 Byte[] data = (byte[])row["KeyframeMotion"];
1317 if (data.Length > 0)
1318 prim.KeyframeMotion = KeyframeMotion.FromData(null, data);
1319 else
1320 prim.KeyframeMotion = null;
1321 }
1322 else
1323 {
1324 prim.KeyframeMotion = null;
1325 }
1326
1310 prim.PhysicsShapeType = (byte)Convert.ToInt32(row["PhysicsShapeType"].ToString()); 1327 prim.PhysicsShapeType = (byte)Convert.ToInt32(row["PhysicsShapeType"].ToString());
1311 prim.Density = (float)(double)row["Density"]; 1328 prim.Density = (float)(double)row["Density"];
1312 prim.GravityModifier = (float)(double)row["GravityModifier"]; 1329 prim.GravityModifier = (float)(double)row["GravityModifier"];
@@ -1659,6 +1676,10 @@ namespace OpenSim.Data.MySQL
1659 cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); 1676 cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum);
1660 cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); 1677 cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl);
1661 1678
1679 if (prim.KeyframeMotion != null)
1680 cmd.Parameters.AddWithValue("KeyframeMotion", prim.KeyframeMotion.Serialize());
1681 else
1682 cmd.Parameters.AddWithValue("KeyframeMotion", new Byte[0]);
1662 1683
1663 if (prim.DynAttrs.Count > 0) 1684 if (prim.DynAttrs.Count > 0)
1664 cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); 1685 cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml());
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
index 513c784..70b9558 100644
--- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations
+++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations
@@ -923,3 +923,10 @@ ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5';
923 923
924COMMIT; 924COMMIT;
925 925
926:VERSION 48 #---------------- Keyframes
927
928BEGIN;
929
930ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob;
931
932COMMIT;