From 822881eac543646af96a78b14f83fb326563a5e6 Mon Sep 17 00:00:00 2001 From: MW Date: Sat, 11 Aug 2007 20:20:33 +0000 Subject: [PATCH] Added a new column (SceneGroupID) to sqlite3 table (sqlite3-prims.sql) so that we can tell what prims belong to the same SceneObjectGroup. If sdague has a different method in mind when he gets back then he can change it then. --- OpenSim/Framework/Data.DB4o/DB4oManager.cs | 1 + OpenSim/Region/Application/OpenSimMain.cs | 18 +++++++----------- .../Local/CommunicationsLocal.cs | 2 +- .../MonoSqliteDataStore.cs | 13 ++++++++----- share/sql/sqlite3-prims.sql | 1 + 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/OpenSim/Framework/Data.DB4o/DB4oManager.cs b/OpenSim/Framework/Data.DB4o/DB4oManager.cs index c582866b7e..230a70789b 100644 --- a/OpenSim/Framework/Data.DB4o/DB4oManager.cs +++ b/OpenSim/Framework/Data.DB4o/DB4oManager.cs @@ -127,6 +127,7 @@ namespace OpenSim.Framework.Data.DB4o { userProfiles.Add(row.UUID, row); } + } database.Close(); } diff --git a/OpenSim/Region/Application/OpenSimMain.cs b/OpenSim/Region/Application/OpenSimMain.cs index 611041d9cd..6c498179ae 100644 --- a/OpenSim/Region/Application/OpenSimMain.cs +++ b/OpenSim/Region/Application/OpenSimMain.cs @@ -121,23 +121,19 @@ namespace OpenSim base.StartUp(); - if (!m_sandbox) - { - m_httpServer.AddStreamHandler(new SimStatusHandler()); - } - if (m_sandbox) { CommunicationsLocal localComms = new CommunicationsLocal(m_networkServersInfo, m_httpServer, m_assetCache, standaloneAuthenticate); m_commsManager = localComms; if(standaloneAuthenticate) { - this.CreateAccount = localComms.do_create; + this.CreateAccount = localComms.doCreate; } } else { m_commsManager = new CommunicationsOGS1(m_networkServersInfo, m_httpServer, m_assetCache); + m_httpServer.AddStreamHandler(new SimStatusHandler()); } string regionConfigPath = Path.Combine(Util.configDir(), "Regions"); @@ -326,11 +322,6 @@ namespace OpenSim } break; - case "quit": - case "shutdown": - Shutdown(); - break; - case "create": if (CreateAccount != null) { @@ -338,6 +329,11 @@ namespace OpenSim } break; + case "quit": + case "shutdown": + Shutdown(); + break; + default: m_log.Error("Unknown command"); break; diff --git a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs index 69352d1d8d..5b6681639c 100644 --- a/OpenSim/Region/Communications/Local/CommunicationsLocal.cs +++ b/OpenSim/Region/Communications/Local/CommunicationsLocal.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.Communications.Local this.SandBoxServices.AddNewSession(regionHandle, login); } - public void do_create(string what) + public void doCreate(string what) { switch (what) { diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index 45b19e69e9..5d1592c0c7 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs @@ -81,6 +81,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage data.Add("ParentID", DbType.Int32); data.Add("CreationDate", DbType.Int32); data.Add("Name", DbType.String); + data.Add("SceneGroupID", DbType.String); // various text fields data.Add("Text", DbType.String); data.Add("Description", DbType.String); @@ -305,12 +306,14 @@ namespace OpenSim.DataStore.MonoSqliteStorage return prim; } - private void fillPrimRow(DataRow row, SceneObjectPart prim) + private void fillPrimRow(DataRow row, SceneObjectPart prim, LLUUID sceneGroupID) { + Console.WriteLine("scene Group for this prim is " + sceneGroupID); row["UUID"] = prim.UUID; row["ParentID"] = prim.ParentID; row["CreationDate"] = prim.CreationDate; row["Name"] = prim.PartName; + row["SceneGroupID"] = sceneGroupID; // the UUID of the root part for this SceneObjectGroup // various text fields row["Text"] = prim.Text; row["Description"] = prim.Description; @@ -434,7 +437,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage } - private void addPrim(SceneObjectPart prim) + private void addPrim(SceneObjectPart prim, LLUUID sceneGroupID) { DataTable prims = ds.Tables["prims"]; DataTable shapes = ds.Tables["primshapes"]; @@ -442,10 +445,10 @@ namespace OpenSim.DataStore.MonoSqliteStorage DataRow primRow = prims.Rows.Find(prim.UUID); if (primRow == null) { primRow = prims.NewRow(); - fillPrimRow(primRow, prim); + fillPrimRow(primRow, prim, sceneGroupID); prims.Rows.Add(primRow); } else { - fillPrimRow(primRow, prim); + fillPrimRow(primRow, prim, sceneGroupID); } DataRow shapeRow = shapes.Rows.Find(prim.UUID); @@ -462,7 +465,7 @@ namespace OpenSim.DataStore.MonoSqliteStorage { foreach (SceneObjectPart prim in obj.Children.Values) { - addPrim(prim); + addPrim(prim, obj.UUID); } MainLog.Instance.Verbose("Attempting to do database update...."); diff --git a/share/sql/sqlite3-prims.sql b/share/sql/sqlite3-prims.sql index 8cea8e0a65..5680c15b16 100644 --- a/share/sql/sqlite3-prims.sql +++ b/share/sql/sqlite3-prims.sql @@ -12,6 +12,7 @@ create table prims ( ParentID integer default 0, -- this.ParentID CreationDate integer, -- this.CreationDate Name varchar(256), + SceneGroupID char(36), -- various text fields Text varchar(256), Description varchar(256),