diff options
author | Aleric Inglewood | 2013-08-04 19:19:11 +0200 |
---|---|---|
committer | teravus | 2013-09-22 21:10:01 -0500 |
commit | 2dc92e7de11086c7649d3ee0f8adc974efce6805 (patch) | |
tree | e69a633127525a5967ddadeef723a99f38e5d4aa /OpenSim/Data/SQLite | |
parent | minor: Recomment out log message uncommented in previous cbdfe969 (diff) | |
download | opensim-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/SQLite')
-rw-r--r-- | OpenSim/Data/SQLite/Resources/RegionStore.migrations | 12 | ||||
-rw-r--r-- | OpenSim/Data/SQLite/SQLiteSimulationData.cs | 16 |
2 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Data/SQLite/Resources/RegionStore.migrations b/OpenSim/Data/SQLite/Resources/RegionStore.migrations index bff039d..901068f 100644 --- a/OpenSim/Data/SQLite/Resources/RegionStore.migrations +++ b/OpenSim/Data/SQLite/Resources/RegionStore.migrations | |||
@@ -600,3 +600,15 @@ BEGIN; | |||
600 | ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob; | 600 | ALTER TABLE prims ADD COLUMN `KeyframeMotion` blob; |
601 | 601 | ||
602 | COMMIT; | 602 | COMMIT; |
603 | |||
604 | :VERSION 30 #---------------- Save Attachment info | ||
605 | |||
606 | BEGIN; | ||
607 | |||
608 | ALTER TABLE prims ADD COLUMN AttachedPosX double default '0'; | ||
609 | ALTER TABLE prims ADD COLUMN AttachedPosY double default '0'; | ||
610 | ALTER TABLE prims ADD COLUMN AttachedPosZ double default '0'; | ||
611 | ALTER TABLE primshapes ADD COLUMN LastAttachPoint int not null default '0'; | ||
612 | |||
613 | COMMIT; | ||
614 | |||
diff --git a/OpenSim/Data/SQLite/SQLiteSimulationData.cs b/OpenSim/Data/SQLite/SQLiteSimulationData.cs index eba6612..d938b6b 100644 --- a/OpenSim/Data/SQLite/SQLiteSimulationData.cs +++ b/OpenSim/Data/SQLite/SQLiteSimulationData.cs | |||
@@ -1236,6 +1236,10 @@ namespace OpenSim.Data.SQLite | |||
1236 | 1236 | ||
1237 | createCol(prims, "MediaURL", typeof(String)); | 1237 | createCol(prims, "MediaURL", typeof(String)); |
1238 | 1238 | ||
1239 | createCol(prims, "AttachedPosX", typeof(Double)); | ||
1240 | createCol(prims, "AttachedPosY", typeof(Double)); | ||
1241 | createCol(prims, "AttachedPosZ", typeof(Double)); | ||
1242 | |||
1239 | createCol(prims, "DynAttrs", typeof(String)); | 1243 | createCol(prims, "DynAttrs", typeof(String)); |
1240 | 1244 | ||
1241 | createCol(prims, "PhysicsShapeType", typeof(Byte)); | 1245 | createCol(prims, "PhysicsShapeType", typeof(Byte)); |
@@ -1724,6 +1728,12 @@ namespace OpenSim.Data.SQLite | |||
1724 | prim.MediaUrl = (string)row["MediaURL"]; | 1728 | prim.MediaUrl = (string)row["MediaURL"]; |
1725 | } | 1729 | } |
1726 | 1730 | ||
1731 | prim.AttachedPos = new Vector3( | ||
1732 | Convert.ToSingle(row["AttachedPosX"]), | ||
1733 | Convert.ToSingle(row["AttachedPosY"]), | ||
1734 | Convert.ToSingle(row["AttachedPosZ"]) | ||
1735 | ); | ||
1736 | |||
1727 | if (!(row["DynAttrs"] is System.DBNull)) | 1737 | if (!(row["DynAttrs"] is System.DBNull)) |
1728 | { | 1738 | { |
1729 | //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); | 1739 | //m_log.DebugFormat("[SQLITE]: DynAttrs type [{0}]", row["DynAttrs"].GetType()); |
@@ -2176,6 +2186,10 @@ namespace OpenSim.Data.SQLite | |||
2176 | 2186 | ||
2177 | row["MediaURL"] = prim.MediaUrl; | 2187 | row["MediaURL"] = prim.MediaUrl; |
2178 | 2188 | ||
2189 | row["AttachedPosX"] = prim.AttachedPos.X; | ||
2190 | row["AttachedPosY"] = prim.AttachedPos.Y; | ||
2191 | row["AttachedPosZ"] = prim.AttachedPos.Z; | ||
2192 | |||
2179 | if (prim.DynAttrs.CountNamespaces > 0) | 2193 | if (prim.DynAttrs.CountNamespaces > 0) |
2180 | row["DynAttrs"] = prim.DynAttrs.ToXml(); | 2194 | row["DynAttrs"] = prim.DynAttrs.ToXml(); |
2181 | else | 2195 | else |
@@ -2444,6 +2458,7 @@ namespace OpenSim.Data.SQLite | |||
2444 | s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); | 2458 | s.ProfileCurve = Convert.ToByte(row["ProfileCurve"]); |
2445 | s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); | 2459 | s.ProfileHollow = Convert.ToUInt16(row["ProfileHollow"]); |
2446 | s.State = Convert.ToByte(row["State"]); | 2460 | s.State = Convert.ToByte(row["State"]); |
2461 | s.LastAttachPoint = Convert.ToByte(row["LastAttachPoint"]); | ||
2447 | 2462 | ||
2448 | byte[] textureEntry = (byte[])row["Texture"]; | 2463 | byte[] textureEntry = (byte[])row["Texture"]; |
2449 | s.TextureEntry = textureEntry; | 2464 | s.TextureEntry = textureEntry; |
@@ -2493,6 +2508,7 @@ namespace OpenSim.Data.SQLite | |||
2493 | row["ProfileCurve"] = s.ProfileCurve; | 2508 | row["ProfileCurve"] = s.ProfileCurve; |
2494 | row["ProfileHollow"] = s.ProfileHollow; | 2509 | row["ProfileHollow"] = s.ProfileHollow; |
2495 | row["State"] = s.State; | 2510 | row["State"] = s.State; |
2511 | row["LastAttachPoint"] = s.LastAttachPoint; | ||
2496 | 2512 | ||
2497 | row["Texture"] = s.TextureEntry; | 2513 | row["Texture"] = s.TextureEntry; |
2498 | row["ExtraParams"] = s.ExtraParams; | 2514 | row["ExtraParams"] = s.ExtraParams; |