aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie Thielker2008-10-18 13:04:35 +0000
committerMelanie Thielker2008-10-18 13:04:35 +0000
commitc3ba97c80a7ad2811b510b727b9e2b38761c9ae6 (patch)
tree1c164053dea9bd35f898ac9447e52d0131fa1f06
parentFix thingd so that autoreturn also works when the user is not in the sim. (diff)
downloadopensim-SC-c3ba97c80a7ad2811b510b727b9e2b38761c9ae6.zip
opensim-SC-c3ba97c80a7ad2811b510b727b9e2b38761c9ae6.tar.gz
opensim-SC-c3ba97c80a7ad2811b510b727b9e2b38761c9ae6.tar.bz2
opensim-SC-c3ba97c80a7ad2811b510b727b9e2b38761c9ae6.tar.xz
Thank you, Strawberry Fride, for a patch that brings MSSQL even with MySQL
-rw-r--r--OpenSim/Data/MSSQL/MSSQLRegionData.cs66
1 files changed, 35 insertions, 31 deletions
diff --git a/OpenSim/Data/MSSQL/MSSQLRegionData.cs b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
index 058c9de..4a01ca0 100644
--- a/OpenSim/Data/MSSQL/MSSQLRegionData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLRegionData.cs
@@ -157,11 +157,11 @@ namespace OpenSim.Data.MSSQL
157 157
158 //After this we have a empty fully configured DataSet. 158 //After this we have a empty fully configured DataSet.
159 } 159 }
160 160
161 /// <summary> 161 /// <summary>
162 /// Dispose the database 162 /// Dispose the database
163 /// </summary> 163 /// </summary>
164 public void Dispose() {} 164 public void Dispose() { }
165 165
166 /// <summary> 166 /// <summary>
167 /// Loads the objects present in the region. 167 /// Loads the objects present in the region.
@@ -344,35 +344,34 @@ namespace OpenSim.Data.MSSQL
344 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0 344 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.Temporary) == 0
345 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0) 345 && (prim.GetEffectiveObjectFlags() & (uint)PrimFlags.TemporaryOnRez) == 0)
346 { 346 {
347 lock (_PrimsDataSet)
348 {
349 DataTable prims = _PrimsDataSet.Tables["prims"];
350 DataTable shapes = _PrimsDataSet.Tables["primshapes"];
351 347
352 DataRow primRow = prims.Rows.Find(prim.UUID.ToString()); 348 DataTable prims = _PrimsDataSet.Tables["prims"];
353 if (primRow == null) 349 DataTable shapes = _PrimsDataSet.Tables["primshapes"];
354 {
355 primRow = prims.NewRow();
356 fillPrimRow(primRow, prim, obj.UUID, regionUUID);
357 prims.Rows.Add(primRow);
358 }
359 else
360 {
361 fillPrimRow(primRow, prim, obj.UUID, regionUUID);
362 }
363 350
364 DataRow shapeRow = shapes.Rows.Find(prim.UUID.ToString()); 351 DataRow primRow = prims.Rows.Find(prim.UUID.ToString());
365 if (shapeRow == null) 352 if (primRow == null)
366 { 353 {
367 shapeRow = shapes.NewRow(); 354 primRow = prims.NewRow();
368 fillShapeRow(shapeRow, prim); 355 fillPrimRow(primRow, prim, obj.UUID, regionUUID);
369 shapes.Rows.Add(shapeRow); 356 prims.Rows.Add(primRow);
370 }
371 else
372 {
373 fillShapeRow(shapeRow, prim);
374 }
375 } 357 }
358 else
359 {
360 fillPrimRow(primRow, prim, obj.UUID, regionUUID);
361 }
362
363 DataRow shapeRow = shapes.Rows.Find(prim.UUID.ToString());
364 if (shapeRow == null)
365 {
366 shapeRow = shapes.NewRow();
367 fillShapeRow(shapeRow, prim);
368 shapes.Rows.Add(shapeRow);
369 }
370 else
371 {
372 fillShapeRow(shapeRow, prim);
373 }
374
376 } 375 }
377 } 376 }
378 377
@@ -582,9 +581,9 @@ namespace OpenSim.Data.MSSQL
582 581
583 //Insert new values 582 //Insert new values
584 string sql = @"INSERT INTO [land] 583 string sql = @"INSERT INTO [land]
585([UUID],[RegionUUID],[LocalLandID],[Bitmap],[Name],[Description],[OwnerUUID],[IsGroupOwned],[Area],[AuctionID],[Category],[ClaimDate],[ClaimPrice],[GroupUUID],[SalePrice],[LandStatus],[LandFlags],[LandingType],[MediaAutoScale],[MediaTextureUUID],[MediaURL],[MusicURL],[PassHours],[PassPrice],[SnapshotUUID],[UserLocationX],[UserLocationY],[UserLocationZ],[UserLookAtX],[UserLookAtY],[UserLookAtZ],[AuthbuyerID]) 584([UUID],[RegionUUID],[LocalLandID],[Bitmap],[Name],[Description],[OwnerUUID],[IsGroupOwned],[Area],[AuctionID],[Category],[ClaimDate],[ClaimPrice],[GroupUUID],[SalePrice],[LandStatus],[LandFlags],[LandingType],[MediaAutoScale],[MediaTextureUUID],[MediaURL],[MusicURL],[PassHours],[PassPrice],[SnapshotUUID],[UserLocationX],[UserLocationY],[UserLocationZ],[UserLookAtX],[UserLookAtY],[UserLookAtZ],[AuthbuyerID],[OtherCleanTime],[Dwell])
586VALUES 585VALUES
587(@UUID,@RegionUUID,@LocalLandID,@Bitmap,@Name,@Description,@OwnerUUID,@IsGroupOwned,@Area,@AuctionID,@Category,@ClaimDate,@ClaimPrice,@GroupUUID,@SalePrice,@LandStatus,@LandFlags,@LandingType,@MediaAutoScale,@MediaTextureUUID,@MediaURL,@MusicURL,@PassHours,@PassPrice,@SnapshotUUID,@UserLocationX,@UserLocationY,@UserLocationZ,@UserLookAtX,@UserLookAtY,@UserLookAtZ,@AuthbuyerID)"; 586(@UUID,@RegionUUID,@LocalLandID,@Bitmap,@Name,@Description,@OwnerUUID,@IsGroupOwned,@Area,@AuctionID,@Category,@ClaimDate,@ClaimPrice,@GroupUUID,@SalePrice,@LandStatus,@LandFlags,@LandingType,@MediaAutoScale,@MediaTextureUUID,@MediaURL,@MusicURL,@PassHours,@PassPrice,@SnapshotUUID,@UserLocationX,@UserLocationY,@UserLocationZ,@UserLookAtX,@UserLookAtY,@UserLookAtZ,@AuthbuyerID,@OtherCleanTime,@Dwell)";
588 587
589 using (AutoClosingSqlCommand cmd = _Database.Query(sql)) 588 using (AutoClosingSqlCommand cmd = _Database.Query(sql))
590 { 589 {
@@ -881,6 +880,9 @@ VALUES
881 if (UUID.TryParse((string)row["SnapshotUUID"], out snapshotID)) 880 if (UUID.TryParse((string)row["SnapshotUUID"], out snapshotID))
882 newData.SnapshotID = snapshotID; 881 newData.SnapshotID = snapshotID;
883 882
883 newData.OtherCleanTime = Convert.ToInt32(row["OtherCleanTime"]);
884 newData.Dwell = Convert.ToInt32(row["Dwell"]);
885
884 try 886 try
885 { 887 {
886 newData.UserLocation = 888 newData.UserLocation =
@@ -1226,7 +1228,7 @@ VALUES
1226 /// <returns></returns> 1228 /// <returns></returns>
1227 private SqlParameter[] CreateLandParameters(LandData land, UUID regionUUID) 1229 private SqlParameter[] CreateLandParameters(LandData land, UUID regionUUID)
1228 { 1230 {
1229 SqlParameter[] parameters = new SqlParameter[32]; 1231 SqlParameter[] parameters = new SqlParameter[34];
1230 1232
1231 parameters[0] = _Database.CreateParameter("UUID", land.GlobalID); 1233 parameters[0] = _Database.CreateParameter("UUID", land.GlobalID);
1232 parameters[1] = _Database.CreateParameter("RegionUUID", regionUUID); 1234 parameters[1] = _Database.CreateParameter("RegionUUID", regionUUID);
@@ -1263,6 +1265,8 @@ VALUES
1263 parameters[29] = _Database.CreateParameter("UserLookAtY", land.UserLookAt.Y); 1265 parameters[29] = _Database.CreateParameter("UserLookAtY", land.UserLookAt.Y);
1264 parameters[30] = _Database.CreateParameter("UserLookAtZ", land.UserLookAt.Z); 1266 parameters[30] = _Database.CreateParameter("UserLookAtZ", land.UserLookAt.Z);
1265 parameters[31] = _Database.CreateParameter("AuthBuyerID", land.AuthBuyerID); 1267 parameters[31] = _Database.CreateParameter("AuthBuyerID", land.AuthBuyerID);
1268 parameters[32] = _Database.CreateParameter("OtherCleanTime", land.OtherCleanTime);
1269 parameters[33] = _Database.CreateParameter("Dwell", land.Dwell);
1266 1270
1267 return parameters; 1271 return parameters;
1268 } 1272 }