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.

afrisby
MW 2007-08-11 20:20:33 +00:00
parent cea2e45da9
commit 822881eac5
5 changed files with 18 additions and 17 deletions

View File

@ -127,6 +127,7 @@ namespace OpenSim.Framework.Data.DB4o
{
userProfiles.Add(row.UUID, row);
}
}
database.Close();
}

View File

@ -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;

View File

@ -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)
{

View File

@ -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....");

View File

@ -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),