diff options
Diffstat (limited to 'OpenSim/Region/ScriptEngine/XEngine')
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/Properties/AssemblyInfo.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | 28 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/XEngine/XWorkItem.cs | 6 |
3 files changed, 13 insertions, 23 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 ec35fde..452c443 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; |
@@ -609,7 +609,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
609 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene)) | 609 | if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_Scene)) |
610 | return; | 610 | return; |
611 | 611 | ||
612 | MainConsole.Instance.OutputFormat(GetStatusReport()); | 612 | MainConsole.Instance.Output(GetStatusReport()); |
613 | } | 613 | } |
614 | 614 | ||
615 | public string GetStatusReport() | 615 | public string GetStatusReport() |
@@ -708,7 +708,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
708 | sb.AppendFormat("Containing part UUID: {0}\n", instance.ObjectID); | 708 | sb.AppendFormat("Containing part UUID: {0}\n", instance.ObjectID); |
709 | sb.AppendFormat("Position : {0}\n", sop.AbsolutePosition); | 709 | sb.AppendFormat("Position : {0}\n", sop.AbsolutePosition); |
710 | 710 | ||
711 | MainConsole.Instance.OutputFormat(sb.ToString()); | 711 | MainConsole.Instance.Output(sb.ToString()); |
712 | } | 712 | } |
713 | 713 | ||
714 | private void HandleSuspendScript(IScriptInstance instance) | 714 | private void HandleSuspendScript(IScriptInstance instance) |
@@ -1632,7 +1632,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1632 | startInfo.MaxWorkerThreads = maxThreads; | 1632 | startInfo.MaxWorkerThreads = maxThreads; |
1633 | startInfo.MinWorkerThreads = minThreads; | 1633 | startInfo.MinWorkerThreads = minThreads; |
1634 | startInfo.ThreadPriority = threadPriority;; | 1634 | startInfo.ThreadPriority = threadPriority;; |
1635 | startInfo.StackSize = stackSize; | 1635 | startInfo.MaxStackSize = stackSize; |
1636 | startInfo.StartSuspended = true; | 1636 | startInfo.StartSuspended = true; |
1637 | 1637 | ||
1638 | m_ThreadPool = new SmartThreadPool(startInfo); | 1638 | m_ThreadPool = new SmartThreadPool(startInfo); |
@@ -1826,9 +1826,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1826 | public bool GetScriptState(UUID itemID) | 1826 | public bool GetScriptState(UUID itemID) |
1827 | { | 1827 | { |
1828 | IScriptInstance instance = GetInstance(itemID); | 1828 | IScriptInstance instance = GetInstance(itemID); |
1829 | if (instance != null) | 1829 | return instance != null && instance.Running; |
1830 | return instance.Running; | ||
1831 | return false; | ||
1832 | } | 1830 | } |
1833 | 1831 | ||
1834 | [DebuggerNonUserCode] | 1832 | [DebuggerNonUserCode] |
@@ -1873,9 +1871,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1873 | public DetectParams GetDetectParams(UUID itemID, int idx) | 1871 | public DetectParams GetDetectParams(UUID itemID, int idx) |
1874 | { | 1872 | { |
1875 | IScriptInstance instance = GetInstance(itemID); | 1873 | IScriptInstance instance = GetInstance(itemID); |
1876 | if (instance != null) | 1874 | return instance != null ? instance.GetDetectParams(idx) : null; |
1877 | return instance.GetDetectParams(idx); | ||
1878 | return null; | ||
1879 | } | 1875 | } |
1880 | 1876 | ||
1881 | public void SetMinEventDelay(UUID itemID, double delay) | 1877 | public void SetMinEventDelay(UUID itemID, double delay) |
@@ -1888,9 +1884,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1888 | public UUID GetDetectID(UUID itemID, int idx) | 1884 | public UUID GetDetectID(UUID itemID, int idx) |
1889 | { | 1885 | { |
1890 | IScriptInstance instance = GetInstance(itemID); | 1886 | IScriptInstance instance = GetInstance(itemID); |
1891 | if (instance != null) | 1887 | return instance != null ? instance.GetDetectID(idx) : UUID.Zero; |
1892 | return instance.GetDetectID(idx); | ||
1893 | return UUID.Zero; | ||
1894 | } | 1888 | } |
1895 | 1889 | ||
1896 | [DebuggerNonUserCode] | 1890 | [DebuggerNonUserCode] |
@@ -1905,9 +1899,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1905 | public int GetStartParameter(UUID itemID) | 1899 | public int GetStartParameter(UUID itemID) |
1906 | { | 1900 | { |
1907 | IScriptInstance instance = GetInstance(itemID); | 1901 | IScriptInstance instance = GetInstance(itemID); |
1908 | if (instance == null) | 1902 | return instance == null ? 0 : instance.StartParam; |
1909 | return 0; | ||
1910 | return instance.StartParam; | ||
1911 | } | 1903 | } |
1912 | 1904 | ||
1913 | public void OnShutdown() | 1905 | public void OnShutdown() |
@@ -1940,9 +1932,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
1940 | public IScriptApi GetApi(UUID itemID, string name) | 1932 | public IScriptApi GetApi(UUID itemID, string name) |
1941 | { | 1933 | { |
1942 | IScriptInstance instance = GetInstance(itemID); | 1934 | IScriptInstance instance = GetInstance(itemID); |
1943 | if (instance == null) | 1935 | return instance == null ? null : instance.GetApi(name); |
1944 | return null; | ||
1945 | return instance.GetApi(name); | ||
1946 | } | 1936 | } |
1947 | 1937 | ||
1948 | public void OnGetScriptRunning(IClientAPI controllingClient, UUID objectID, UUID itemID) | 1938 | 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 | } |