aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XEngine
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs2
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XEngine.cs24
-rw-r--r--OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs6
3 files changed, 11 insertions, 21 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs b/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs
index f0640da..87ea9c4 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
29// Build Number 29// Build Number
30// Revision 30// Revision
31// 31//
32[assembly: AssemblyVersion("0.7.6.*")] 32[assembly: AssemblyVersion("0.8.0.*")]
33 33
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
index 61985e8..2713080 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs
@@ -551,7 +551,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
551 /// <param name="instance"></param> 551 /// <param name="instance"></param>
552 /// <param name="keySelector">Basis on which to sort output. Can be null if no sort needs to take place</param> 552 /// <param name="keySelector">Basis on which to sort output. Can be null if no sort needs to take place</param>
553 private void HandleScriptsAction<TKey>( 553 private void HandleScriptsAction<TKey>(
554 string[] cmdparams, Action<IScriptInstance> action, Func<IScriptInstance, TKey> keySelector) 554 string[] cmdparams, Action<IScriptInstance> action, System.Func<IScriptInstance, TKey> keySelector)
555 { 555 {
556 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene)) 556 if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene))
557 return; 557 return;
@@ -1633,7 +1633,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1633 startInfo.MaxWorkerThreads = maxThreads; 1633 startInfo.MaxWorkerThreads = maxThreads;
1634 startInfo.MinWorkerThreads = minThreads; 1634 startInfo.MinWorkerThreads = minThreads;
1635 startInfo.ThreadPriority = threadPriority;; 1635 startInfo.ThreadPriority = threadPriority;;
1636 startInfo.StackSize = stackSize; 1636 startInfo.MaxStackSize = stackSize;
1637 startInfo.StartSuspended = true; 1637 startInfo.StartSuspended = true;
1638 1638
1639 m_ThreadPool = new SmartThreadPool(startInfo); 1639 m_ThreadPool = new SmartThreadPool(startInfo);
@@ -1827,9 +1827,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1827 public bool GetScriptState(UUID itemID) 1827 public bool GetScriptState(UUID itemID)
1828 { 1828 {
1829 IScriptInstance instance = GetInstance(itemID); 1829 IScriptInstance instance = GetInstance(itemID);
1830 if (instance != null) 1830 return instance != null && instance.Running;
1831 return instance.Running;
1832 return false;
1833 } 1831 }
1834 1832
1835 [DebuggerNonUserCode] 1833 [DebuggerNonUserCode]
@@ -1874,9 +1872,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1874 public DetectParams GetDetectParams(UUID itemID, int idx) 1872 public DetectParams GetDetectParams(UUID itemID, int idx)
1875 { 1873 {
1876 IScriptInstance instance = GetInstance(itemID); 1874 IScriptInstance instance = GetInstance(itemID);
1877 if (instance != null) 1875 return instance != null ? instance.GetDetectParams(idx) : null;
1878 return instance.GetDetectParams(idx);
1879 return null;
1880 } 1876 }
1881 1877
1882 public void SetMinEventDelay(UUID itemID, double delay) 1878 public void SetMinEventDelay(UUID itemID, double delay)
@@ -1889,9 +1885,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1889 public UUID GetDetectID(UUID itemID, int idx) 1885 public UUID GetDetectID(UUID itemID, int idx)
1890 { 1886 {
1891 IScriptInstance instance = GetInstance(itemID); 1887 IScriptInstance instance = GetInstance(itemID);
1892 if (instance != null) 1888 return instance != null ? instance.GetDetectID(idx) : UUID.Zero;
1893 return instance.GetDetectID(idx);
1894 return UUID.Zero;
1895 } 1889 }
1896 1890
1897 [DebuggerNonUserCode] 1891 [DebuggerNonUserCode]
@@ -1906,9 +1900,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1906 public int GetStartParameter(UUID itemID) 1900 public int GetStartParameter(UUID itemID)
1907 { 1901 {
1908 IScriptInstance instance = GetInstance(itemID); 1902 IScriptInstance instance = GetInstance(itemID);
1909 if (instance == null) 1903 return instance == null ? 0 : instance.StartParam;
1910 return 0;
1911 return instance.StartParam;
1912 } 1904 }
1913 1905
1914 public void OnShutdown() 1906 public void OnShutdown()
@@ -1941,9 +1933,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine
1941 public IScriptApi GetApi(UUID itemID, string name) 1933 public IScriptApi GetApi(UUID itemID, string name)
1942 { 1934 {
1943 IScriptInstance instance = GetInstance(itemID); 1935 IScriptInstance instance = GetInstance(itemID);
1944 if (instance == null) 1936 return instance == null ? null : instance.GetApi(name);
1945 return null;
1946 return instance.GetApi(name);
1947 } 1937 }
1948 1938
1949 public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) 1939 public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID)
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
index 8dd7677..9d9dee1 100644
--- a/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
+++ b/OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs
@@ -52,16 +52,16 @@ namespace OpenSim.Region.ScriptEngine.XEngine
52 return wr.Cancel(); 52 return wr.Cancel();
53 } 53 }
54 54
55 public void Abort() 55 public bool Abort()
56 { 56 {
57 wr.Abort(); 57 return wr.Cancel(true);
58 } 58 }
59 59
60 public bool Wait(int t) 60 public bool Wait(int t)
61 { 61 {
62 // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the 62 // We use the integer version of WaitAll because the current version of SmartThreadPool has a bug with the
63 // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an 63 // TimeSpan version. The number of milliseconds in TimeSpan is an int64 so when STP casts it down to an
64 // int (32-bit) we can end up with bad values. This occurs on Windows though curious not on Mono 2.10.8 64 // int (32-bit) we can end up with bad values. This occurs on Windows though curiously not on Mono 2.10.8
65 // (or very likely other versions of Mono at least up until 3.0.3). 65 // (or very likely other versions of Mono at least up until 3.0.3).
66 return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false); 66 return SmartThreadPool.WaitAll(new IWorkItemResult[] {wr}, t, false);
67 } 67 }