aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite
diff options
context:
space:
mode:
authorSean Dague2007-08-09 20:59:37 +0000
committerSean Dague2007-08-09 20:59:37 +0000
commitad2133e5cf59d6e62bf1bdf16fb5183b78273f50 (patch)
tree777961a2160e3ff88b59cd9ddcc3ea96abbcf1c1 /OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite
parentRemoved 2 warnings. Added pointer comments to where to add hooks and modify f... (diff)
downloadopensim-SC_OLD-ad2133e5cf59d6e62bf1bdf16fb5183b78273f50.zip
opensim-SC_OLD-ad2133e5cf59d6e62bf1bdf16fb5183b78273f50.tar.gz
opensim-SC_OLD-ad2133e5cf59d6e62bf1bdf16fb5183b78273f50.tar.bz2
opensim-SC_OLD-ad2133e5cf59d6e62bf1bdf16fb5183b78273f50.tar.xz
utility functions to convert from rows to new objects. untested
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite')
-rw-r--r--OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs87
1 files changed, 87 insertions, 0 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
index 83b5ed8..6e8c22d 100644
--- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
+++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs
@@ -241,6 +241,58 @@ namespace OpenSim.DataStore.MonoSqliteStorage
241 private SceneObjectPart buildPrim(DataRow row) 241 private SceneObjectPart buildPrim(DataRow row)
242 { 242 {
243 SceneObjectPart prim = new SceneObjectPart(); 243 SceneObjectPart prim = new SceneObjectPart();
244 prim.UUID = new LLUUID((string)row["UUID"]);
245 prim.ParentID = (uint)row["ParentID"];
246 prim.CreationDate = (int)row["CreationDate"];
247 prim.PartName = (string)row["Name"];
248 // various text fields
249 prim.Text = (string)row["Text"];
250 prim.Description = (string)row["Description"];
251 prim.SitName = (string)row["SitName"];
252 prim.TouchName = (string)row["TouchName"];
253 // permissions
254 prim.CreatorID = new LLUUID((string)row["CreatorID"]);
255 prim.OwnerID = new LLUUID((string)row["OwnerID"]);
256 prim.GroupID = new LLUUID((string)row["GroupID"]);
257 prim.LastOwnerID = new LLUUID((string)row["LastOwnerID"]);
258 prim.OwnerMask = (uint)row["OwnerMask"];
259 prim.NextOwnerMask = (uint)row["NextOwnerMask"];
260 prim.GroupMask = (uint)row["GroupMask"];
261 prim.EveryoneMask = (uint)row["EveryoneMask"];
262 prim.BaseMask = (uint)row["BaseMask"];
263 // vectors
264 prim.OffsetPosition = new LLVector3(
265 (float)row["PositionX"],
266 (float)row["PositionY"],
267 (float)row["PositionZ"]
268 );
269 prim.GroupPosition = new LLVector3(
270 (float)row["GroupPositionX"],
271 (float)row["GroupPositionY"],
272 (float)row["GroupPositionZ"]
273 );
274 prim.Velocity = new LLVector3(
275 (float)row["VelocityX"],
276 (float)row["VelocityY"],
277 (float)row["VelocityZ"]
278 );
279 prim.AngularVelocity = new LLVector3(
280 (float)row["AngularVelocityX"],
281 (float)row["AngularVelocityY"],
282 (float)row["AngularVelocityZ"]
283 );
284 prim.Acceleration = new LLVector3(
285 (float)row["AccelerationX"],
286 (float)row["AccelerationY"],
287 (float)row["AccelerationZ"]
288 );
289 // quaternions
290 prim.RotationOffset = new LLQuaternion(
291 (float)row["RotationX"],
292 (float)row["RotationY"],
293 (float)row["RotationZ"],
294 (float)row["RotationW"]
295 );
244 return prim; 296 return prim;
245 } 297 }
246 298
@@ -288,6 +340,41 @@ namespace OpenSim.DataStore.MonoSqliteStorage
288 row["RotationW"] = prim.RotationOffset.W; 340 row["RotationW"] = prim.RotationOffset.W;
289 } 341 }
290 342
343 private PrimitiveBaseShape buildShape(DataRow row)
344 {
345 PrimitiveBaseShape s = new PrimitiveBaseShape();
346 s.Scale = new LLVector3(
347 (float)row["ScaleX"],
348 (float)row["ScaleY"],
349 (float)row["ScaleZ"]
350 );
351 // paths
352 s.PCode = (byte)row["PCode"];
353 s.PathBegin = (ushort)row["PathBegin"];
354 s.PathEnd = (ushort)row["PathEnd"];
355 s.PathScaleX = (byte)row["PathScaleX"];
356 s.PathScaleY = (byte)row["PathScaleY"];
357 s.PathShearX = (byte)row["PathShearX"];
358 s.PathShearY = (byte)row["PathShearY"];
359 s.PathSkew = (sbyte)row["PathSkew"];
360 s.PathCurve = (byte)row["PathCurve"];
361 s.PathRadiusOffset = (sbyte)row["PathRadiusOffset"];
362 s.PathRevolutions = (byte)row["PathRevolutions"];
363 s.PathTaperX = (sbyte)row["PathTaperX"];
364 s.PathTaperY = (sbyte)row["PathTaperY"];
365 s.PathTwist = (sbyte)row["PathTwist"];
366 s.PathTwistBegin = (sbyte)row["PathTwistBegin"];
367 // profile
368 s.ProfileBegin = (ushort)row["ProfileBegin"];
369 s.ProfileEnd = (ushort)row["ProfileEnd"];
370 s.ProfileCurve = (byte)row["ProfileCurve"];
371 s.ProfileHollow = (byte)row["ProfileHollow"];
372 // text TODO: this isn't right] = but I'm not sure the right
373 // way to specify this as a blob atm
374 s.TextureEntry = (byte[])row["Texture"];
375 return s;
376 }
377
291 private void fillShapeRow(DataRow row, SceneObjectPart prim) 378 private void fillShapeRow(DataRow row, SceneObjectPart prim)
292 { 379 {
293 PrimitiveBaseShape s = prim.Shape; 380 PrimitiveBaseShape s = prim.Shape;