aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage
diff options
context:
space:
mode:
authorSean Dague2007-08-09 18:37:55 +0000
committerSean Dague2007-08-09 18:37:55 +0000
commite53afe91abf6340d733e0f7834a713c2270391be (patch)
tree5677477f0a340ac961867d41fe491d0ca81bbb5a /OpenSim/Region/Storage
parentRemoved spaces from directory names (diff)
downloadopensim-SC-e53afe91abf6340d733e0f7834a713c2270391be.zip
opensim-SC-e53afe91abf6340d733e0f7834a713c2270391be.tar.gz
opensim-SC-e53afe91abf6340d733e0f7834a713c2270391be.tar.bz2
opensim-SC-e53afe91abf6340d733e0f7834a713c2270391be.tar.xz
prim object -> prims table code
Diffstat (limited to 'OpenSim/Region/Storage')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs59
1 files changed, 52 insertions, 7 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index 6400d29..7de9232 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -7,12 +7,12 @@ using OpenSim.Region.Environment.LandManagement;
7using OpenSim.Region.Environment; 7using OpenSim.Region.Environment;
8using OpenSim.Region.Interfaces; 8using OpenSim.Region.Interfaces;
9using OpenSim.Framework.Console; 9using OpenSim.Framework.Console;
10using OpenSim.Framework.Types;
10using libsecondlife; 11using libsecondlife;
11 12
12using System.Data; 13using System.Data;
13// Yes, this won't compile on MS, need to deal with that later 14// Yes, this won't compile on MS, need to deal with that later
14using Mono.Data.SqliteClient; 15using Mono.Data.SqliteClient;
15using Primitive = OpenSim.Region.Environment.Scenes.Primitive;
16 16
17namespace OpenSim.DataStore.MonoSqliteStorage 17namespace OpenSim.DataStore.MonoSqliteStorage
18{ 18{
@@ -233,11 +233,47 @@ namespace OpenSim.DataStore.MonoSqliteStorage
233 private void fillPrimRow(DataRow row, SceneObjectPart prim) 233 private void fillPrimRow(DataRow row, SceneObjectPart prim)
234 { 234 {
235 row["UUID"] = prim.UUID; 235 row["UUID"] = prim.UUID;
236 row["ParentID"] = prim.ParentID;
236 row["CreationDate"] = prim.CreationDate; 237 row["CreationDate"] = prim.CreationDate;
237 row["Name"] = prim.PartName; 238 row["Name"] = prim.PartName;
239 // various text fields
240 row["Text"] = prim.Text;
241 row["Description"] = prim.Description;
242 row["SitName"] = prim.SitName;
243 row["TouchName"] = prim.TouchName;
244 // permissions
245 row["CreatorID"] = prim.CreatorID;
246 row["OwnerID"] = prim.OwnerID;
247 row["GroupID"] = prim.GroupID;
248 row["LastOwnerID"] = prim.LastOwnerID;
249 row["OwnerMask"] = prim.OwnerMask;
250 row["NextOwnerMask"] = prim.NextOwnerMask;
251 row["GroupMask"] = prim.GroupMask;
252 row["EveryoneMask"] = prim.EveryoneMask;
253 row["BaseMask"] = prim.BaseMask;
254 // vectors
238 row["PositionX"] = prim.OffsetPosition.X; 255 row["PositionX"] = prim.OffsetPosition.X;
239 row["PositionY"] = prim.OffsetPosition.Y; 256 row["PositionY"] = prim.OffsetPosition.Y;
240 row["PositionZ"] = prim.OffsetPosition.Z; 257 row["PositionZ"] = prim.OffsetPosition.Z;
258 row["VelocityX"] = prim.Velocity.X;
259 row["VelocityY"] = prim.Velocity.Y;
260 row["VelocityZ"] = prim.Velocity.Z;
261 row["AngularVelocityX"] = prim.AngularVelocity.X;
262 row["AngularVelocityY"] = prim.AngularVelocity.Y;
263 row["AngularVelocityZ"] = prim.AngularVelocity.Z;
264 row["AccelerationX"] = prim.Acceleration.X;
265 row["AccelerationY"] = prim.Acceleration.Y;
266 row["AccelerationZ"] = prim.Acceleration.Z;
267 // quaternions
268 row["RotationX"] = prim.RotationOffset.X;
269 row["RotationY"] = prim.RotationOffset.Y;
270 row["RotationZ"] = prim.RotationOffset.Z;
271 row["RotationW"] = prim.RotationOffset.W;
272 }
273
274 private void fillShapeRow(DataRow row, PrimitiveBaseShape shape)
275 {
276
241 } 277 }
242 278
243 private void addPrim(SceneObjectPart prim) 279 private void addPrim(SceneObjectPart prim)
@@ -245,13 +281,22 @@ namespace OpenSim.DataStore.MonoSqliteStorage
245 DataTable prims = ds.Tables["prims"]; 281 DataTable prims = ds.Tables["prims"];
246 DataTable shapes = ds.Tables["shapes"]; 282 DataTable shapes = ds.Tables["shapes"];
247 283
248 DataRow row = prims.Rows.Find(prim.UUID); 284 DataRow primRow = prims.Rows.Find(prim.UUID);
249 if (row == null) { 285 if (primRow == null) {
250 row = prims.NewRow(); 286 primRow = prims.NewRow();
251 // fillPrimRow(row, prim); 287 fillPrimRow(primRow, prim);
252 prims.Rows.Add(row); 288 prims.Rows.Add(primRow);
289 } else {
290 fillPrimRow(primRow, prim);
291 }
292
293 DataRow shapeRow = shapes.Rows.Find(prim.UUID);
294 if (shapeRow == null) {
295 shapeRow = prims.NewRow();
296 fillShapeRow(shapeRow, prim.Shape);
297 prims.Rows.Add(shapeRow);
253 } else { 298 } else {
254 fillPrimRow(row, prim); 299 fillPrimRow(shapeRow, prim);
255 } 300 }
256 } 301 }
257 302