* Okay you can put down your pitchforks - this patch should fix rezzing of items (with inventory) on Windows

* Now properly dealing with prims which don't contain items - thanks to thomas for the patch which gave insight into this situation
* Also, an xml exception no longer crahes the client session    
* Leaving in debugging lines in case there are further problems
* Not yet tested on Linux, though I'm just about to.
0.6.0-stable
Justin Clarke Casey 2008-04-07 16:30:29 +00:00
parent 2b23734a16
commit 2caea75aa8
3 changed files with 53 additions and 54 deletions

View File

@ -67,41 +67,31 @@ namespace OpenSim.Framework
// see IXmlSerializable
public void ReadXml(XmlReader reader)
{
m_log.DebugFormat(
"[TASK INVENTORY]: Initial task inventory deserialization CanDeserialize() call was {0}",
tiiSerializer.CanDeserialize(reader));
reader.Read();
while (tiiSerializer.CanDeserialize(reader))
m_log.DebugFormat("[TASK INVENTORY]: ReadXml current node before actions, {0}", reader.Name);
if (!reader.IsEmptyElement)
{
TaskInventoryItem item = (TaskInventoryItem)tiiSerializer.Deserialize(reader);
Add(item.ItemID, item);
reader.Read();
while (tiiSerializer.CanDeserialize(reader))
{
TaskInventoryItem item = (TaskInventoryItem)tiiSerializer.Deserialize(reader);
Add(item.ItemID, item);
m_log.DebugFormat("[TASK INVENTORY]: Instanted prim item {0}, {1} from xml", item.Name, item.ItemID);
}
// m_log.DebugFormat("[TASK INVENTORY]: Instanted prim item {0}, {1} from xml", item.Name, item.ItemID);
m_log.DebugFormat("[TASK INVENTORY]: Instantiated {0} prim items in total from xml", Count);
}
else
{
m_log.DebugFormat("[TASK INVENTORY]: Skipping empty element {0}", reader.Name);
}
// m_log.DebugFormat("[TASK INVENTORY]: Instantiated {0} prim items in total from xml", Count);
// For some .net implementations, this last read is necessary so that we advance beyond the end tag
// of the element wrapping this object so that the rest of the serialization can complete normally.
reader.Read();
// m_log.DebugFormat("[TASK INVENTORY]: Current node {0}", reader.Name);
// reader.Read();
// while (reader.Name.Equals("TaskInventoryItem"))
// {
// TaskInventoryItem item = (TaskInventoryItem)tiiSerializer.Deserialize(reader);
// Add(item.ItemID, item);
// }
// ICollection<TaskInventoryItem> items
// = (ICollection<TaskInventoryItem>)tiiSerializer.Deserialize(reader);
//
// foreach (TaskInventoryItem item in items)
// {
// Add(item.ItemID, item);
// }
m_log.DebugFormat("[TASK INVENTORY]: ReadXml Current node after actions, {0}", reader.Name);
}
// see IXmlSerializable

View File

@ -296,36 +296,46 @@ 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);
AddPart(m_rootPart);
// m_log.DebugFormat("[SCENE OBJECT GROUP]: Current node {0}", reader.Name);
reader.ReadEndElement();
while (reader.Read())
try
{
switch (reader.NodeType)
reader.Read();
reader.ReadStartElement("SceneObjectGroup");
reader.ReadStartElement("RootPart");
m_rootPart = SceneObjectPart.FromXml(reader);
AddPart(m_rootPart);
m_log.DebugFormat("[SCENE OBJECT GROUP]: Current node {0}", reader.Name);
reader.ReadEndElement();
while (reader.Read())
{
case XmlNodeType.Element:
if (reader.Name == "Part")
{
reader.Read();
SceneObjectPart part = SceneObjectPart.FromXml(reader);
part.LocalId = m_scene.PrimIDAllocate();
AddPart(part);
part.RegionHandle = m_regionHandle;
part.TrimPermissions();
}
break;
case XmlNodeType.EndElement:
break;
switch (reader.NodeType)
{
case XmlNodeType.Element:
if (reader.Name == "Part")
{
reader.Read();
SceneObjectPart part = SceneObjectPart.FromXml(reader);
part.LocalId = m_scene.PrimIDAllocate();
AddPart(part);
part.RegionHandle = m_regionHandle;
part.TrimPermissions();
}
break;
case XmlNodeType.EndElement:
break;
}
}
}
catch (XmlException e)
{
m_log.ErrorFormat("[SCENE OBJECT GROUP]: Deserialization of following xml failed, {0}", xmlData);
// Let's see if carrying on does anything for us
}
reader.Close();
sr.Close();

View File

@ -77,7 +77,6 @@ namespace OpenSim.Region.Environment.Scenes
/// </summary>
protected TaskInventoryDictionary m_taskInventory = new TaskInventoryDictionary();
[XmlIgnore]
public TaskInventoryDictionary TaskInventory
{
get { return m_taskInventory; }