diff options
Diffstat (limited to 'OpenSim/Data/MySQL/MySQLSimulationData.cs')
-rw-r--r-- | OpenSim/Data/MySQL/MySQLSimulationData.cs | 267 |
1 files changed, 133 insertions, 134 deletions
diff --git a/OpenSim/Data/MySQL/MySQLSimulationData.cs b/OpenSim/Data/MySQL/MySQLSimulationData.cs index 33c184f..89600db 100644 --- a/OpenSim/Data/MySQL/MySQLSimulationData.cs +++ b/OpenSim/Data/MySQL/MySQLSimulationData.cs | |||
@@ -129,119 +129,119 @@ namespace OpenSim.Data.MySQL | |||
129 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 129 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
130 | { | 130 | { |
131 | dbcon.Open(); | 131 | dbcon.Open(); |
132 | MySqlCommand cmd = dbcon.CreateCommand(); | ||
133 | 132 | ||
134 | foreach (SceneObjectPart prim in obj.Parts) | 133 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
135 | { | 134 | { |
136 | cmd.Parameters.Clear(); | 135 | foreach (SceneObjectPart prim in obj.Parts) |
136 | { | ||
137 | cmd.Parameters.Clear(); | ||
137 | 138 | ||
138 | cmd.CommandText = "replace into prims (" + | 139 | cmd.CommandText = "replace into prims (" + |
139 | "UUID, CreationDate, " + | 140 | "UUID, CreationDate, " + |
140 | "Name, Text, Description, " + | 141 | "Name, Text, Description, " + |
141 | "SitName, TouchName, ObjectFlags, " + | 142 | "SitName, TouchName, ObjectFlags, " + |
142 | "OwnerMask, NextOwnerMask, GroupMask, " + | 143 | "OwnerMask, NextOwnerMask, GroupMask, " + |
143 | "EveryoneMask, BaseMask, PositionX, " + | 144 | "EveryoneMask, BaseMask, PositionX, " + |
144 | "PositionY, PositionZ, GroupPositionX, " + | 145 | "PositionY, PositionZ, GroupPositionX, " + |
145 | "GroupPositionY, GroupPositionZ, VelocityX, " + | 146 | "GroupPositionY, GroupPositionZ, VelocityX, " + |
146 | "VelocityY, VelocityZ, AngularVelocityX, " + | 147 | "VelocityY, VelocityZ, AngularVelocityX, " + |
147 | "AngularVelocityY, AngularVelocityZ, " + | 148 | "AngularVelocityY, AngularVelocityZ, " + |
148 | "AccelerationX, AccelerationY, " + | 149 | "AccelerationX, AccelerationY, " + |
149 | "AccelerationZ, RotationX, " + | 150 | "AccelerationZ, RotationX, " + |
150 | "RotationY, RotationZ, " + | 151 | "RotationY, RotationZ, " + |
151 | "RotationW, SitTargetOffsetX, " + | 152 | "RotationW, SitTargetOffsetX, " + |
152 | "SitTargetOffsetY, SitTargetOffsetZ, " + | 153 | "SitTargetOffsetY, SitTargetOffsetZ, " + |
153 | "SitTargetOrientW, SitTargetOrientX, " + | 154 | "SitTargetOrientW, SitTargetOrientX, " + |
154 | "SitTargetOrientY, SitTargetOrientZ, " + | 155 | "SitTargetOrientY, SitTargetOrientZ, " + |
155 | "RegionUUID, CreatorID, " + | 156 | "RegionUUID, CreatorID, " + |
156 | "OwnerID, GroupID, " + | 157 | "OwnerID, GroupID, " + |
157 | "LastOwnerID, SceneGroupID, " + | 158 | "LastOwnerID, SceneGroupID, " + |
158 | "PayPrice, PayButton1, " + | 159 | "PayPrice, PayButton1, " + |
159 | "PayButton2, PayButton3, " + | 160 | "PayButton2, PayButton3, " + |
160 | "PayButton4, LoopedSound, " + | 161 | "PayButton4, LoopedSound, " + |
161 | "LoopedSoundGain, TextureAnimation, " + | 162 | "LoopedSoundGain, TextureAnimation, " + |
162 | "OmegaX, OmegaY, OmegaZ, " + | 163 | "OmegaX, OmegaY, OmegaZ, " + |
163 | "CameraEyeOffsetX, CameraEyeOffsetY, " + | 164 | "CameraEyeOffsetX, CameraEyeOffsetY, " + |
164 | "CameraEyeOffsetZ, CameraAtOffsetX, " + | 165 | "CameraEyeOffsetZ, CameraAtOffsetX, " + |
165 | "CameraAtOffsetY, CameraAtOffsetZ, " + | 166 | "CameraAtOffsetY, CameraAtOffsetZ, " + |
166 | "ForceMouselook, ScriptAccessPin, " + | 167 | "ForceMouselook, ScriptAccessPin, " + |
167 | "AllowedDrop, DieAtEdge, " + | 168 | "AllowedDrop, DieAtEdge, " + |
168 | "SalePrice, SaleType, " + | 169 | "SalePrice, SaleType, " + |
169 | "ColorR, ColorG, ColorB, ColorA, " + | 170 | "ColorR, ColorG, ColorB, ColorA, " + |
170 | "ParticleSystem, ClickAction, Material, " + | 171 | "ParticleSystem, ClickAction, Material, " + |
171 | "CollisionSound, CollisionSoundVolume, " + | 172 | "CollisionSound, CollisionSoundVolume, " + |
172 | "PassTouches, " + | 173 | "PassTouches, " + |
173 | "LinkNumber, MediaURL, KeyframeMotion, " + | 174 | "LinkNumber, MediaURL, KeyframeMotion, " + |
174 | "PhysicsShapeType, Density, GravityModifier, " + | 175 | "PhysicsShapeType, Density, GravityModifier, " + |
175 | "Friction, Restitution) values (" + "?UUID, " + | 176 | "Friction, Restitution) values (" + "?UUID, " + |
176 | "?CreationDate, ?Name, ?Text, " + | 177 | "?CreationDate, ?Name, ?Text, " + |
177 | "?Description, ?SitName, ?TouchName, " + | 178 | "?Description, ?SitName, ?TouchName, " + |
178 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + | 179 | "?ObjectFlags, ?OwnerMask, ?NextOwnerMask, " + |
179 | "?GroupMask, ?EveryoneMask, ?BaseMask, " + | 180 | "?GroupMask, ?EveryoneMask, ?BaseMask, " + |
180 | "?PositionX, ?PositionY, ?PositionZ, " + | 181 | "?PositionX, ?PositionY, ?PositionZ, " + |
181 | "?GroupPositionX, ?GroupPositionY, " + | 182 | "?GroupPositionX, ?GroupPositionY, " + |
182 | "?GroupPositionZ, ?VelocityX, " + | 183 | "?GroupPositionZ, ?VelocityX, " + |
183 | "?VelocityY, ?VelocityZ, ?AngularVelocityX, " + | 184 | "?VelocityY, ?VelocityZ, ?AngularVelocityX, " + |
184 | "?AngularVelocityY, ?AngularVelocityZ, " + | 185 | "?AngularVelocityY, ?AngularVelocityZ, " + |
185 | "?AccelerationX, ?AccelerationY, " + | 186 | "?AccelerationX, ?AccelerationY, " + |
186 | "?AccelerationZ, ?RotationX, " + | 187 | "?AccelerationZ, ?RotationX, " + |
187 | "?RotationY, ?RotationZ, " + | 188 | "?RotationY, ?RotationZ, " + |
188 | "?RotationW, ?SitTargetOffsetX, " + | 189 | "?RotationW, ?SitTargetOffsetX, " + |
189 | "?SitTargetOffsetY, ?SitTargetOffsetZ, " + | 190 | "?SitTargetOffsetY, ?SitTargetOffsetZ, " + |
190 | "?SitTargetOrientW, ?SitTargetOrientX, " + | 191 | "?SitTargetOrientW, ?SitTargetOrientX, " + |
191 | "?SitTargetOrientY, ?SitTargetOrientZ, " + | 192 | "?SitTargetOrientY, ?SitTargetOrientZ, " + |
192 | "?RegionUUID, ?CreatorID, ?OwnerID, " + | 193 | "?RegionUUID, ?CreatorID, ?OwnerID, " + |
193 | "?GroupID, ?LastOwnerID, ?SceneGroupID, " + | 194 | "?GroupID, ?LastOwnerID, ?SceneGroupID, " + |
194 | "?PayPrice, ?PayButton1, ?PayButton2, " + | 195 | "?PayPrice, ?PayButton1, ?PayButton2, " + |
195 | "?PayButton3, ?PayButton4, ?LoopedSound, " + | 196 | "?PayButton3, ?PayButton4, ?LoopedSound, " + |
196 | "?LoopedSoundGain, ?TextureAnimation, " + | 197 | "?LoopedSoundGain, ?TextureAnimation, " + |
197 | "?OmegaX, ?OmegaY, ?OmegaZ, " + | 198 | "?OmegaX, ?OmegaY, ?OmegaZ, " + |
198 | "?CameraEyeOffsetX, ?CameraEyeOffsetY, " + | 199 | "?CameraEyeOffsetX, ?CameraEyeOffsetY, " + |
199 | "?CameraEyeOffsetZ, ?CameraAtOffsetX, " + | 200 | "?CameraEyeOffsetZ, ?CameraAtOffsetX, " + |
200 | "?CameraAtOffsetY, ?CameraAtOffsetZ, " + | 201 | "?CameraAtOffsetY, ?CameraAtOffsetZ, " + |
201 | "?ForceMouselook, ?ScriptAccessPin, " + | 202 | "?ForceMouselook, ?ScriptAccessPin, " + |
202 | "?AllowedDrop, ?DieAtEdge, ?SalePrice, " + | 203 | "?AllowedDrop, ?DieAtEdge, ?SalePrice, " + |
203 | "?SaleType, ?ColorR, ?ColorG, " + | 204 | "?SaleType, ?ColorR, ?ColorG, " + |
204 | "?ColorB, ?ColorA, ?ParticleSystem, " + | 205 | "?ColorB, ?ColorA, ?ParticleSystem, " + |
205 | "?ClickAction, ?Material, ?CollisionSound, " + | 206 | "?ClickAction, ?Material, ?CollisionSound, " + |
206 | "?CollisionSoundVolume, ?PassTouches, " + | 207 | "?CollisionSoundVolume, ?PassTouches, " + |
207 | "?LinkNumber, ?MediaURL, ?KeyframeMotion, " + | 208 | "?LinkNumber, ?MediaURL, ?KeyframeMotion, " + |
208 | "?PhysicsShapeType, ?Density, ?GravityModifier, " + | 209 | "?PhysicsShapeType, ?Density, ?GravityModifier, " + |
209 | "?Friction, ?Restitution)"; | 210 | "?Friction, ?Restitution)"; |
210 | 211 | ||
211 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); | 212 | FillPrimCommand(cmd, prim, obj.UUID, regionUUID); |
212 | 213 | ||
213 | ExecuteNonQuery(cmd); | 214 | ExecuteNonQuery(cmd); |
214 | 215 | ||
215 | cmd.Parameters.Clear(); | 216 | cmd.Parameters.Clear(); |
216 | 217 | ||
217 | cmd.CommandText = "replace into primshapes (" + | 218 | cmd.CommandText = "replace into primshapes (" + |
218 | "UUID, Shape, ScaleX, ScaleY, " + | 219 | "UUID, Shape, ScaleX, ScaleY, " + |
219 | "ScaleZ, PCode, PathBegin, PathEnd, " + | 220 | "ScaleZ, PCode, PathBegin, PathEnd, " + |
220 | "PathScaleX, PathScaleY, PathShearX, " + | 221 | "PathScaleX, PathScaleY, PathShearX, " + |
221 | "PathShearY, PathSkew, PathCurve, " + | 222 | "PathShearY, PathSkew, PathCurve, " + |
222 | "PathRadiusOffset, PathRevolutions, " + | 223 | "PathRadiusOffset, PathRevolutions, " + |
223 | "PathTaperX, PathTaperY, PathTwist, " + | 224 | "PathTaperX, PathTaperY, PathTwist, " + |
224 | "PathTwistBegin, ProfileBegin, ProfileEnd, " + | 225 | "PathTwistBegin, ProfileBegin, ProfileEnd, " + |
225 | "ProfileCurve, ProfileHollow, Texture, " + | 226 | "ProfileCurve, ProfileHollow, Texture, " + |
226 | "ExtraParams, State, Media) values (?UUID, " + | 227 | "ExtraParams, State, Media) values (?UUID, " + |
227 | "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + | 228 | "?Shape, ?ScaleX, ?ScaleY, ?ScaleZ, " + |
228 | "?PCode, ?PathBegin, ?PathEnd, " + | 229 | "?PCode, ?PathBegin, ?PathEnd, " + |
229 | "?PathScaleX, ?PathScaleY, " + | 230 | "?PathScaleX, ?PathScaleY, " + |
230 | "?PathShearX, ?PathShearY, " + | 231 | "?PathShearX, ?PathShearY, " + |
231 | "?PathSkew, ?PathCurve, ?PathRadiusOffset, " + | 232 | "?PathSkew, ?PathCurve, ?PathRadiusOffset, " + |
232 | "?PathRevolutions, ?PathTaperX, " + | 233 | "?PathRevolutions, ?PathTaperX, " + |
233 | "?PathTaperY, ?PathTwist, " + | 234 | "?PathTaperY, ?PathTwist, " + |
234 | "?PathTwistBegin, ?ProfileBegin, " + | 235 | "?PathTwistBegin, ?ProfileBegin, " + |
235 | "?ProfileEnd, ?ProfileCurve, " + | 236 | "?ProfileEnd, ?ProfileCurve, " + |
236 | "?ProfileHollow, ?Texture, ?ExtraParams, " + | 237 | "?ProfileHollow, ?Texture, ?ExtraParams, " + |
237 | "?State, ?Media)"; | 238 | "?State, ?Media)"; |
238 | 239 | ||
239 | FillShapeCommand(cmd, prim); | 240 | FillShapeCommand(cmd, prim); |
240 | 241 | ||
241 | ExecuteNonQuery(cmd); | 242 | ExecuteNonQuery(cmd); |
243 | } | ||
242 | } | 244 | } |
243 | |||
244 | cmd.Dispose(); | ||
245 | } | 245 | } |
246 | } | 246 | } |
247 | } | 247 | } |
@@ -1865,41 +1865,40 @@ namespace OpenSim.Data.MySQL | |||
1865 | { | 1865 | { |
1866 | RemoveItems(primID); | 1866 | RemoveItems(primID); |
1867 | 1867 | ||
1868 | if (items.Count == 0) | ||
1869 | return; | ||
1870 | |||
1868 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) | 1871 | using (MySqlConnection dbcon = new MySqlConnection(m_connectionString)) |
1869 | { | 1872 | { |
1870 | dbcon.Open(); | 1873 | dbcon.Open(); |
1871 | 1874 | ||
1872 | MySqlCommand cmd = dbcon.CreateCommand(); | 1875 | using (MySqlCommand cmd = dbcon.CreateCommand()) |
1873 | |||
1874 | if (items.Count == 0) | ||
1875 | return; | ||
1876 | |||
1877 | cmd.CommandText = "insert into primitems (" + | ||
1878 | "invType, assetType, name, " + | ||
1879 | "description, creationDate, nextPermissions, " + | ||
1880 | "currentPermissions, basePermissions, " + | ||
1881 | "everyonePermissions, groupPermissions, " + | ||
1882 | "flags, itemID, primID, assetID, " + | ||
1883 | "parentFolderID, creatorID, ownerID, " + | ||
1884 | "groupID, lastOwnerID) values (?invType, " + | ||
1885 | "?assetType, ?name, ?description, " + | ||
1886 | "?creationDate, ?nextPermissions, " + | ||
1887 | "?currentPermissions, ?basePermissions, " + | ||
1888 | "?everyonePermissions, ?groupPermissions, " + | ||
1889 | "?flags, ?itemID, ?primID, ?assetID, " + | ||
1890 | "?parentFolderID, ?creatorID, ?ownerID, " + | ||
1891 | "?groupID, ?lastOwnerID)"; | ||
1892 | |||
1893 | foreach (TaskInventoryItem item in items) | ||
1894 | { | 1876 | { |
1895 | cmd.Parameters.Clear(); | 1877 | cmd.CommandText = "insert into primitems (" + |
1896 | 1878 | "invType, assetType, name, " + | |
1897 | FillItemCommand(cmd, item); | 1879 | "description, creationDate, nextPermissions, " + |
1898 | 1880 | "currentPermissions, basePermissions, " + | |
1899 | ExecuteNonQuery(cmd); | 1881 | "everyonePermissions, groupPermissions, " + |
1882 | "flags, itemID, primID, assetID, " + | ||
1883 | "parentFolderID, creatorID, ownerID, " + | ||
1884 | "groupID, lastOwnerID) values (?invType, " + | ||
1885 | "?assetType, ?name, ?description, " + | ||
1886 | "?creationDate, ?nextPermissions, " + | ||
1887 | "?currentPermissions, ?basePermissions, " + | ||
1888 | "?everyonePermissions, ?groupPermissions, " + | ||
1889 | "?flags, ?itemID, ?primID, ?assetID, " + | ||
1890 | "?parentFolderID, ?creatorID, ?ownerID, " + | ||
1891 | "?groupID, ?lastOwnerID)"; | ||
1892 | |||
1893 | foreach (TaskInventoryItem item in items) | ||
1894 | { | ||
1895 | cmd.Parameters.Clear(); | ||
1896 | |||
1897 | FillItemCommand(cmd, item); | ||
1898 | |||
1899 | ExecuteNonQuery(cmd); | ||
1900 | } | ||
1900 | } | 1901 | } |
1901 | |||
1902 | cmd.Dispose(); | ||
1903 | } | 1902 | } |
1904 | } | 1903 | } |
1905 | } | 1904 | } |