diff options
author | Dan Lake | 2013-02-06 16:45:47 -0800 |
---|---|---|
committer | Dan Lake | 2013-02-06 16:45:47 -0800 |
commit | 7590ebc934477d0c410cae1bbc40664453d57001 (patch) | |
tree | abcb69bf2b26d23454a37af8609711376b6f1dee /OpenSim/Data/MySQL | |
parent | WebStats will now use actual logfile as specified in OpenSim.exe.config rathe... (diff) | |
parent | minor: add method doc to DAMap.ValidateKey() (diff) | |
download | opensim-SC_OLD-7590ebc934477d0c410cae1bbc40664453d57001.zip opensim-SC_OLD-7590ebc934477d0c410cae1bbc40664453d57001.tar.gz opensim-SC_OLD-7590ebc934477d0c410cae1bbc40664453d57001.tar.bz2 opensim-SC_OLD-7590ebc934477d0c410cae1bbc40664453d57001.tar.xz |
Merge branch 'master' of git://opensimulator.org/git/opensim
Diffstat (limited to 'OpenSim/Data/MySQL')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 54 | ||||
-rw-r--r-- | OpenSim/Data/MySQL/Resources/RegionStore.migrations | 13 |
2 files changed, 50 insertions, 17 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index c95311e..41174f4 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,8 +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, DynAttrs) " + | 176 | "LinkNumber, MediaURL, " + |
175 | "values (?UUID, " + | 177 | "PhysicsShapeType, Density, GravityModifier, " + |
178 | "Friction, Restitution, DynAttrs " + | ||
179 | ") values (" + "?UUID, " + | ||
176 | "?CreationDate, ?Name, ?Text, " + | 180 | "?CreationDate, ?Name, ?Text, " + |
177 | "?Description, ?SitName, ?TouchName, " + | 181 | "?Description, ?SitName, ?TouchName, " + |
178 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + | 182 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + |
@@ -203,15 +207,17 @@ namespace OpenSim.Data.MySQL | |||
203 | "?SaleType, ?ColorR, ?ColorG, " + | 207 | "?SaleType, ?ColorR, ?ColorG, " + |
204 | "?ColorB, ?ColorA, ?ParticleSystem, " + | 208 | "?ColorB, ?ColorA, ?ParticleSystem, " + |
205 | "?ClickAction, ?Material, ?CollisionSound, " + | 209 | "?ClickAction, ?Material, ?CollisionSound, " + |
206 | "?CollisionSoundVolume, ?PassTouches, ?LinkNumber, " + | 210 | "?CollisionSoundVolume, ?PassTouches, " + |
207 | "?MediaURL, ?DynAttrs)"; | 211 | "?LinkNumber, ?MediaURL, " + |
208 | 212 | "?PhysicsShapeType, ?Density, ?GravityModifier, " + | |
213 | "?Friction, ?Restitution, ?DynAttrs)"; | ||
214 | |||
209 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); | 215 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); |
210 | 216 | ||
211 | ExecuteNonQuery(cmd); | 217 | ExecuteNonQuery(cmd); |
212 | 218 | ||
213 | cmd.Parameters.Clear(); | 219 | cmd.Parameters.Clear(); |
214 | 220 | ||
215 | cmd.CommandText = "replace into primshapes (" + | 221 | cmd.CommandText = "replace into primshapes (" + |
216 | "UUID, Shape, ScaleX, ScaleY, " + | 222 | "UUID, Shape, ScaleX, ScaleY, " + |
217 | "ScaleZ, PCode, PathBegin, PathEnd, " + | 223 | "ScaleZ, PCode, PathBegin, PathEnd, " + |
@@ -234,9 +240,9 @@ namespace OpenSim.Data.MySQL | |||
234 | "?ProfileEnd, ?ProfileCurve, " + | 240 | "?ProfileEnd, ?ProfileCurve, " + |
235 | "?ProfileHollow, ?Texture, ?ExtraParams, " + | 241 | "?ProfileHollow, ?Texture, ?ExtraParams, " + |
236 | "?State, ?Media)"; | 242 | "?State, ?Media)"; |
237 | 243 | ||
238 | FillShapeCommand(cmd, prim); | 244 | FillShapeCommand(cmd, prim); |
239 | 245 | ||
240 | ExecuteNonQuery(cmd); | 246 | ExecuteNonQuery(cmd); |
241 | } | 247 | } |
242 | } | 248 | } |
@@ -582,7 +588,7 @@ namespace OpenSim.Data.MySQL | |||
582 | cmd.CommandText = "insert into terrain (RegionUUID, " + | 588 | cmd.CommandText = "insert into terrain (RegionUUID, " + |
583 | "Revision, Heightfield) values (?RegionUUID, " + | 589 | "Revision, Heightfield) values (?RegionUUID, " + |
584 | "1, ?Heightfield)"; | 590 | "1, ?Heightfield)"; |
585 | 591 | ||
586 | cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); | 592 | cmd.Parameters.AddWithValue("Heightfield", SerializeTerrain(ter)); |
587 | 593 | ||
588 | ExecuteNonQuery(cmd); | 594 | ExecuteNonQuery(cmd); |
@@ -741,7 +747,7 @@ namespace OpenSim.Data.MySQL | |||
741 | { | 747 | { |
742 | //No result, so store our default windlight profile and return it | 748 | //No result, so store our default windlight profile and return it |
743 | nWP.regionID = regionUUID; | 749 | nWP.regionID = regionUUID; |
744 | StoreRegionWindlightSettings(nWP); | 750 | // StoreRegionWindlightSettings(nWP); |
745 | return nWP; | 751 | return nWP; |
746 | } | 752 | } |
747 | else | 753 | else |
@@ -1097,7 +1103,8 @@ namespace OpenSim.Data.MySQL | |||
1097 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + | 1103 | "?SunPosition, ?Covenant, ?CovenantChangedDateTime, ?Sandbox, " + |
1098 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + | 1104 | "?SunVectorX, ?SunVectorY, ?SunVectorZ, " + |
1099 | "?LoadedCreationDateTime, ?LoadedCreationID, " + | 1105 | "?LoadedCreationDateTime, ?LoadedCreationID, " + |
1100 | "?TerrainImageID, ?TelehubObject, ?ParcelImageID) "; | 1106 | "?TerrainImageID, " + |
1107 | "?TelehubObject, ?ParcelImageID)"; | ||
1101 | 1108 | ||
1102 | FillRegionSettingsCommand(cmd, rs); | 1109 | FillRegionSettingsCommand(cmd, rs); |
1103 | 1110 | ||
@@ -1300,6 +1307,12 @@ namespace OpenSim.Data.MySQL | |||
1300 | else | 1307 | else |
1301 | prim.DynAttrs = new DAMap(); | 1308 | prim.DynAttrs = new DAMap(); |
1302 | 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.Bounciness = (float)(double)row["Restitution"]; | ||
1315 | |||
1303 | return prim; | 1316 | return prim; |
1304 | } | 1317 | } |
1305 | 1318 | ||
@@ -1646,6 +1659,12 @@ namespace OpenSim.Data.MySQL | |||
1646 | cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); | 1659 | cmd.Parameters.AddWithValue("LinkNumber", prim.LinkNum); |
1647 | cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); | 1660 | cmd.Parameters.AddWithValue("MediaURL", prim.MediaUrl); |
1648 | 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.Bounciness); | ||
1667 | |||
1649 | if (prim.DynAttrs.Count > 0) | 1668 | if (prim.DynAttrs.Count > 0) |
1650 | cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); | 1669 | cmd.Parameters.AddWithValue("DynAttrs", prim.DynAttrs.ToXml()); |
1651 | else | 1670 | else |
@@ -1728,6 +1747,7 @@ namespace OpenSim.Data.MySQL | |||
1728 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); | 1747 | cmd.Parameters.AddWithValue("LoadedCreationDateTime", settings.LoadedCreationDateTime); |
1729 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); | 1748 | cmd.Parameters.AddWithValue("LoadedCreationID", settings.LoadedCreationID); |
1730 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); | 1749 | cmd.Parameters.AddWithValue("TerrainImageID", settings.TerrainImageID); |
1750 | |||
1731 | cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); | 1751 | cmd.Parameters.AddWithValue("ParcelImageID", settings.ParcelImageID); |
1732 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); | 1752 | cmd.Parameters.AddWithValue("TelehubObject", settings.TelehubObject); |
1733 | } | 1753 | } |
diff --git a/OpenSim/Data/MySQL/Resources/RegionStore.migrations b/OpenSim/Data/MySQL/Resources/RegionStore.migrations index c48aec2..48cd60b 100644 --- a/OpenSim/Data/MySQL/Resources/RegionStore.migrations +++ b/OpenSim/Data/MySQL/Resources/RegionStore.migrations | |||
@@ -910,3 +910,16 @@ BEGIN; | |||
910 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; | 910 | ALTER TABLE prims ADD COLUMN DynAttrs TEXT; |
911 | 911 | ||
912 | COMMIT; | 912 | COMMIT; |
913 | |||
914 | :VERSION 47 #---------------- Extra prim params | ||
915 | |||
916 | BEGIN; | ||
917 | |||
918 | ALTER TABLE prims ADD COLUMN `PhysicsShapeType` tinyint(4) NOT NULL default '0'; | ||
919 | ALTER TABLE prims ADD COLUMN `Density` double NOT NULL default '1000'; | ||
920 | ALTER TABLE prims ADD COLUMN `GravityModifier` double NOT NULL default '1'; | ||
921 | ALTER TABLE prims ADD COLUMN `Friction` double NOT NULL default '0.6'; | ||
922 | ALTER TABLE prims ADD COLUMN `Restitution` double NOT NULL default '0.5'; | ||
923 | |||
924 | COMMIT; | ||
925 | |||