diff options
Diffstat (limited to 'OpenSim/Region/Storage')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 87df8fb..005da7a 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -62,10 +62,12 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
62 | ds.Tables.Add(createPrimTable()); | 62 | ds.Tables.Add(createPrimTable()); |
63 | primDa.Fill(ds.Tables["prims"]); | 63 | primDa.Fill(ds.Tables["prims"]); |
64 | setupPrimCommands(primDa, conn); | 64 | setupPrimCommands(primDa, conn); |
65 | MainLog.Instance.Verbose("DATASTORE", "Populated Prim Definitions"); | ||
65 | 66 | ||
66 | ds.Tables.Add(createShapeTable()); | 67 | ds.Tables.Add(createShapeTable()); |
67 | shapeDa.Fill(ds.Tables["primshapes"]); | 68 | shapeDa.Fill(ds.Tables["primshapes"]); |
68 | setupShapeCommands(shapeDa, conn); | 69 | setupShapeCommands(shapeDa, conn); |
70 | MainLog.Instance.Verbose("DATASTORE", "Populated Prim Shapes"); | ||
69 | 71 | ||
70 | return; | 72 | return; |
71 | } | 73 | } |
@@ -481,22 +483,23 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
481 | s.ProfileHollow = Convert.ToByte(row["ProfileHollow"]); | 483 | s.ProfileHollow = Convert.ToByte(row["ProfileHollow"]); |
482 | // text TODO: this isn't right] = but I'm not sure the right | 484 | // text TODO: this isn't right] = but I'm not sure the right |
483 | // way to specify this as a blob atm | 485 | // way to specify this as a blob atm |
484 | // s.TextureEntry = (byte[])row["Texture"]; | 486 | s.TextureEntry = (byte[])row["Texture"]; |
485 | 487 | s.ExtraParams = (byte[])row["ExtraParams"]; | |
486 | string texture = (string)row["Texture"]; | 488 | // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); |
487 | if (!texture.StartsWith("<")) | 489 | // string texture = encoding.GetString((Byte[])row["Texture"]); |
488 | { | 490 | // if (!texture.StartsWith("<")) |
489 | //here so that we can still work with old format database files (ie from before I added xml serialization) | 491 | // { |
490 | LLObject.TextureEntry textureEntry = null; | 492 | // //here so that we can still work with old format database files (ie from before I added xml serialization) |
491 | textureEntry = new LLObject.TextureEntry(new LLUUID(texture)); | 493 | // LLObject.TextureEntry textureEntry = null; |
492 | s.TextureEntry = textureEntry.ToBytes(); | 494 | // textureEntry = new LLObject.TextureEntry(new LLUUID(texture)); |
493 | } | 495 | // s.TextureEntry = textureEntry.ToBytes(); |
494 | else | 496 | // } |
495 | { | 497 | // else |
496 | TextureBlock textureEntry = TextureBlock.FromXmlString(texture); | 498 | // { |
497 | s.TextureEntry = textureEntry.TextureData; | 499 | // TextureBlock textureEntry = TextureBlock.FromXmlString(texture); |
498 | s.ExtraParams = textureEntry.ExtraParams; | 500 | // s.TextureEntry = textureEntry.TextureData; |
499 | } | 501 | // s.ExtraParams = textureEntry.ExtraParams; |
502 | // } | ||
500 | 503 | ||
501 | return s; | 504 | return s; |
502 | } | 505 | } |
@@ -542,9 +545,12 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
542 | // Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database | 545 | // Added following xml hack but not really ideal , also ExtraParams isn't currently part of the database |
543 | // 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 | 546 | // 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 |
544 | // MW[17-08-07] | 547 | // MW[17-08-07] |
545 | TextureBlock textureBlock = new TextureBlock(s.TextureEntry); | 548 | row["Texture"] = s.TextureEntry; |
546 | textureBlock.ExtraParams = s.ExtraParams; | 549 | row["ExtraParams"] = s.ExtraParams; |
547 | row["Texture"] = textureBlock.ToXMLString(); | 550 | // TextureBlock textureBlock = new TextureBlock(s.TextureEntry); |
551 | // textureBlock.ExtraParams = s.ExtraParams; | ||
552 | // System.Text.ASCIIEncoding encoding = new System.Text.ASCIIEncoding(); | ||
553 | // row["Texture"] = encoding.GetBytes(textureBlock.ToXMLString()); | ||
548 | } | 554 | } |
549 | 555 | ||
550 | private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID) | 556 | private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID) |
@@ -752,7 +758,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage | |||
752 | primDa.Fill(tmpDS, "prims"); | 758 | primDa.Fill(tmpDS, "prims"); |
753 | shapeDa.Fill(tmpDS, "primshapes"); | 759 | shapeDa.Fill(tmpDS, "primshapes"); |
754 | } catch (Mono.Data.SqliteClient.SqliteSyntaxException) { | 760 | } catch (Mono.Data.SqliteClient.SqliteSyntaxException) { |
755 | MainLog.Instance.Verbose("SQLite Database does exist... creating"); | 761 | MainLog.Instance.Verbose("DATASTORE", "SQLite Database doesn't exist... creating"); |
756 | InitDB(conn); | 762 | InitDB(conn); |
757 | } | 763 | } |
758 | 764 | ||