diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLSimulationData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 65 |
1 files changed, 49 insertions, 16 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index d562783..1b02b4f 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -52,7 +52,7 @@ namespace OpenSim.Data.MySQL | |||
52 | private string m_connectionString; | 52 | private string m_connectionString; |
53 | private object m_dbLock = new object(); | 53 | private object m_dbLock = new object(); |
54 | 54 | ||
55 | protected virtual Assembly Assembly | 55 | protected Assembly Assembly |
56 | { | 56 | { |
57 | get { return GetType().Assembly; } | 57 | get { return GetType().Assembly; } |
58 | } | 58 | } |
@@ -119,8 +119,10 @@ namespace OpenSim.Data.MySQL | |||
119 | 119 | ||
120 | // Eligibility check | 120 | // Eligibility check |
121 | // | 121 | // |
122 | if ((flags & (uint)PrimFlags.Temporary) != 0) | 122 | // PrimFlags.Temporary is not used in OpenSim code and cannot |
123 | return; | 123 | // be guaranteed to always be clear. Don't check it. |
124 | // if ((flags & (uint)PrimFlags.Temporary) != 0) | ||
125 | // return; | ||
124 | if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) | 126 | if ((flags & (uint)PrimFlags.TemporaryOnRez) != 0) |
125 | return; | 127 | return; |
126 | 128 | ||
@@ -135,7 +137,7 @@ namespace OpenSim.Data.MySQL | |||
135 | foreach (SceneObjectPart prim in obj.Parts) | 137 | foreach (SceneObjectPart prim in obj.Parts) |
136 | { | 138 | { |
137 | cmd.Parameters.Clear(); | 139 | cmd.Parameters.Clear(); |
138 | 140 | ||
139 | cmd.CommandText = "replace into prims (" + | 141 | cmd.CommandText = "replace into prims (" + |
140 | "UUID, CreationDate, " + | 142 | "UUID, CreationDate, " + |
141 | "Name, Text, Description, " + | 143 | "Name, Text, Description, " + |
@@ -171,7 +173,10 @@ namespace OpenSim.Data.MySQL | |||
171 | "ParticleSystem, ClickAction, Material, " + | 173 | "ParticleSystem, ClickAction, Material, " + |
172 | "CollisionSound, CollisionSoundVolume, " + | 174 | "CollisionSound, CollisionSoundVolume, " + |
173 | "PassTouches, " + | 175 | "PassTouches, " + |
174 | "LinkNumber, MediaURL) values (" + "?UUID, " + | 176 | "LinkNumber, MediaURL, " + |
177 | "PhysicsShapeType, Density, GravityModifier, " + | ||
178 | "Friction, Restitution, DynAttrs " + | ||
179 | ") values (" + "?UUID, " + | ||
175 | "?CreationDate, ?Name, ?Text, " + | 180 | "?CreationDate, ?Name, ?Text, " + |
176 | "?Description, ?SitName, ?TouchName, " + | 181 | "?Description, ?SitName, ?TouchName, " + |
177 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + | 182 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + |
@@ -202,14 +207,17 @@ namespace OpenSim.Data.MySQL | |||
202 | "?SaleType, ?ColorR, ?ColorG, " + | 207 | "?SaleType, ?ColorR, ?ColorG, " + |
203 | "?ColorB, ?ColorA, ?ParticleSystem, " + | 208 | "?ColorB, ?ColorA, ?ParticleSystem, " + |
204 | "?ClickAction, ?Material, ?CollisionSound, " + | 209 | "?ClickAction, ?Material, ?CollisionSound, " + |
205 | "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, ?MediaURL)"; | 210 | "?CollisionSoundVolume, ?PassTouches, " + |
206 | 211 | "?LinkNumber, ?MediaURL, " + | |
212 | "?PhysicsShapeType, ?Density, ?GravityModifier, " + | ||
213 | "?Friction, ?Restitution, ?DynAttrs)"; | ||
214 | |||
207 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); | 215 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); |
208 | 216 | ||
209 | ExecuteNonQuery(cmd); | 217 | ExecuteNonQuery(cmd); |
210 | 218 | ||
211 | cmd.Parameters.Clear(); | 219 | cmd.Parameters.Clear(); |
212 | 220 | ||
213 | cmd.CommandText = "replace into primshapes (" + | 221 | cmd.CommandText = "replace into primshapes (" + |
214 | "UUID, Shape, ScaleX, ScaleY, " + | 222 | "UUID, Shape, ScaleX, ScaleY, " + |
215 | "ScaleZ, PCode, PathBegin, PathEnd, " + | 223 | "ScaleZ, PCode, PathBegin, PathEnd, " + |
@@ -219,7 +227,8 @@ namespace OpenSim.Data.MySQL | |||
219 | "PathTaperX, PathTaperY, PathTwist, " + | 227 | "PathTaperX, PathTaperY, PathTwist, " + |
220 | "PathTwistBegin, ProfileBegin, ProfileEnd, " + | 228 | "PathTwistBegin, ProfileBegin, ProfileEnd, " + |
221 | "ProfileCurve, ProfileHollow, Texture, " + | 229 | "ProfileCurve, ProfileHollow, Texture, " + |
222 | "ExtraParams, State, Media) values (?UUID, " + | 230 | "ExtraParams, State, Media) " + |
231 | "values (?UUID, " + | ||
223 | "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + | 232 | "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + |
224 | "?PCode, ?PathBegin, ?PathEnd, " + | 233 | "?PCode, ?PathBegin, ?PathEnd, " + |
225 | "?PathScaleX, ?PathScaleY, " + | 234 | "?PathScaleX, ?PathScaleY, " + |
@@ -231,9 +240,9 @@ namespace OpenSim.Data.MySQL | |||
231 | "?ProfileEnd, ?ProfileCurve, " + | 240 | "?ProfileEnd, ?ProfileCurve, " + |
232 | "?ProfileHollow, ?Texture, ?ExtraParams, " + | 241 | "?ProfileHollow, ?Texture, ?ExtraParams, " + |
233 | "?State, ?Media)"; | 242 | "?State, ?Media)"; |
234 | 243 | ||
235 | FillShapeCommand(cmd, prim); | 244 | FillShapeCommand(cmd, prim); |
236 | 245 | ||
237 | ExecuteNonQuery(cmd); | 246 | ExecuteNonQuery(cmd); |
238 | } | 247 | } |
239 | } | 248 | } |
@@ -579,7 +588,7 @@ namespace OpenSim.Data.MySQL | |||
579 | cmd.CommandText = "insert into terrain (RegionUUID, " + | 588 | cmd.CommandText = "insert into terrain (RegionUUID, " + |
580 | "Revision, Heightfield) values (?RegionUUID, " + | 589 | "Revision, Heightfield) values (?RegionUUID, " + |
581 | "1, ?Heightfield)"; | 590 | "1, ?Heightfield)"; |
582 | 591 | ||
583 | cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); | 592 | cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); |
584 | 593 | ||
585 | ExecuteNonQuery(cmd); | 594 | ExecuteNonQuery(cmd); |
@@ -738,7 +747,7 @@ namespace OpenSim.Data.MySQL | |||
738 | { | 747 | { |
739 | //No result, so store our default windlight profile and return it | 748 | //No result, so store our default windlight profile and return it |
740 | nWP.regionID = regionUUID; | 749 | nWP.regionID = regionUUID; |
741 | StoreRegionWindlightSettings(nWP); | 750 | // StoreRegionWindlightSettings(nWP); |
742 | return nWP; | 751 | return nWP; |
743 | } | 752 | } |
744 | else | 753 | else |
@@ -1094,7 +1103,8 @@ namespace OpenSim.Data.MySQL | |||
1094 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + | 1103 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + |
1095 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 1104 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
1096 | "?LoadedCreationDateTime, ?LoadedCreationID, " + | 1105 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
1097 | "?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; | 1106 | "?TerrainImageID, " + |
1107 | "?TelehubObject, ?ParcelImageID)"; | ||
1098 | 1108 | ||
1099 | FillRegionSettingsCommand(cmd, rs); | 1109 | FillRegionSettingsCommand(cmd, rs); |
1100 | 1110 | ||
@@ -1291,7 +1301,18 @@ namespace OpenSim.Data.MySQL | |||
1291 | 1301 | ||
1292 | if (!(row["MediaURL"] is System.DBNull)) | 1302 | if (!(row["MediaURL"] is System.DBNull)) |
1293 | prim.MediaUrl = (string)row["MediaURL"]; | 1303 | prim.MediaUrl = (string)row["MediaURL"]; |
1304 | |||
1305 | if (!(row["DynAttrs"] is System.DBNull)) | ||
1306 | prim.DynAttrs = DAMap.FromXml((string)row["DynAttrs"]); | ||
1307 | else | ||
1308 | prim.DynAttrs = new DAMap(); | ||
1294 | 1309 | ||
1310 | prim.PhysicsShapeType = (byte)Convert.ToInt32(row["PhysicsShapeType"].ToString()); | ||
1311 | prim.Density = (float)(double)row["Density"]; | ||
1312 | prim.GravityModifier = (float)(double)row["GravityModifier"]; | ||
1313 | prim.Friction = (float)(double)row["Friction"]; | ||
1314 | prim.Restitution = (float)(double)row["Restitution"]; | ||
1315 | |||
1295 | return prim; | 1316 | return prim; |
1296 | } | 1317 | } |
1297 | 1318 | ||
@@ -1637,6 +1658,17 @@ namespace OpenSim.Data.MySQL | |||
1637 | 1658 | ||
1638 | cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); | 1659 | cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); |
1639 | cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); | 1660 | cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); |
1661 | |||
1662 | cmd.Parameters.AddWithValue("PhysicsShapeType", prim.PhysicsShapeType); | ||
1663 | cmd.Parameters.AddWithValue("Density", (double)prim.Density); | ||
1664 | cmd.Parameters.AddWithValue("GravityModifier", (double)prim.GravityModifier); | ||
1665 | cmd.Parameters.AddWithValue("Friction", (double)prim.Friction); | ||
1666 | cmd.Parameters.AddWithValue("Restitution", (double)prim.Restitution); | ||
1667 | |||
1668 | if (prim.DynAttrs.Count > 0) | ||
1669 | cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); | ||
1670 | else | ||
1671 | cmd.Parameters.AddWithValue("DynAttrs", null); | ||
1640 | } | 1672 | } |
1641 | 1673 | ||
1642 | /// <summary> | 1674 | /// <summary> |
@@ -1715,6 +1747,7 @@ namespace OpenSim.Data.MySQL | |||
1715 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1747 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1716 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1748 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1717 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | 1749 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); |
1750 | |||
1718 | cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); | 1751 | cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); |
1719 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); | 1752 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); |
1720 | } | 1753 | } |