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,29 +394,32 @@ namespace OpenSim.Region.Environment.Scenes
remoteClient.SendInventoryItemUpdate(item); remoteClient.SendInventoryItemUpdate(item);
} }
SceneObjectPart rootPart = DeleteSceneObjectGroup((SceneObjectGroup)selectedEnt);
((SceneObjectGroup) selectedEnt).GetChildPart(((SceneObjectGroup) selectedEnt).UUID);
if (rootPart.PhysActor != null)
{
phyScene.RemovePrim(rootPart.PhysActor);
rootPart.PhysActor = null;
}
storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID,
m_regInfo.RegionID);
((SceneObjectGroup) selectedEnt).DeleteGroup();
lock (Entities)
{
Entities.Remove(((SceneObjectGroup) selectedEnt).UUID);
}
((SceneObjectGroup) selectedEnt).DeleteParts();
} }
} }
} }
} }
} }
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(group.UUID, m_regInfo.RegionID);
group.DeleteGroup();
lock (Entities)
{
Entities.Remove(group.UUID);
}
group.DeleteParts();
}
public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos)
{ {
CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId); CachedUserInfo userInfo = commsManager.UserProfileCache.GetUserDetails(remoteClient.AgentId);

View File

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