Fix llAttachToAvatar()

Apart from one obvious bug, this was failing because attempting to serialize the script from inside the script (as part of saving the attachment as an inventory asset) was triggering an extremely long delay.
So we now don't do this.  The state will be serialized anyway when the avatar normally logs out.
The worst that can happen is that if the client/server crashes, the attachment scripts start without previous state.
This commit is contained in:
Justin Clark-Casey (justincc)
2011-08-24 20:49:23 +01:00
parent 97b207240e
commit cf3ffe5bb4
6 changed files with 80 additions and 24 deletions

View File

@@ -1294,9 +1294,15 @@ namespace OpenSim.Region.ScriptEngine.XEngine
public string GetXMLState(UUID itemID)
{
// m_log.DebugFormat("[XEngine]: Getting XML state for {0}", itemID);
IScriptInstance instance = GetInstance(itemID);
if (instance == null)
{
// m_log.DebugFormat("[XEngine]: Found no script for {0}, returning empty string", itemID);
return "";
}
string xml = instance.GetXMLState();
XmlDocument sdoc = new XmlDocument();
@@ -1437,6 +1443,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
mapData.InnerText = map;
stateData.AppendChild(mapData);
// m_log.DebugFormat("[XEngine]: Got XML state for {0}", itemID);
return doc.InnerXml;
}