aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
authorMelanie2009-12-21 10:26:52 +0000
committerMelanie2009-12-21 10:26:52 +0000
commit27453890d5a5d09e47c638ccef92f45b1ce360b2 (patch)
tree31d240c542ff545ecf4d7a853bf6ea1e0f1a4c18 /OpenSim/Region/ScriptEngine/XEngine
parentRemove extra checking on the itemID of saved state, since it changes during (diff)
downloadopensim-SC_OLD-27453890d5a5d09e47c638ccef92f45b1ce360b2.zip
opensim-SC_OLD-27453890d5a5d09e47c638ccef92f45b1ce360b2.tar.gz
opensim-SC_OLD-27453890d5a5d09e47c638ccef92f45b1ce360b2.tar.bz2
opensim-SC_OLD-27453890d5a5d09e47c638ccef92f45b1ce360b2.tar.xz
Script State Fix: Part 2
Change the reader to wrap old-style definitions in new style wrappers. Change importer to not check irrelevant data that can't be reconstructed This removes the last bit of knowledge of XEngine's .state files from core.
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs36
1 files changed, 20 insertions, 16 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 082c99b..25a4cd6 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -1368,10 +1368,10 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1368 return false; 1368 return false;
1369 } 1369 }
1370 1370
1371 public void SetXMLState(UUID itemID, string xml) 1371 public bool SetXMLState(UUID itemID, string xml)
1372 { 1372 {
1373 if (xml == String.Empty) 1373 if (xml == String.Empty)
1374 return; 1374 return false;
1375 1375
1376 XmlDocument doc = new XmlDocument(); 1376 XmlDocument doc = new XmlDocument();
1377 1377
@@ -1382,17 +1382,17 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1382 catch (Exception) 1382 catch (Exception)
1383 { 1383 {
1384 m_log.Error("[XEngine]: Exception decoding XML data from region transfer"); 1384 m_log.Error("[XEngine]: Exception decoding XML data from region transfer");
1385 return; 1385 return false;
1386 } 1386 }
1387 1387
1388 XmlNodeList rootL = doc.GetElementsByTagName("State"); 1388 XmlNodeList rootL = doc.GetElementsByTagName("State");
1389 if (rootL.Count < 1) 1389 if (rootL.Count < 1)
1390 return; 1390 return false;
1391 1391
1392 XmlElement rootE = (XmlElement)rootL[0]; 1392 XmlElement rootE = (XmlElement)rootL[0];
1393 1393
1394 if (rootE.GetAttribute("Engine") != ScriptEngineName) 1394 if (rootE.GetAttribute("Engine") != ScriptEngineName)
1395 return; 1395 return false;
1396 1396
1397// On rez from inventory, that ID will have changed. It was only 1397// On rez from inventory, that ID will have changed. It was only
1398// advisory anyway. So we don't check it anymore. 1398// advisory anyway. So we don't check it anymore.
@@ -1403,7 +1403,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1403 XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState"); 1403 XmlNodeList stateL = rootE.GetElementsByTagName("ScriptState");
1404 1404
1405 if (stateL.Count != 1) 1405 if (stateL.Count != 1)
1406 return; 1406 return false;
1407 1407
1408 XmlElement stateE = (XmlElement)stateL[0]; 1408 XmlElement stateE = (XmlElement)stateL[0];
1409 1409
@@ -1412,7 +1412,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1412 XmlNodeList assemL = rootE.GetElementsByTagName("Assembly"); 1412 XmlNodeList assemL = rootE.GetElementsByTagName("Assembly");
1413 1413
1414 if (assemL.Count != 1) 1414 if (assemL.Count != 1)
1415 return; 1415 return false;
1416 1416
1417 XmlElement assemE = (XmlElement)assemL[0]; 1417 XmlElement assemE = (XmlElement)assemL[0];
1418 1418
@@ -1452,19 +1452,23 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1452 sfs.Close(); 1452 sfs.Close();
1453 1453
1454 XmlNodeList mapL = rootE.GetElementsByTagName("LineMap"); 1454 XmlNodeList mapL = rootE.GetElementsByTagName("LineMap");
1455 1455 if (mapL.Count > 0)
1456 XmlElement mapE = (XmlElement)mapL[0]; 1456 {
1457 XmlElement mapE = (XmlElement)mapL[0];
1457 1458
1458 string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString()); 1459 string mappath = Path.Combine("ScriptEngines", World.RegionInfo.RegionID.ToString());
1459 mappath = Path.Combine(mappath, mapE.GetAttribute("Filename")); 1460 mappath = Path.Combine(mappath, mapE.GetAttribute("Filename"));
1460 1461
1461 FileStream mfs = File.Create(mappath); 1462 FileStream mfs = File.Create(mappath);
1462 StreamWriter msw = new StreamWriter(mfs); 1463 StreamWriter msw = new StreamWriter(mfs);
1463 1464
1464 msw.Write(mapE.InnerText); 1465 msw.Write(mapE.InnerText);
1465 1466
1466 msw.Close(); 1467 msw.Close();
1467 mfs.Close(); 1468 mfs.Close();
1469 }
1470
1471 return true;
1468 } 1472 }
1469 } 1473 }
1470} 1474}