aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Storage')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.Sqlite/SqliteDataStore.cs24
1 files changed, 21 insertions, 3 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.Sqlite/SqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.Sqlite/SqliteDataStore.cs
index 14b239f..d72cc2d 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.Sqlite/SqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.Sqlite/SqliteDataStore.cs
@@ -56,7 +56,7 @@ namespace OpenSim.DataStore.SqliteStorage
56 56
57 public void StoreObject(AllNewSceneObjectPart2 obj) 57 public void StoreObject(AllNewSceneObjectPart2 obj)
58 { 58 {
59 // TODO: Serializing code 59 // TODO: Serializing code
60 DataTable prims = ds.Tables["prims"]; 60 DataTable prims = ds.Tables["prims"];
61 DataTable shapes = ds.Tables["shapes"]; 61 DataTable shapes = ds.Tables["shapes"];
62 62
@@ -64,16 +64,34 @@ namespace OpenSim.DataStore.SqliteStorage
64 64
65 } 65 }
66 66
67 private void fillPrimRow(DataRow row, Primitive prim)
68 {
69 row["UUID"] = prim.UUID;
70 row["CreationDate"] = prim.CreationDate;
71 row["Name"] = prim.Name;
72 row["PositionX"] = prim.Pos.X;
73 row["PositionY"] = prim.Pos.Y;
74 row["PositionZ"] = prim.Pos.Z;
75 }
76
67 private void addPrim(Primitive prim) 77 private void addPrim(Primitive prim)
68 { 78 {
69 DataTable prims = ds.Tables["prims"]; 79 DataTable prims = ds.Tables["prims"];
70 DataTable shapes = ds.Tables["shapes"]; 80 DataTable shapes = ds.Tables["shapes"];
71 DataRow row; 81
82 DataRow row = prims.Rows.Find(prim.UUID);
83 if (row == null) {
84 row = prims.NewRow();
85 fillPrimRow(row, prim);
86 prims.Rows.Add(row);
87 } else {
88 fillPrimRow(row, prim);
89 }
72 } 90 }
73 91
74 public void StoreObject(SceneObject obj) 92 public void StoreObject(SceneObject obj)
75 { 93 {
76 foreach (Primitive prim in obj.Children.Values) 94 foreach (Primitive prim in obj.Children.Values)
77 { 95 {
78 addPrim(prim); 96 addPrim(prim);
79 } 97 }