diff options
author | lbsa71 | 2008-06-24 21:09:49 +0000 |
---|---|---|
committer | lbsa71 | 2008-06-24 21:09:49 +0000 |
commit | 6b7930104bdb845d3b9c085dc04f52b6446f23b1 (patch) | |
tree | 05ee45781a455817fa400bb99f30f4d19d4eb1f8 /OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs | |
parent | based on positive feedback on performance of making keys fixed length (diff) | |
download | opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.zip opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.gz opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.bz2 opensim-SC-6b7930104bdb845d3b9c085dc04f52b6446f23b1.tar.xz |
* Applied patch from Melanie, mantis issue #1581 - "Refactor LSL language, api and compiler out of XEngine"
"First stage in a major Script Engine refactor, that will result in the LSL implementaions ebing reconverged. Not there yet, but one major part is done."
Thank you, Melanie!
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs (renamed from OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs) | 72 |
1 files changed, 56 insertions, 16 deletions
diff --git a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index fdad5b0..8c967a2 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -32,11 +32,12 @@ using System.Threading; | |||
32 | using libsecondlife; | 32 | using libsecondlife; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Region.Environment.Interfaces; | 34 | using OpenSim.Region.Environment.Interfaces; |
35 | using OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins; | 35 | using OpenSim.Region.ScriptEngine.Interfaces; |
36 | using Timer=OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins.Timer; | 36 | using OpenSim.Region.ScriptEngine.Shared; |
37 | using Dataserver=OpenSim.Region.ScriptEngine.XEngine.AsyncCommandPlugins.Dataserver; | 37 | using OpenSim.Region.ScriptEngine.Shared.Api.Plugins; |
38 | using Timer=OpenSim.Region.ScriptEngine.Shared.Api.Plugins.Timer; | ||
38 | 39 | ||
39 | namespace OpenSim.Region.ScriptEngine.XEngine | 40 | namespace OpenSim.Region.ScriptEngine.Shared.Api |
40 | { | 41 | { |
41 | /// <summary> | 42 | /// <summary> |
42 | /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc. | 43 | /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc. |
@@ -46,18 +47,57 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
46 | private static Thread cmdHandlerThread; | 47 | private static Thread cmdHandlerThread; |
47 | private static int cmdHandlerThreadCycleSleepms; | 48 | private static int cmdHandlerThreadCycleSleepms; |
48 | 49 | ||
49 | public XEngine m_ScriptEngine; | 50 | private static List<AsyncCommandManager> m_Managers = new List<AsyncCommandManager>(); |
51 | public IScriptEngine m_ScriptEngine; | ||
50 | 52 | ||
51 | public Dataserver m_Dataserver; | 53 | private Dataserver m_Dataserver; |
52 | public Timer m_Timer; | 54 | private Timer m_Timer; |
53 | public HttpRequest m_HttpRequest; | 55 | private HttpRequest m_HttpRequest; |
54 | public Listener m_Listener; | 56 | private Listener m_Listener; |
55 | public SensorRepeat m_SensorRepeat; | 57 | private SensorRepeat m_SensorRepeat; |
56 | public XmlRequest m_XmlRequest; | 58 | private XmlRequest m_XmlRequest; |
57 | 59 | ||
58 | public AsyncCommandManager(XEngine _ScriptEngine) | 60 | public Dataserver DataserverPlugin |
61 | { | ||
62 | get { return m_Dataserver; } | ||
63 | } | ||
64 | |||
65 | public Timer TimerPlugin | ||
66 | { | ||
67 | get { return m_Timer; } | ||
68 | } | ||
69 | |||
70 | public HttpRequest HttpRequestPlugin | ||
71 | { | ||
72 | get { return m_HttpRequest; } | ||
73 | } | ||
74 | |||
75 | public Listener ListenerPlugin | ||
76 | { | ||
77 | get { return m_Listener; } | ||
78 | } | ||
79 | |||
80 | public SensorRepeat SensorRepeatPlugin | ||
81 | { | ||
82 | get { return m_SensorRepeat; } | ||
83 | } | ||
84 | |||
85 | public XmlRequest XmlRequestPlugin | ||
86 | { | ||
87 | get { return m_XmlRequest; } | ||
88 | } | ||
89 | |||
90 | public AsyncCommandManager[] Managers | ||
91 | { | ||
92 | get { return m_Managers.ToArray(); } | ||
93 | } | ||
94 | |||
95 | public AsyncCommandManager(IScriptEngine _ScriptEngine) | ||
59 | { | 96 | { |
60 | m_ScriptEngine = _ScriptEngine; | 97 | m_ScriptEngine = _ScriptEngine; |
98 | if(!m_Managers.Contains(this)) | ||
99 | m_Managers.Add(this); | ||
100 | |||
61 | ReadConfig(); | 101 | ReadConfig(); |
62 | 102 | ||
63 | // Create instances of all plugins | 103 | // Create instances of all plugins |
@@ -87,7 +127,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
87 | 127 | ||
88 | public void ReadConfig() | 128 | public void ReadConfig() |
89 | { | 129 | { |
90 | cmdHandlerThreadCycleSleepms = m_ScriptEngine.ScriptConfigSource.GetInt("AsyncLLCommandLoopms", 100); | 130 | cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100); |
91 | } | 131 | } |
92 | 132 | ||
93 | ~AsyncCommandManager() | 133 | ~AsyncCommandManager() |
@@ -119,9 +159,9 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
119 | { | 159 | { |
120 | Thread.Sleep(cmdHandlerThreadCycleSleepms); | 160 | Thread.Sleep(cmdHandlerThreadCycleSleepms); |
121 | 161 | ||
122 | foreach (XEngine xe in XEngine.ScriptEngines) | 162 | foreach (AsyncCommandManager m in m_Managers) |
123 | { | 163 | { |
124 | xe.m_ASYNCLSLCommandManager.DoOneCmdHandlerPass(); | 164 | m.DoOneCmdHandlerPass(); |
125 | } | 165 | } |
126 | } | 166 | } |
127 | } | 167 | } |
@@ -131,7 +171,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
131 | } | 171 | } |
132 | } | 172 | } |
133 | 173 | ||
134 | internal void DoOneCmdHandlerPass() | 174 | public void DoOneCmdHandlerPass() |
135 | { | 175 | { |
136 | // Check timers | 176 | // Check timers |
137 | m_Timer.CheckTimerEvents(); | 177 | m_Timer.CheckTimerEvents(); |