diff options
author | Teravus Ovares | 2007-12-27 05:37:48 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-27 05:37:48 +0000 |
commit | cbf5ff4a9371c067dbe36ef28487c8784b9229d2 (patch) | |
tree | a5b16f0cd840374dc475153d77671f1d20f06ac7 /OpenSim/Region/Storage/OpenSim.DataStore.MSSQL | |
parent | * Added osRegionRestart(float secs) to LSL Commands (diff) | |
download | opensim-SC-cbf5ff4a9371c067dbe36ef28487c8784b9229d2.zip opensim-SC-cbf5ff4a9371c067dbe36ef28487c8784b9229d2.tar.gz opensim-SC-cbf5ff4a9371c067dbe36ef28487c8784b9229d2.tar.bz2 opensim-SC-cbf5ff4a9371c067dbe36ef28487c8784b9229d2.tar.xz |
* Added Sit Target persistence over sim restarts for mySQL and MonoSQLite.
* SAVE YOUR PRIM DATA, THIS MAKES CHANGES TO YOUR PRIMS TABLE
* The first time you run OpenSim after updating past this revision, you'll see a lot of Errors. Be calm, shutdown the simulator, and start it again and your prims table will be updated.
* MSSQL added the fields to the Initial CreateTable section, however, you'll need to add the fields to your prims table if you want it to persist.
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MSSQL')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MSSQL/MSSQLDataStore.cs | 46 |
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) |