small bit of refactoring

afrisby
MW 2007-10-18 19:17:07 +00:00
parent 05df857132
commit 19f8b14120
2 changed files with 484 additions and 476 deletions

View File

@ -394,27 +394,30 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendInventoryItemUpdate(item);
}
SceneObjectPart rootPart =
((SceneObjectGroup) selectedEnt).GetChildPart(((SceneObjectGroup) selectedEnt).UUID);
DeleteSceneObjectGroup((SceneObjectGroup)selectedEnt);
}
}
}
}
}
public void DeleteSceneObjectGroup(SceneObjectGroup group)
{
SceneObjectPart rootPart = (group).GetChildPart(group.UUID);
if (rootPart.PhysActor != null)
{
phyScene.RemovePrim(rootPart.PhysActor);
rootPart.PhysActor = null;
}
storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID,
m_regInfo.RegionID);
((SceneObjectGroup) selectedEnt).DeleteGroup();
storageManager.DataStore.RemoveObject(group.UUID, m_regInfo.RegionID);
group.DeleteGroup();
lock (Entities)
{
Entities.Remove(((SceneObjectGroup) selectedEnt).UUID);
}
((SceneObjectGroup) selectedEnt).DeleteParts();
}
}
}
Entities.Remove(group.UUID);
}
group.DeleteParts();
}
public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos)

View File

@ -270,26 +270,31 @@ namespace OpenSim.Region.Environment.Scenes
StringReader sr = new StringReader(xmlData);
XmlTextReader reader = new XmlTextReader(sr);
reader.Read();
reader.ReadStartElement("SceneObjectGroup");
// reader.ReadStartElement("RootPart");
m_rootPart = SceneObjectPart.FromXml(reader);
//reader.ReadEndElement();
while (reader.Read())
reader.Read();
bool more = true;
while (more)
{
switch (reader.NodeType)
{
case XmlNodeType.Element:
if (reader.Name == "SceneObjectPart")
{
// reader.Read();
SceneObjectPart Part = SceneObjectPart.FromXml(reader);
AddPart(Part);
}
break;
case XmlNodeType.EndElement:
reader.Read();
break;
}
more = !reader.EOF;
}
reader.Close();
sr.Close();