aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
index c6210f7..91edf5e 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs
@@ -391,6 +391,16 @@ namespace OpenSim.DataStore.MSSQL
391 createCol(prims, "RotationZ", typeof(System.Double)); 391 createCol(prims, "RotationZ", typeof(System.Double));
392 createCol(prims, "RotationW", typeof(System.Double)); 392 createCol(prims, "RotationW", typeof(System.Double));
393 393
394 // sit target
395 createCol(prims, "SitTargetOffsetX", typeof(System.Double));
396 createCol(prims, "SitTargetOffsetY", typeof(System.Double));
397 createCol(prims, "SitTargetOffsetZ", typeof(System.Double));
398
399 createCol(prims, "SitTargetOrientW", typeof(System.Double));
400 createCol(prims, "SitTargetOrientX", typeof(System.Double));
401 createCol(prims, "SitTargetOrientY", typeof(System.Double));
402 createCol(prims, "SitTargetOrientZ", typeof(System.Double));
403
394 // Add in contraints 404 // Add in contraints
395 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] }; 405 prims.PrimaryKey = new DataColumn[] { prims.Columns["UUID"] };
396 406
@@ -508,6 +518,22 @@ namespace OpenSim.DataStore.MSSQL
508 Convert.ToSingle(row["RotationW"]) 518 Convert.ToSingle(row["RotationW"])
509 ); 519 );
510 520
521 try
522 {
523 prim.SetSitTargetLL(new LLVector3(
524 Convert.ToSingle(row["SitTargetOffsetX"]),
525 Convert.ToSingle(row["SitTargetOffsetX"]),
526 Convert.ToSingle(row["SitTargetOffsetZ"])), new LLQuaternion(
527 Convert.ToSingle(row["SitTargetOrientW"]),
528 Convert.ToSingle(row["SitTargetOrientX"]),
529 Convert.ToSingle(row["SitTargetOrientY"]),
530 Convert.ToSingle(row["SitTargetOrientX"])));
531 }
532 catch (System.InvalidCastException)
533 {
534 // Database table was created before we got here and now has null values :P
535 }
536
511 return prim; 537 return prim;
512 } 538 }
513 539
@@ -557,6 +583,26 @@ namespace OpenSim.DataStore.MSSQL
557 row["RotationY"] = prim.RotationOffset.Y; 583 row["RotationY"] = prim.RotationOffset.Y;
558 row["RotationZ"] = prim.RotationOffset.Z; 584 row["RotationZ"] = prim.RotationOffset.Z;
559 row["RotationW"] = prim.RotationOffset.W; 585 row["RotationW"] = prim.RotationOffset.W;
586
587 try
588 {
589 // Sit target
590 LLVector3 sitTargetPos = prim.GetSitTargetPositionLL();
591 row["SitTargetOffsetX"] = sitTargetPos.X;
592 row["SitTargetOffsetY"] = sitTargetPos.Y;
593 row["SitTargetOffsetZ"] = sitTargetPos.Z;
594
595 LLQuaternion sitTargetOrient = prim.GetSitTargetOrientationLL();
596 row["SitTargetOrientW"] = sitTargetOrient.W;
597 row["SitTargetOrientX"] = sitTargetOrient.X;
598 row["SitTargetOrientY"] = sitTargetOrient.Y;
599 row["SitTargetOrientZ"] = sitTargetOrient.Z;
600 }
601 catch (System.Exception)
602 {
603 // TODO: Add Sit Target Rows!
604 }
605
560 } 606 }
561 607
562 private PrimitiveBaseShape buildShape(DataRow row) 608 private PrimitiveBaseShape buildShape(DataRow row)