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.
afrisby
Sean Dague 2007-08-07 15:45:16 +00:00
parent cf3babd988
commit e4df1de58b
1 changed files with 21 additions and 3 deletions

View File

@ -56,7 +56,7 @@ namespace OpenSim.DataStore.SqliteStorage
public void StoreObject(AllNewSceneObjectPart2 obj)
{
// TODO: Serializing code
// TODO: Serializing code
DataTable prims = ds.Tables["prims"];
DataTable shapes = ds.Tables["shapes"];
@ -64,16 +64,34 @@ namespace OpenSim.DataStore.SqliteStorage
}
private void fillPrimRow(DataRow row, Primitive prim)
{
row["UUID"] = prim.UUID;
row["CreationDate"] = prim.CreationDate;
row["Name"] = prim.Name;
row["PositionX"] = prim.Pos.X;
row["PositionY"] = prim.Pos.Y;
row["PositionZ"] = prim.Pos.Z;
}
private void addPrim(Primitive prim)
{
DataTable prims = ds.Tables["prims"];
DataTable shapes = ds.Tables["shapes"];
DataRow row;
DataRow row = prims.Rows.Find(prim.UUID);
if (row == null) {
row = prims.NewRow();
fillPrimRow(row, prim);
prims.Rows.Add(row);
} else {
fillPrimRow(row, prim);
}
}
public void StoreObject(SceneObject obj)
{
foreach (Primitive prim in obj.Children.Values)
foreach (Primitive prim in obj.Children.Values)
{
addPrim(prim);
}