aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
authorMelanie2012-06-26 17:35:55 +0100
committerMelanie2012-06-26 17:35:55 +0100
commit7cc5b3d7d3350cbf47dab40f0c14627ef77ea4c9 (patch)
tree5492a786c85a7edd63fb8ad0c3c6f1da8d700741 /OpenSim/Region/ScriptEngine/XEngine
parentMerge branch 'master' into careminster (diff)
parentWhen attachments are being saved and deleted for a closing root agent, delete... (diff)
downloadopensim-SC_OLD-7cc5b3d7d3350cbf47dab40f0c14627ef77ea4c9.zip
opensim-SC_OLD-7cc5b3d7d3350cbf47dab40f0c14627ef77ea4c9.tar.gz
opensim-SC_OLD-7cc5b3d7d3350cbf47dab40f0c14627ef77ea4c9.tar.bz2
opensim-SC_OLD-7cc5b3d7d3350cbf47dab40f0c14627ef77ea4c9.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/ClientStack/Linden/UDP/LLClientView.cs OpenSim/Region/CoreModules/Scripting/LSLHttp/UrlModule.cs OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs63
1 files changed, 33 insertions, 30 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 01021c9..b1583b2 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -920,15 +920,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine
920 { 920 {
921 if (m_InitialStartup) 921 if (m_InitialStartup)
922 { 922 {
923 m_InitialStartup = false; 923 // This delay exists to stop mono problems where script compilation and startup would stop the sim
924 // working properly for the session.
924 System.Threading.Thread.Sleep(15000); 925 System.Threading.Thread.Sleep(15000);
925
926 if (m_CompileQueue.Count == 0)
927 {
928 // No scripts on region, so won't get triggered later
929 // by the queue becoming empty so we trigger it here
930 m_Scene.EventManager.TriggerEmptyScriptCompileQueue(0, String.Empty);
931 }
932 } 926 }
933 927
934 object[] o; 928 object[] o;
@@ -941,14 +935,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
941 { 935 {
942 scriptsStarted++; 936 scriptsStarted++;
943 937
944// if (scriptsStarted % 50 == 0) 938 if (m_InitialStartup)
945// m_log.DebugFormat( 939 if (scriptsStarted % 50 == 0)
946// "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); 940 m_log.InfoFormat(
941 "[XEngine]: Started {0} scripts in {1}", scriptsStarted, m_Scene.RegionInfo.RegionName);
947 } 942 }
948 } 943 }
949 944
950// m_log.DebugFormat( 945 if (m_InitialStartup)
951// "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.RegionInfo.RegionName); 946 m_log.InfoFormat(
947 "[XEngine]: Completed starting {0} scripts on {1}", scriptsStarted, m_Scene.RegionInfo.RegionName);
952 948
953 // NOTE: Despite having a lockless queue, this lock is required 949 // NOTE: Despite having a lockless queue, this lock is required
954 // to make sure there is never no compile thread while there 950 // to make sure there is never no compile thread while there
@@ -956,12 +952,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
956 // due to a race condition 952 // due to a race condition
957 // 953 //
958 lock (m_CompileQueue) 954 lock (m_CompileQueue)
959 {
960 m_CurrentCompile = null; 955 m_CurrentCompile = null;
961 } 956
962 m_Scene.EventManager.TriggerEmptyScriptCompileQueue(m_ScriptFailCount, 957 m_Scene.EventManager.TriggerEmptyScriptCompileQueue(m_ScriptFailCount,
963 m_ScriptErrorMessage); 958 m_ScriptErrorMessage);
959
964 m_ScriptFailCount = 0; 960 m_ScriptFailCount = 0;
961 m_InitialStartup = false;
965 962
966 return null; 963 return null;
967 } 964 }
@@ -1451,25 +1448,24 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1451 return false; 1448 return false;
1452 1449
1453 uuids = m_PrimObjects[localID]; 1450 uuids = m_PrimObjects[localID];
1454
1455
1456 foreach (UUID itemID in uuids)
1457 {
1458 IScriptInstance instance = null;
1459 try
1460 {
1461 if (m_Scripts.ContainsKey(itemID))
1462 instance = m_Scripts[itemID];
1463 }
1464 catch { /* ignore race conditions */ }
1465 1451
1466 if (instance != null) 1452 foreach (UUID itemID in uuids)
1467 { 1453 {
1468 instance.PostEvent(p); 1454 IScriptInstance instance = null;
1469 result = true; 1455 try
1456 {
1457 if (m_Scripts.ContainsKey(itemID))
1458 instance = m_Scripts[itemID];
1459 }
1460 catch { /* ignore race conditions */ }
1461
1462 if (instance != null)
1463 {
1464 instance.PostEvent(p);
1465 result = true;
1466 }
1470 } 1467 }
1471 } 1468 }
1472 }
1473 1469
1474 return result; 1470 return result;
1475 } 1471 }
@@ -1594,6 +1590,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1594 } 1590 }
1595 } 1591 }
1596 1592
1593 public void SetRunEnable(UUID instanceID, bool enable)
1594 {
1595 IScriptInstance instance = GetInstance(instanceID);
1596 if (instance != null)
1597 instance.Run = enable;
1598 }
1599
1597 public bool GetScriptState(UUID itemID) 1600 public bool GetScriptState(UUID itemID)
1598 { 1601 {
1599 IScriptInstance instance = GetInstance(itemID); 1602 IScriptInstance instance = GetInstance(itemID);