mirror of
https://github.com/opensim/opensim.git
synced 2026-07-13 19:14:51 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user