diff options
author | Melanie Thielker | 2008-09-24 02:58:05 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-09-24 02:58:05 +0000 |
commit | 218902bedc7f430c8401426a1cee373bfc0b5485 (patch) | |
tree | dea8a685e3663c50013c220a120bd20f7aba7e7a /OpenSim | |
parent | Update svn properties, formatting cleanup. (diff) | |
download | opensim-SC-218902bedc7f430c8401426a1cee373bfc0b5485.zip opensim-SC-218902bedc7f430c8401426a1cee373bfc0b5485.tar.gz opensim-SC-218902bedc7f430c8401426a1cee373bfc0b5485.tar.bz2 opensim-SC-218902bedc7f430c8401426a1cee373bfc0b5485.tar.xz |
Decouple AsyncCommands from XEngine and the script instance. Make
all methods needed outside the API ststic. Async command processing
is now wholly internal to the API. This sets the stage for the next
convergence step.
Diffstat (limited to '')
8 files changed, 113 insertions, 102 deletions
diff --git a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs index 3132eb7..6a7b622 100644 --- a/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/Environment/Modules/Avatar/Chat/ChatModule.cs | |||
@@ -113,6 +113,9 @@ namespace OpenSim.Region.Environment.Modules.Avatar.Chat | |||
113 | if (c.Channel == DEBUG_CHANNEL) | 113 | if (c.Channel == DEBUG_CHANNEL) |
114 | c.Type = ChatTypeEnum.DebugChannel; | 114 | c.Type = ChatTypeEnum.DebugChannel; |
115 | 115 | ||
116 | if (c.Message.Length > 1100) | ||
117 | c.Message = c.Message.Substring(0, 1000); | ||
118 | |||
116 | // chat works by redistributing every incoming chat | 119 | // chat works by redistributing every incoming chat |
117 | // message to each avatar in the scene | 120 | // message to each avatar in the scene |
118 | Vector3 pos = new Vector3(128, 128, 30); | 121 | Vector3 pos = new Vector3(128, 128, 30); |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 64e8c80..51d5006 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | |||
@@ -44,7 +44,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
44 | { | 44 | { |
45 | Scene World { get; } | 45 | Scene World { get; } |
46 | IConfig Config { get; } | 46 | IConfig Config { get; } |
47 | Object AsyncCommands { get; } | ||
48 | ILog Log { get; } | 47 | ILog Log { get; } |
49 | string ScriptEngineName { get; } | 48 | string ScriptEngineName { get; } |
50 | 49 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index f331b5c..fabcc2c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -47,66 +47,86 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
47 | private static Thread cmdHandlerThread; | 47 | private static Thread cmdHandlerThread; |
48 | private static int cmdHandlerThreadCycleSleepms; | 48 | private static int cmdHandlerThreadCycleSleepms; |
49 | 49 | ||
50 | private static List<AsyncCommandManager> m_Managers = new List<AsyncCommandManager>(); | 50 | private static List<IScene> m_Scenes = new List<IScene>(); |
51 | public IScriptEngine m_ScriptEngine; | 51 | private static List<IScriptEngine> m_ScriptEngines = |
52 | new List<IScriptEngine>(); | ||
52 | 53 | ||
53 | private Dataserver m_Dataserver; | 54 | public IScriptEngine m_ScriptEngine; |
54 | private Timer m_Timer; | 55 | private IScene m_Scene; |
55 | private HttpRequest m_HttpRequest; | 56 | |
56 | private Listener m_Listener; | 57 | private static Dictionary<IScene, Dataserver> m_Dataserver = |
57 | private SensorRepeat m_SensorRepeat; | 58 | new Dictionary<IScene, Dataserver>(); |
58 | private XmlRequest m_XmlRequest; | 59 | private static Dictionary<IScene, Timer> m_Timer = |
60 | new Dictionary<IScene, Timer>(); | ||
61 | private static Dictionary<IScene, Listener> m_Listener = | ||
62 | new Dictionary<IScene, Listener>(); | ||
63 | private static Dictionary<IScene, HttpRequest> m_HttpRequest = | ||
64 | new Dictionary<IScene, HttpRequest>(); | ||
65 | private static Dictionary<IScene, SensorRepeat> m_SensorRepeat = | ||
66 | new Dictionary<IScene, SensorRepeat>(); | ||
67 | private static Dictionary<IScene, XmlRequest> m_XmlRequest = | ||
68 | new Dictionary<IScene, XmlRequest>(); | ||
59 | 69 | ||
60 | public Dataserver DataserverPlugin | 70 | public Dataserver DataserverPlugin |
61 | { | 71 | { |
62 | get { return m_Dataserver; } | 72 | get { return m_Dataserver[m_Scene]; } |
63 | } | 73 | } |
64 | 74 | ||
65 | public Timer TimerPlugin | 75 | public Timer TimerPlugin |
66 | { | 76 | { |
67 | get { return m_Timer; } | 77 | get { return m_Timer[m_Scene]; } |
68 | } | 78 | } |
69 | 79 | ||
70 | public HttpRequest HttpRequestPlugin | 80 | public HttpRequest HttpRequestPlugin |
71 | { | 81 | { |
72 | get { return m_HttpRequest; } | 82 | get { return m_HttpRequest[m_Scene]; } |
73 | } | 83 | } |
74 | 84 | ||
75 | public Listener ListenerPlugin | 85 | public Listener ListenerPlugin |
76 | { | 86 | { |
77 | get { return m_Listener; } | 87 | get { return m_Listener[m_Scene]; } |
78 | } | 88 | } |
79 | 89 | ||
80 | public SensorRepeat SensorRepeatPlugin | 90 | public SensorRepeat SensorRepeatPlugin |
81 | { | 91 | { |
82 | get { return m_SensorRepeat; } | 92 | get { return m_SensorRepeat[m_Scene]; } |
83 | } | 93 | } |
84 | 94 | ||
85 | public XmlRequest XmlRequestPlugin | 95 | public XmlRequest XmlRequestPlugin |
86 | { | 96 | { |
87 | get { return m_XmlRequest; } | 97 | get { return m_XmlRequest[m_Scene]; } |
88 | } | 98 | } |
89 | 99 | ||
90 | public AsyncCommandManager[] Managers | 100 | public IScriptEngine[] ScriptEngines |
91 | { | 101 | { |
92 | get { return m_Managers.ToArray(); } | 102 | get { return m_ScriptEngines.ToArray(); } |
93 | } | 103 | } |
94 | 104 | ||
95 | public AsyncCommandManager(IScriptEngine _ScriptEngine) | 105 | public AsyncCommandManager(IScriptEngine _ScriptEngine) |
96 | { | 106 | { |
97 | m_ScriptEngine = _ScriptEngine; | 107 | m_ScriptEngine = _ScriptEngine; |
98 | if (!m_Managers.Contains(this)) | 108 | m_Scene = m_ScriptEngine.World; |
99 | m_Managers.Add(this); | 109 | |
110 | if (!m_Scenes.Contains(m_Scene)) | ||
111 | m_Scenes.Add(m_Scene); | ||
112 | if (!m_ScriptEngines.Contains(m_ScriptEngine)) | ||
113 | m_ScriptEngines.Add(m_ScriptEngine); | ||
100 | 114 | ||
101 | ReadConfig(); | 115 | ReadConfig(); |
102 | 116 | ||
103 | // Create instances of all plugins | 117 | // Create instances of all plugins |
104 | m_Dataserver = new Dataserver(this); | 118 | if (!m_Dataserver.ContainsKey(m_Scene)) |
105 | m_Timer = new Timer(this); | 119 | m_Dataserver[m_Scene] = new Dataserver(this); |
106 | m_HttpRequest = new HttpRequest(this); | 120 | if (!m_Timer.ContainsKey(m_Scene)) |
107 | m_Listener = new Listener(this); | 121 | m_Timer[m_Scene] = new Timer(this); |
108 | m_SensorRepeat = new SensorRepeat(this); | 122 | if (!m_HttpRequest.ContainsKey(m_Scene)) |
109 | m_XmlRequest = new XmlRequest(this); | 123 | m_HttpRequest[m_Scene] = new HttpRequest(this); |
124 | if (!m_Listener.ContainsKey(m_Scene)) | ||
125 | m_Listener[m_Scene] = new Listener(this); | ||
126 | if (!m_SensorRepeat.ContainsKey(m_Scene)) | ||
127 | m_SensorRepeat[m_Scene] = new SensorRepeat(this); | ||
128 | if (!m_XmlRequest.ContainsKey(m_Scene)) | ||
129 | m_XmlRequest[m_Scene] = new XmlRequest(this); | ||
110 | 130 | ||
111 | StartThread(); | 131 | StartThread(); |
112 | } | 132 | } |
@@ -127,26 +147,28 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
127 | 147 | ||
128 | public void ReadConfig() | 148 | public void ReadConfig() |
129 | { | 149 | { |
130 | cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100); | 150 | // cmdHandlerThreadCycleSleepms = m_ScriptEngine.Config.GetInt("AsyncLLCommandLoopms", 100); |
151 | // TODO: Make this sane again | ||
152 | cmdHandlerThreadCycleSleepms = 100; | ||
131 | } | 153 | } |
132 | 154 | ||
133 | ~AsyncCommandManager() | 155 | ~AsyncCommandManager() |
134 | { | 156 | { |
135 | // Shut down thread | 157 | // Shut down thread |
136 | try | 158 | // try |
137 | { | 159 | // { |
138 | if (cmdHandlerThread != null) | 160 | // if (cmdHandlerThread != null) |
139 | { | 161 | // { |
140 | if (cmdHandlerThread.IsAlive == true) | 162 | // if (cmdHandlerThread.IsAlive == true) |
141 | { | 163 | // { |
142 | cmdHandlerThread.Abort(); | 164 | // cmdHandlerThread.Abort(); |
143 | //cmdHandlerThread.Join(); | 165 | // //cmdHandlerThread.Join(); |
144 | } | 166 | // } |
145 | } | 167 | // } |
146 | } | 168 | // } |
147 | catch | 169 | // catch |
148 | { | 170 | // { |
149 | } | 171 | // } |
150 | } | 172 | } |
151 | 173 | ||
152 | /// <summary> | 174 | /// <summary> |
@@ -162,10 +184,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
162 | { | 184 | { |
163 | Thread.Sleep(cmdHandlerThreadCycleSleepms); | 185 | Thread.Sleep(cmdHandlerThreadCycleSleepms); |
164 | 186 | ||
165 | foreach (AsyncCommandManager m in m_Managers) | 187 | DoOneCmdHandlerPass(); |
166 | { | ||
167 | m.DoOneCmdHandlerPass(); | ||
168 | } | ||
169 | } | 188 | } |
170 | } | 189 | } |
171 | catch | 190 | catch |
@@ -174,20 +193,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
174 | } | 193 | } |
175 | } | 194 | } |
176 | 195 | ||
177 | public void DoOneCmdHandlerPass() | 196 | private static void DoOneCmdHandlerPass() |
178 | { | 197 | { |
179 | // Check timers | 198 | foreach (IScene s in m_Scenes) |
180 | m_Timer.CheckTimerEvents(); | 199 | { |
181 | // Check HttpRequests | 200 | // Check timers |
182 | m_HttpRequest.CheckHttpRequests(); | 201 | m_Timer[s].CheckTimerEvents(); |
183 | // Check XMLRPCRequests | 202 | // Check HttpRequests |
184 | m_XmlRequest.CheckXMLRPCRequests(); | 203 | m_HttpRequest[s].CheckHttpRequests(); |
185 | // Check Listeners | 204 | // Check XMLRPCRequests |
186 | m_Listener.CheckListeners(); | 205 | m_XmlRequest[s].CheckXMLRPCRequests(); |
187 | // Check Sensors | 206 | // Check Listeners |
188 | m_SensorRepeat.CheckSenseRepeaterEvents(); | 207 | m_Listener[s].CheckListeners(); |
189 | // Check dataserver | 208 | // Check Sensors |
190 | m_Dataserver.ExpireRequests(); | 209 | m_SensorRepeat[s].CheckSenseRepeaterEvents(); |
210 | // Check dataserver | ||
211 | m_Dataserver[s].ExpireRequests(); | ||
212 | } | ||
191 | } | 213 | } |
192 | 214 | ||
193 | /// <summary> | 215 | /// <summary> |
@@ -195,38 +217,38 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
195 | /// </summary> | 217 | /// </summary> |
196 | /// <param name="localID"></param> | 218 | /// <param name="localID"></param> |
197 | /// <param name="itemID"></param> | 219 | /// <param name="itemID"></param> |
198 | public void RemoveScript(uint localID, UUID itemID) | 220 | public static void RemoveScript(IScene scene, uint localID, UUID itemID) |
199 | { | 221 | { |
200 | // Remove a specific script | 222 | // Remove a specific script |
201 | 223 | ||
202 | // Remove dataserver events | 224 | // Remove dataserver events |
203 | m_Dataserver.RemoveEvents(localID, itemID); | 225 | m_Dataserver[scene].RemoveEvents(localID, itemID); |
204 | 226 | ||
205 | // Remove from: Timers | 227 | // Remove from: Timers |
206 | m_Timer.UnSetTimerEvents(localID, itemID); | 228 | m_Timer[scene].UnSetTimerEvents(localID, itemID); |
207 | 229 | ||
208 | // Remove from: HttpRequest | 230 | // Remove from: HttpRequest |
209 | IHttpRequests iHttpReq = | 231 | IHttpRequests iHttpReq = |
210 | m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); | 232 | scene.RequestModuleInterface<IHttpRequests>(); |
211 | iHttpReq.StopHttpRequest(localID, itemID); | 233 | iHttpReq.StopHttpRequest(localID, itemID); |
212 | 234 | ||
213 | IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); | 235 | IWorldComm comms = scene.RequestModuleInterface<IWorldComm>(); |
214 | comms.DeleteListener(itemID); | 236 | comms.DeleteListener(itemID); |
215 | 237 | ||
216 | IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); | 238 | IXMLRPC xmlrpc = scene.RequestModuleInterface<IXMLRPC>(); |
217 | xmlrpc.DeleteChannels(itemID); | 239 | xmlrpc.DeleteChannels(itemID); |
218 | xmlrpc.CancelSRDRequests(itemID); | 240 | xmlrpc.CancelSRDRequests(itemID); |
219 | 241 | ||
220 | // Remove Sensors | 242 | // Remove Sensors |
221 | m_SensorRepeat.UnSetSenseRepeaterEvents(localID, itemID); | 243 | m_SensorRepeat[scene].UnSetSenseRepeaterEvents(localID, itemID); |
222 | 244 | ||
223 | } | 245 | } |
224 | 246 | ||
225 | public Object[] GetSerializationData(UUID itemID) | 247 | public static Object[] GetSerializationData(IScene scene, UUID itemID) |
226 | { | 248 | { |
227 | List<Object> data = new List<Object>(); | 249 | List<Object> data = new List<Object>(); |
228 | 250 | ||
229 | Object[] listeners=m_Listener.GetSerializationData(itemID); | 251 | Object[] listeners=m_Listener[scene].GetSerializationData(itemID); |
230 | if (listeners.Length > 0) | 252 | if (listeners.Length > 0) |
231 | { | 253 | { |
232 | data.Add("listener"); | 254 | data.Add("listener"); |
@@ -234,7 +256,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
234 | data.AddRange(listeners); | 256 | data.AddRange(listeners); |
235 | } | 257 | } |
236 | 258 | ||
237 | Object[] timers=m_Timer.GetSerializationData(itemID); | 259 | Object[] timers=m_Timer[scene].GetSerializationData(itemID); |
238 | if (timers.Length > 0) | 260 | if (timers.Length > 0) |
239 | { | 261 | { |
240 | data.Add("timer"); | 262 | data.Add("timer"); |
@@ -242,7 +264,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
242 | data.AddRange(timers); | 264 | data.AddRange(timers); |
243 | } | 265 | } |
244 | 266 | ||
245 | Object[] sensors=m_SensorRepeat.GetSerializationData(itemID); | 267 | Object[] sensors=m_SensorRepeat[scene].GetSerializationData(itemID); |
246 | if (sensors.Length > 0) | 268 | if (sensors.Length > 0) |
247 | { | 269 | { |
248 | data.Add("sensor"); | 270 | data.Add("sensor"); |
@@ -253,8 +275,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
253 | return data.ToArray(); | 275 | return data.ToArray(); |
254 | } | 276 | } |
255 | 277 | ||
256 | public void CreateFromData(uint localID, UUID itemID, UUID hostID, | 278 | public static void CreateFromData(IScene scene, uint localID, |
257 | Object[] data) | 279 | UUID itemID, UUID hostID, Object[] data) |
258 | { | 280 | { |
259 | int idx = 0; | 281 | int idx = 0; |
260 | int len; | 282 | int len; |
@@ -275,15 +297,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
275 | switch (type) | 297 | switch (type) |
276 | { | 298 | { |
277 | case "listener": | 299 | case "listener": |
278 | m_Listener.CreateFromData(localID, itemID, hostID, | 300 | m_Listener[scene].CreateFromData(localID, itemID, |
279 | item); | 301 | hostID, item); |
280 | break; | 302 | break; |
281 | case "timer": | 303 | case "timer": |
282 | m_Timer.CreateFromData(localID, itemID, hostID, item); | 304 | m_Timer[scene].CreateFromData(localID, itemID, |
305 | hostID, item); | ||
283 | break; | 306 | break; |
284 | case "sensor": | 307 | case "sensor": |
285 | m_SensorRepeat.CreateFromData(localID, itemID, hostID, | 308 | m_SensorRepeat[scene].CreateFromData(localID, |
286 | item); | 309 | itemID, hostID, item); |
287 | break; | 310 | break; |
288 | } | 311 | } |
289 | } | 312 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 512fcd9..552d47c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -92,7 +92,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
92 | m_ScriptDistanceFactor = config.Configs["XEngine"]. | 92 | m_ScriptDistanceFactor = config.Configs["XEngine"]. |
93 | GetFloat("ScriptDistanceLimitFactor", 1.0f); | 93 | GetFloat("ScriptDistanceLimitFactor", 1.0f); |
94 | 94 | ||
95 | AsyncCommands = (AsyncCommandManager)ScriptEngine.AsyncCommands; | 95 | AsyncCommands = new AsyncCommandManager(ScriptEngine); |
96 | } | 96 | } |
97 | 97 | ||
98 | private DateTime m_timer = DateTime.Now; | 98 | private DateTime m_timer = DateTime.Now; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs index 92f603d..3d3fb05 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs | |||
@@ -77,9 +77,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
77 | new LSL_Types.LSLString(httpInfo.response_body) | 77 | new LSL_Types.LSLString(httpInfo.response_body) |
78 | }; | 78 | }; |
79 | 79 | ||
80 | foreach (AsyncCommandManager m in m_CmdManager.Managers) | 80 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
81 | { | 81 | { |
82 | if (m.m_ScriptEngine.PostObjectEvent(httpInfo.localID, | 82 | if (e.PostObjectEvent(httpInfo.localID, |
83 | new EventParams("http_response", | 83 | new EventParams("http_response", |
84 | resobj, new DetectParams[0]))) | 84 | resobj, new DetectParams[0]))) |
85 | break; | 85 | break; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 3f3cf39..a7699a1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs | |||
@@ -71,9 +71,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
71 | new LSL_Types.LSLString(rInfo.GetStrVal()) | 71 | new LSL_Types.LSLString(rInfo.GetStrVal()) |
72 | }; | 72 | }; |
73 | 73 | ||
74 | foreach (AsyncCommandManager m in m_CmdManager.Managers) | 74 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
75 | { | 75 | { |
76 | if (m.m_ScriptEngine.PostScriptEvent( | 76 | if (e.PostScriptEvent( |
77 | rInfo.GetItemID(), new EventParams( | 77 | rInfo.GetItemID(), new EventParams( |
78 | "remote_data", resobj, | 78 | "remote_data", resobj, |
79 | new DetectParams[0]))) | 79 | new DetectParams[0]))) |
@@ -100,9 +100,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
100 | new LSL_Types.LSLString(srdInfo.sdata) | 100 | new LSL_Types.LSLString(srdInfo.sdata) |
101 | }; | 101 | }; |
102 | 102 | ||
103 | foreach (AsyncCommandManager m in m_CmdManager.Managers) | 103 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
104 | { | 104 | { |
105 | if (m.m_ScriptEngine.PostScriptEvent( | 105 | if (e.PostScriptEvent( |
106 | srdInfo.m_itemID, new EventParams( | 106 | srdInfo.m_itemID, new EventParams( |
107 | "remote_data", resobj, | 107 | "remote_data", resobj, |
108 | new DetectParams[0]))) | 108 | new DetectParams[0]))) |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 3a8c4da..14ac256 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -246,8 +246,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
246 | 246 | ||
247 | ScriptSerializer.Deserialize(xml, this); | 247 | ScriptSerializer.Deserialize(xml, this); |
248 | 248 | ||
249 | AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; | 249 | AsyncCommandManager.CreateFromData(m_Engine.World, |
250 | async.CreateFromData( | ||
251 | m_LocalID, m_ItemID, m_ObjectID, | 250 | m_LocalID, m_ItemID, m_ObjectID, |
252 | PluginData); | 251 | PluginData); |
253 | 252 | ||
@@ -337,6 +336,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
337 | public void DestroyScriptInstance() | 336 | public void DestroyScriptInstance() |
338 | { | 337 | { |
339 | ReleaseControls(); | 338 | ReleaseControls(); |
339 | AsyncCommandManager.RemoveScript(m_Engine.World, m_LocalID, m_ItemID); | ||
340 | } | 340 | } |
341 | 341 | ||
342 | public void RemoveState() | 342 | public void RemoveState() |
@@ -554,8 +554,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
554 | // m_Engine.Log.DebugFormat("[Script] Script {0}.{1} state set to {2}", | 554 | // m_Engine.Log.DebugFormat("[Script] Script {0}.{1} state set to {2}", |
555 | // m_PrimName, m_ScriptName, data.Params[0].ToString()); | 555 | // m_PrimName, m_ScriptName, data.Params[0].ToString()); |
556 | m_State=data.Params[0].ToString(); | 556 | m_State=data.Params[0].ToString(); |
557 | AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; | 557 | AsyncCommandManager.RemoveScript(m_Engine.World, |
558 | async.RemoveScript( | ||
559 | m_LocalID, m_ItemID); | 558 | m_LocalID, m_ItemID); |
560 | 559 | ||
561 | SceneObjectPart part = m_Engine.World.GetSceneObjectPart( | 560 | SceneObjectPart part = m_Engine.World.GetSceneObjectPart( |
@@ -691,8 +690,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
691 | SceneObjectPart part=m_Engine.World.GetSceneObjectPart(m_LocalID); | 690 | SceneObjectPart part=m_Engine.World.GetSceneObjectPart(m_LocalID); |
692 | part.GetInventoryItem(m_ItemID).PermsMask = 0; | 691 | part.GetInventoryItem(m_ItemID).PermsMask = 0; |
693 | part.GetInventoryItem(m_ItemID).PermsGranter = UUID.Zero; | 692 | part.GetInventoryItem(m_ItemID).PermsGranter = UUID.Zero; |
694 | AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; | 693 | AsyncCommandManager.RemoveScript(m_Engine.World, m_LocalID, m_ItemID); |
695 | async.RemoveScript(m_LocalID, m_ItemID); | ||
696 | m_EventQueue.Clear(); | 694 | m_EventQueue.Clear(); |
697 | m_Script.ResetVars(); | 695 | m_Script.ResetVars(); |
698 | m_State = "default"; | 696 | m_State = "default"; |
@@ -717,8 +715,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
717 | SceneObjectPart part=m_Engine.World.GetSceneObjectPart(m_LocalID); | 715 | SceneObjectPart part=m_Engine.World.GetSceneObjectPart(m_LocalID); |
718 | part.GetInventoryItem(m_ItemID).PermsMask = 0; | 716 | part.GetInventoryItem(m_ItemID).PermsMask = 0; |
719 | part.GetInventoryItem(m_ItemID).PermsGranter = UUID.Zero; | 717 | part.GetInventoryItem(m_ItemID).PermsGranter = UUID.Zero; |
720 | AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; | 718 | AsyncCommandManager.RemoveScript(m_Engine.World, m_LocalID, m_ItemID); |
721 | async.RemoveScript(m_LocalID, m_ItemID); | ||
722 | 719 | ||
723 | m_EventQueue.Clear(); | 720 | m_EventQueue.Clear(); |
724 | m_Script.ResetVars(); | 721 | m_Script.ResetVars(); |
@@ -775,8 +772,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
775 | return; | 772 | return; |
776 | } | 773 | } |
777 | 774 | ||
778 | AsyncCommandManager async = (AsyncCommandManager)m_Engine.AsyncCommands; | 775 | PluginData = AsyncCommandManager.GetSerializationData(m_Engine.World, m_ItemID); |
779 | PluginData = async.GetSerializationData(m_ItemID); | ||
780 | 776 | ||
781 | string xml = ScriptSerializer.Serialize(this); | 777 | string xml = ScriptSerializer.Serialize(this); |
782 | 778 | ||
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index a6416c6..2e5c627 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -76,7 +76,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
76 | #pragma warning restore 414 | 76 | #pragma warning restore 414 |
77 | private int m_EventLimit; | 77 | private int m_EventLimit; |
78 | private bool m_KillTimedOutScripts; | 78 | private bool m_KillTimedOutScripts; |
79 | private AsyncCommandManager m_AsyncCommands; | ||
80 | bool m_firstStart = true; | 79 | bool m_firstStart = true; |
81 | 80 | ||
82 | private static List<XEngine> m_ScriptEngines = | 81 | private static List<XEngine> m_ScriptEngines = |
@@ -142,11 +141,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
142 | get { return m_ScriptConfig; } | 141 | get { return m_ScriptConfig; } |
143 | } | 142 | } |
144 | 143 | ||
145 | public Object AsyncCommands | ||
146 | { | ||
147 | get { return (Object)m_AsyncCommands; } | ||
148 | } | ||
149 | |||
150 | // | 144 | // |
151 | // IRegionModule functions | 145 | // IRegionModule functions |
152 | // | 146 | // |
@@ -239,8 +233,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
239 | m_Scene.EventManager.OnStopScript += OnStopScript; | 233 | m_Scene.EventManager.OnStopScript += OnStopScript; |
240 | m_Scene.EventManager.OnShutdown += OnShutdown; | 234 | m_Scene.EventManager.OnShutdown += OnShutdown; |
241 | 235 | ||
242 | m_AsyncCommands = new AsyncCommandManager(this); | ||
243 | |||
244 | if (m_SleepTime > 0) | 236 | if (m_SleepTime > 0) |
245 | { | 237 | { |
246 | m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance), | 238 | m_ThreadPool.QueueWorkItem(new WorkItemCallback(this.DoMaintenance), |
@@ -574,8 +566,6 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
574 | if (!m_Scripts.ContainsKey(itemID)) | 566 | if (!m_Scripts.ContainsKey(itemID)) |
575 | return; | 567 | return; |
576 | 568 | ||
577 | m_AsyncCommands.RemoveScript(localID, itemID); | ||
578 | |||
579 | IScriptInstance instance=m_Scripts[itemID]; | 569 | IScriptInstance instance=m_Scripts[itemID]; |
580 | m_Scripts.Remove(itemID); | 570 | m_Scripts.Remove(itemID); |
581 | 571 | ||