diff options
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 30e127d..bbaf923 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -556,6 +556,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
556 | 556 | ||
557 | if (stateSource == (int)StateSource.ScriptedRez) | 557 | if (stateSource == (int)StateSource.ScriptedRez) |
558 | { | 558 | { |
559 | lock (m_CompileDict) | ||
560 | { | ||
561 | m_CompileDict[itemID] = 0; | ||
562 | } | ||
563 | |||
559 | DoOnRezScript(parms); | 564 | DoOnRezScript(parms); |
560 | } | 565 | } |
561 | else | 566 | else |
@@ -1356,9 +1361,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1356 | string xml = instance.GetXMLState(); | 1361 | string xml = instance.GetXMLState(); |
1357 | 1362 | ||
1358 | XmlDocument sdoc = new XmlDocument(); | 1363 | XmlDocument sdoc = new XmlDocument(); |
1359 | sdoc.LoadXml(xml); | 1364 | bool loadedState = true; |
1360 | XmlNodeList rootL = sdoc.GetElementsByTagName("ScriptState"); | 1365 | try |
1361 | XmlNode rootNode = rootL[0]; | 1366 | { |
1367 | sdoc.LoadXml(xml); | ||
1368 | } | ||
1369 | catch (System.Xml.XmlException e) | ||
1370 | { | ||
1371 | loadedState = false; | ||
1372 | } | ||
1373 | |||
1374 | XmlNodeList rootL = null; | ||
1375 | XmlNode rootNode = null; | ||
1376 | if (loadedState) | ||
1377 | { | ||
1378 | rootL = sdoc.GetElementsByTagName("ScriptState"); | ||
1379 | rootNode = rootL[0]; | ||
1380 | } | ||
1362 | 1381 | ||
1363 | // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> | 1382 | // Create <State UUID="xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"> |
1364 | XmlDocument doc = new XmlDocument(); | 1383 | XmlDocument doc = new XmlDocument(); |
@@ -1374,8 +1393,18 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1374 | stateData.Attributes.Append(engineName); | 1393 | stateData.Attributes.Append(engineName); |
1375 | doc.AppendChild(stateData); | 1394 | doc.AppendChild(stateData); |
1376 | 1395 | ||
1396 | XmlNode xmlstate = null; | ||
1397 | |||
1377 | // Add <ScriptState>...</ScriptState> | 1398 | // Add <ScriptState>...</ScriptState> |
1378 | XmlNode xmlstate = doc.ImportNode(rootNode, true); | 1399 | if (loadedState) |
1400 | { | ||
1401 | xmlstate = doc.ImportNode(rootNode, true); | ||
1402 | } | ||
1403 | else | ||
1404 | { | ||
1405 | xmlstate = doc.CreateElement("", "ScriptState", ""); | ||
1406 | } | ||
1407 | |||
1379 | stateData.AppendChild(xmlstate); | 1408 | stateData.AppendChild(xmlstate); |
1380 | 1409 | ||
1381 | string assemName = instance.GetAssemblyName(); | 1410 | string assemName = instance.GetAssemblyName(); |