aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage
diff options
context:
space:
mode:
authorSean Dague2007-08-07 15:45:16 +0000
committerSean Dague2007-08-07 15:45:16 +0000
commite4df1de58b5f267f24f0b30713c1718f30e689f0 (patch)
treea3e4bf7dfb15f17a072a9caef38432005e247f38 /OpenSim/Region/Storage
parentactually get sqlite stuff to compile. This isn't connected to the (diff)
downloadopensim-SC-e4df1de58b5f267f24f0b30713c1718f30e689f0.zip
opensim-SC-e4df1de58b5f267f24f0b30713c1718f30e689f0.tar.gz
opensim-SC-e4df1de58b5f267f24f0b30713c1718f30e689f0.tar.bz2
opensim-SC-e4df1de58b5f267f24f0b30713c1718f30e689f0.tar.xz
actually transfer some data to the row definition. Going to hook
this up to the sim in my env now to make sure we're getting data flow in a reasonable way at this point.
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 }