I think this fixes blob save/load issues (though I'm still not convinced this
will handle > 8k textures yet). Need MW to test to see if this gets rid of his issue. There is commented code left in here for now until we know it is fixedafrisby
parent
07836b890c
commit
ff7164196d
|
@ -62,10 +62,12 @@ namespace OpenSim.DataStore.MonoSqliteStorage
|
||||||
ds.Tables.Add(createPrimTable());
|
ds.Tables.Add(createPrimTable());
|
||||||
primDa.Fill(ds.Tables["prims"]);
|
primDa.Fill(ds.Tables["prims"]);
|
||||||
setupPrimCommands(primDa, conn);
|
setupPrimCommands(primDa, conn);
|
||||||
|
MainLog.Instance.Verbose("DATASTORE", "Populated Prim Definitions");
|
||||||
|
|
||||||
ds.Tables.Add(createShapeTable());
|
ds.Tables.Add(createShapeTable());
|
||||||
shapeDa.Fill(ds.Tables["primshapes"]);
|
shapeDa.Fill(ds.Tables["primshapes"]);
|
||||||
setupShapeCommands(shapeDa, conn);
|
setupShapeCommands(shapeDa, conn);
|
||||||
|
MainLog.Instance.Verbose("DATASTORE", "Populated Prim Shapes");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -481,22 +483,23 @@ namespace OpenSim.DataStore.MonoSqliteStorage
|
||||||
s.ProfileHollow = Convert.ToByte(row["ProfileHollow"]);
|
s.ProfileHollow = Convert.ToByte(row["ProfileHollow"]);
|
||||||
// text TODO: this isn't right] = but I'm not sure the right
|
// text TODO: this isn't right] = but I'm not sure the right
|
||||||
// way to specify this as a blob atm
|
// way to specify this as a blob atm
|
||||||
// s.TextureEntry = (byte[])row["Texture"];
|
s.TextureEntry = (byte[])row["Texture"];
|
||||||
|
s.ExtraParams = (byte[])row["ExtraParams"];
|
||||||
string texture = (string)row["Texture"];
|
// System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
|
||||||
if (!texture.StartsWith("<"))
|
// string texture = encoding.GetString((Byte[])row["Texture"]);
|
||||||
{
|
// if (!texture.StartsWith("<"))
|
||||||
//here so that we can still work with old format database files (ie from before I added xml serialization)
|
// {
|
||||||
LLObject.TextureEntry textureEntry = null;
|
// //here so that we can still work with old format database files (ie from before I added xml serialization)
|
||||||
textureEntry = new LLObject.TextureEntry(new LLUUID(texture));
|
// LLObject.TextureEntry textureEntry = null;
|
||||||
s.TextureEntry = textureEntry.ToBytes();
|
// textureEntry = new LLObject.TextureEntry(new LLUUID(texture));
|
||||||
}
|
// s.TextureEntry = textureEntry.ToBytes();
|
||||||
else
|
// }
|
||||||
{
|
// else
|
||||||
TextureBlock textureEntry = TextureBlock.FromXmlString(texture);
|
// {
|
||||||
s.TextureEntry = textureEntry.TextureData;
|
// TextureBlock textureEntry = TextureBlock.FromXmlString(texture);
|
||||||
s.ExtraParams = textureEntry.ExtraParams;
|
// s.TextureEntry = textureEntry.TextureData;
|
||||||
}
|
// s.ExtraParams = textureEntry.ExtraParams;
|
||||||
|
// }
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
@ -542,9 +545,12 @@ namespace OpenSim.DataStore.MonoSqliteStorage
|
||||||
// Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database
|
// Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database
|
||||||
// am a bit worried about adding it now as some people will have old format databases, so for now including that data in this xml data
|
// am a bit worried about adding it now as some people will have old format databases, so for now including that data in this xml data
|
||||||
// MW[17-08-07]
|
// MW[17-08-07]
|
||||||
TextureBlock textureBlock = new TextureBlock(s.TextureEntry);
|
row["Texture"] = s.TextureEntry;
|
||||||
textureBlock.ExtraParams = s.ExtraParams;
|
row["ExtraParams"] = s.ExtraParams;
|
||||||
row["Texture"] = textureBlock.ToXMLString();
|
// TextureBlock textureBlock = new TextureBlock(s.TextureEntry);
|
||||||
|
// textureBlock.ExtraParams = s.ExtraParams;
|
||||||
|
// System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding();
|
||||||
|
// row["Texture"] = encoding.GetBytes(textureBlock.ToXMLString());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID)
|
private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID)
|
||||||
|
@ -752,7 +758,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage
|
||||||
primDa.Fill(tmpDS, "prims");
|
primDa.Fill(tmpDS, "prims");
|
||||||
shapeDa.Fill(tmpDS, "primshapes");
|
shapeDa.Fill(tmpDS, "primshapes");
|
||||||
} catch (Mono.Data.SqliteClient.SqliteSyntaxException) {
|
} catch (Mono.Data.SqliteClient.SqliteSyntaxException) {
|
||||||
MainLog.Instance.Verbose("SQLite Database does exist... creating");
|
MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating");
|
||||||
InitDB(conn);
|
InitDB(conn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue