diff options
Added a new column (SceneGroupID) to sqlite3 table (sqlite3-prims.sql) so that we can tell what prims belong to the same SceneObjectGroup. If sdague has a different method in mind when he gets back then he can change it then.
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 45b19e6..5d1592c 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -81,6 +81,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
81 | data.Add("ParentID", DbType.Int32); | 81 | data.Add("ParentID", DbType.Int32); |
82 | data.Add("CreationDate", DbType.Int32); | 82 | data.Add("CreationDate", DbType.Int32); |
83 | data.Add("Name", DbType.String); | 83 | data.Add("Name", DbType.String); |
84 | data.Add("SceneGroupID", DbType.String); | ||
84 | // various text fields | 85 | // various text fields |
85 | data.Add("Text", DbType.String); | 86 | data.Add("Text", DbType.String); |
86 | data.Add("Description", DbType.String); | 87 | data.Add("Description", DbType.String); |
@@ -305,12 +306,14 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
305 | return prim; | 306 | return prim; |
306 | } | 307 | } |
307 | 308 | ||
308 | private void fillPrimRow(DataRow row, SceneObjectPart prim) | 309 | private void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID) |
309 | { | 310 | { |
311 | Console.WriteLine("scene Group for this prim is " + sceneGroupID); | ||
310 | row["UUID"] = prim.UUID; | 312 | row["UUID"] = prim.UUID; |
311 | row["ParentID"] = prim.ParentID; | 313 | row["ParentID"] = prim.ParentID; |
312 | row["CreationDate"] = prim.CreationDate; | 314 | row["CreationDate"] = prim.CreationDate; |
313 | row["Name"] = prim.PartName; | 315 | row["Name"] = prim.PartName; |
316 | row["SceneGroupID"] = sceneGroupID; // the UUID of the root part for this SceneObjectGroup | ||
314 | // various text fields | 317 | // various text fields |
315 | row["Text"] = prim.Text; | 318 | row["Text"] = prim.Text; |
316 | row["Description"] = prim.Description; | 319 | row["Description"] = prim.Description; |
@@ -434,7 +437,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
434 | 437 | ||
435 | } | 438 | } |
436 | 439 | ||
437 | private void addPrim(SceneObjectPart prim) | 440 | private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID) |
438 | { | 441 | { |
439 | DataTable prims = ds.Tables["prims"]; | 442 | DataTable prims = ds.Tables["prims"]; |
440 | DataTable shapes = ds.Tables["primshapes"]; | 443 | DataTable shapes = ds.Tables["primshapes"]; |
@@ -442,10 +445,10 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
442 | DataRow primRow = prims.Rows.Find(prim.UUID); | 445 | DataRow primRow = prims.Rows.Find(prim.UUID); |
443 | if (primRow == null) { | 446 | if (primRow == null) { |
444 | primRow = prims.NewRow(); | 447 | primRow = prims.NewRow(); |
445 | fillPrimRow(primRow, prim); | 448 | fillPrimRow(primRow, prim, sceneGroupID); |
446 | prims.Rows.Add(primRow); | 449 | prims.Rows.Add(primRow); |
447 | } else { | 450 | } else { |
448 | fillPrimRow(primRow, prim); | 451 | fillPrimRow(primRow, prim, sceneGroupID); |
449 | } | 452 | } |
450 | 453 | ||
451 | DataRow shapeRow = shapes.Rows.Find(prim.UUID); | 454 | DataRow shapeRow = shapes.Rows.Find(prim.UUID); |
@@ -462,7 +465,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
462 | { | 465 | { |
463 | foreach (SceneObjectPart prim in obj.Children.Values) | 466 | foreach (SceneObjectPart prim in obj.Children.Values) |
464 | { | 467 | { |
465 | addPrim(prim); | 468 | addPrim(prim, obj.UUID); |
466 | } | 469 | } |
467 | 470 | ||
468 | MainLog.Instance.Verbose("Attempting to do database update...."); | 471 | MainLog.Instance.Verbose("Attempting to do database update...."); |