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); remoteClient.SendInventoryItemUpdate(item);
} }
SceneObjectPart rootPart = DeleteSceneObjectGroup((SceneObjectGroup)selectedEnt);
((SceneObjectGroup) selectedEnt).GetChildPart(((SceneObjectGroup) selectedEnt).UUID); }
}
}
}
}
public void DeleteSceneObjectGroup(SceneObjectGroup group)
{
SceneObjectPart rootPart = (group).GetChildPart(group.UUID);
if (rootPart.PhysActor != null) if (rootPart.PhysActor != null)
{ {
phyScene.RemovePrim(rootPart.PhysActor); phyScene.RemovePrim(rootPart.PhysActor);
rootPart.PhysActor = null; rootPart.PhysActor = null;
} }
storageManager.DataStore.RemoveObject(((SceneObjectGroup) selectedEnt).UUID, storageManager.DataStore.RemoveObject(group.UUID, m_regInfo.RegionID);
m_regInfo.RegionID); group.DeleteGroup();
((SceneObjectGroup) selectedEnt).DeleteGroup();
lock (Entities) lock (Entities)
{ {
Entities.Remove(((SceneObjectGroup) selectedEnt).UUID); Entities.Remove(group.UUID);
}
((SceneObjectGroup) selectedEnt).DeleteParts();
}
}
}
} }
group.DeleteParts();
} }
public void RezObject(IClientAPI remoteClient, LLUUID itemID, LLVector3 pos) 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); 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();