diff options
author | Melanie Thielker | 2008-11-08 02:24:34 +0000 |
---|---|---|
committer | Melanie Thielker | 2008-11-08 02:24:34 +0000 |
commit | 833f5e8bed5b36501c4579859e380038400ecb75 (patch) | |
tree | c785b4178baa18f49490e572f3013e531921e349 /OpenSim | |
parent | * Correct catch changed on last commit, since I just realized I started makin... (diff) | |
download | opensim-SC-833f5e8bed5b36501c4579859e380038400ecb75.zip opensim-SC-833f5e8bed5b36501c4579859e380038400ecb75.tar.gz opensim-SC-833f5e8bed5b36501c4579859e380038400ecb75.tar.bz2 opensim-SC-833f5e8bed5b36501c4579859e380038400ecb75.tar.xz |
Refactor IEventReceiver back into IScriptEngine
Diffstat (limited to 'OpenSim')
15 files changed, 110 insertions, 105 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 4b8df37..ab2b336 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs | |||
@@ -2100,6 +2100,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2100 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); | 2100 | SceneObjectGroup sceneObject = m_serialiser.DeserializeGroupFromXml2(objXMLData); |
2101 | AddRestoredSceneObject(sceneObject, true, false); | 2101 | AddRestoredSceneObject(sceneObject, true, false); |
2102 | 2102 | ||
2103 | sceneObject.CreateScriptInstances(0, false, DefaultScriptEngine); | ||
2104 | |||
2103 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); | 2105 | SceneObjectPart RootPrim = GetSceneObjectPart(primID); |
2104 | if (RootPrim != null) | 2106 | if (RootPrim != null) |
2105 | { | 2107 | { |
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index 9911fec..269afaa 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -44,7 +44,7 @@ using OpenSim.Region.ScriptEngine.Shared.ScriptBase; | |||
44 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 44 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
45 | { | 45 | { |
46 | [Serializable] | 46 | [Serializable] |
47 | public class ScriptEngine : IRegionModule, IEventReceiver, IScriptModule | 47 | public class ScriptEngine : IRegionModule, IScriptEngine, IScriptModule |
48 | { | 48 | { |
49 | private static readonly ILog m_log = | 49 | private static readonly ILog m_log = |
50 | LogManager.GetLogger( | 50 | LogManager.GetLogger( |
@@ -388,5 +388,20 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
388 | { | 388 | { |
389 | return m_ScriptManager.GetApi(itemID, name); | 389 | return m_ScriptManager.GetApi(itemID, name); |
390 | } | 390 | } |
391 | |||
392 | public IScriptWorkItem QueueEventHandler(Object o) | ||
393 | { | ||
394 | return null; | ||
395 | } | ||
396 | |||
397 | public string GetAssemblyName(UUID itemID) | ||
398 | { | ||
399 | return ""; | ||
400 | } | ||
401 | |||
402 | public string GetXMLState(UUID itemID) | ||
403 | { | ||
404 | return ""; | ||
405 | } | ||
391 | } | 406 | } |
392 | } | 407 | } |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs b/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs deleted file mode 100644 index 898d670..0000000 --- a/OpenSim/Region/ScriptEngine/Interfaces/IEventReceiver.cs +++ /dev/null | |||
@@ -1,71 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (c) Contributors, http://opensimulator.org/ | ||
3 | * See CONTRIBUTORS.TXT for a full list of copyright holders. | ||
4 | * | ||
5 | * Redistribution and use in source and binary forms, with or without | ||
6 | * modification, are permitted provided that the following conditions are met: | ||
7 | * * Redistributions of source code must retain the above copyright | ||
8 | * notice, this list of conditions and the following disclaimer. | ||
9 | * * Redistributions in binary form must reproduce the above copyright | ||
10 | * notice, this list of conditions and the following disclaimer in the | ||
11 | * documentation and/or other materials provided with the distribution. | ||
12 | * * Neither the name of the OpenSim Project nor the | ||
13 | * names of its contributors may be used to endorse or promote products | ||
14 | * derived from this software without specific prior written permission. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY | ||
17 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
18 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
19 | * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY | ||
20 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
21 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
22 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
23 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | using log4net; | ||
29 | using System; | ||
30 | using OpenSim.Region.ScriptEngine.Shared; | ||
31 | using OpenSim.Region.Environment.Scenes; | ||
32 | using OpenMetaverse; | ||
33 | using Nini.Config; | ||
34 | using OpenSim.Region.ScriptEngine.Interfaces; | ||
35 | using Amib.Threading; | ||
36 | using OpenSim.Framework; | ||
37 | |||
38 | namespace OpenSim.Region.ScriptEngine.Interfaces | ||
39 | { | ||
40 | /// <summary> | ||
41 | /// An interface for a script API module to communicate with | ||
42 | /// the engine it's running under | ||
43 | /// </summary> | ||
44 | public interface IEventReceiver | ||
45 | { | ||
46 | Scene World { get; } | ||
47 | |||
48 | /// <summary> | ||
49 | /// Post an event to a single script | ||
50 | /// </summary> | ||
51 | bool PostScriptEvent(UUID itemID, EventParams parms); | ||
52 | |||
53 | /// <summary> | ||
54 | /// Post event to an entire prim | ||
55 | /// </summary> | ||
56 | bool PostObjectEvent(uint localID, EventParams parms); | ||
57 | |||
58 | DetectParams GetDetectParams(UUID item, int number); | ||
59 | int GetStartParameter(UUID itemID); | ||
60 | |||
61 | void SetScriptState(UUID itemID, bool state); | ||
62 | bool GetScriptState(UUID itemID); | ||
63 | void SetState(UUID itemID, string newState); | ||
64 | void ApiResetScript(UUID itemID); | ||
65 | void ResetScript(UUID itemID); | ||
66 | IConfig Config { get; } | ||
67 | string ScriptEngineName { get; } | ||
68 | ILog Log { get; } | ||
69 | IScriptApi GetApi(UUID itemID, string name); | ||
70 | } | ||
71 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs index 13f043d..e94de68 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptApi.cs | |||
@@ -38,6 +38,6 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
38 | // Each API has an identifier, which is used to load the | 38 | // Each API has an identifier, which is used to load the |
39 | // proper runtime assembly at load time. | 39 | // proper runtime assembly at load time. |
40 | // | 40 | // |
41 | void Initialize(IEventReceiver engine, SceneObjectPart part, uint localID, UUID item); | 41 | void Initialize(IScriptEngine engine, SceneObjectPart part, uint localID, UUID item); |
42 | } | 42 | } |
43 | } | 43 | } |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 5bd2f79..29b83dc 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | |||
@@ -33,6 +33,7 @@ using OpenMetaverse; | |||
33 | using Nini.Config; | 33 | using Nini.Config; |
34 | using OpenSim.Region.ScriptEngine.Interfaces; | 34 | using OpenSim.Region.ScriptEngine.Interfaces; |
35 | using Amib.Threading; | 35 | using Amib.Threading; |
36 | using OpenSim.Framework; | ||
36 | 37 | ||
37 | namespace OpenSim.Region.ScriptEngine.Interfaces | 38 | namespace OpenSim.Region.ScriptEngine.Interfaces |
38 | { | 39 | { |
@@ -40,11 +41,39 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
40 | /// An interface for a script API module to communicate with | 41 | /// An interface for a script API module to communicate with |
41 | /// the engine it's running under | 42 | /// the engine it's running under |
42 | /// </summary> | 43 | /// </summary> |
43 | public interface IScriptEngine : IEventReceiver | 44 | public interface IScriptEngine |
44 | { | 45 | { |
45 | /// <summary> | 46 | /// <summary> |
46 | /// Queue an event for execution | 47 | /// Queue an event for execution |
47 | /// </summary> | 48 | /// </summary> |
48 | IScriptWorkItem QueueEventHandler(object parms); | 49 | IScriptWorkItem QueueEventHandler(object parms); |
50 | |||
51 | Scene World { get; } | ||
52 | |||
53 | /// <summary> | ||
54 | /// Post an event to a single script | ||
55 | /// </summary> | ||
56 | bool PostScriptEvent(UUID itemID, EventParams parms); | ||
57 | |||
58 | /// <summary> | ||
59 | /// Post event to an entire prim | ||
60 | /// </summary> | ||
61 | bool PostObjectEvent(uint localID, EventParams parms); | ||
62 | |||
63 | DetectParams GetDetectParams(UUID item, int number); | ||
64 | int GetStartParameter(UUID itemID); | ||
65 | |||
66 | void SetScriptState(UUID itemID, bool state); | ||
67 | bool GetScriptState(UUID itemID); | ||
68 | void SetState(UUID itemID, string newState); | ||
69 | void ApiResetScript(UUID itemID); | ||
70 | void ResetScript(UUID itemID); | ||
71 | IConfig Config { get; } | ||
72 | string ScriptEngineName { get; } | ||
73 | ILog Log { get; } | ||
74 | IScriptApi GetApi(UUID itemID, string name); | ||
75 | |||
76 | string GetAssemblyName(UUID itemID); | ||
77 | string GetXMLState(UUID itemID); | ||
49 | } | 78 | } |
50 | } | 79 | } |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs index dee7970..508e00f 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptInstance.cs | |||
@@ -99,5 +99,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
99 | 99 | ||
100 | Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> LineMap | 100 | Dictionary<KeyValuePair<int, int>, KeyValuePair<int, int>> LineMap |
101 | { get; set; } | 101 | { get; set; } |
102 | |||
103 | string GetAssemblyName(); | ||
104 | string GetXMLState(); | ||
102 | } | 105 | } |
103 | } | 106 | } |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs index c828d69..71a8d0f 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/AsyncCommandManager.cs | |||
@@ -48,24 +48,24 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
48 | private static int cmdHandlerThreadCycleSleepms; | 48 | private static int cmdHandlerThreadCycleSleepms; |
49 | 49 | ||
50 | private static List<IScene> m_Scenes = new List<IScene>(); | 50 | private static List<IScene> m_Scenes = new List<IScene>(); |
51 | private static List<IEventReceiver> m_ScriptEngines = | 51 | private static List<IScriptEngine> m_ScriptEngines = |
52 | new List<IEventReceiver>(); | 52 | new List<IScriptEngine>(); |
53 | 53 | ||
54 | public IEventReceiver m_ScriptEngine; | 54 | public IScriptEngine m_ScriptEngine; |
55 | private IScene m_Scene; | 55 | private IScene m_Scene; |
56 | 56 | ||
57 | private static Dictionary<IEventReceiver, Dataserver> m_Dataserver = | 57 | private static Dictionary<IScriptEngine, Dataserver> m_Dataserver = |
58 | new Dictionary<IEventReceiver, Dataserver>(); | 58 | new Dictionary<IScriptEngine, Dataserver>(); |
59 | private static Dictionary<IEventReceiver, Timer> m_Timer = | 59 | private static Dictionary<IScriptEngine, Timer> m_Timer = |
60 | new Dictionary<IEventReceiver, Timer>(); | 60 | new Dictionary<IScriptEngine, Timer>(); |
61 | private static Dictionary<IEventReceiver, Listener> m_Listener = | 61 | private static Dictionary<IScriptEngine, Listener> m_Listener = |
62 | new Dictionary<IEventReceiver, Listener>(); | 62 | new Dictionary<IScriptEngine, Listener>(); |
63 | private static Dictionary<IEventReceiver, HttpRequest> m_HttpRequest = | 63 | private static Dictionary<IScriptEngine, HttpRequest> m_HttpRequest = |
64 | new Dictionary<IEventReceiver, HttpRequest>(); | 64 | new Dictionary<IScriptEngine, HttpRequest>(); |
65 | private static Dictionary<IEventReceiver, SensorRepeat> m_SensorRepeat = | 65 | private static Dictionary<IScriptEngine, SensorRepeat> m_SensorRepeat = |
66 | new Dictionary<IEventReceiver, SensorRepeat>(); | 66 | new Dictionary<IScriptEngine, SensorRepeat>(); |
67 | private static Dictionary<IEventReceiver, XmlRequest> m_XmlRequest = | 67 | private static Dictionary<IScriptEngine, XmlRequest> m_XmlRequest = |
68 | new Dictionary<IEventReceiver, XmlRequest>(); | 68 | new Dictionary<IScriptEngine, XmlRequest>(); |
69 | 69 | ||
70 | public Dataserver DataserverPlugin | 70 | public Dataserver DataserverPlugin |
71 | { | 71 | { |
@@ -97,12 +97,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
97 | get { return m_XmlRequest[m_ScriptEngine]; } | 97 | get { return m_XmlRequest[m_ScriptEngine]; } |
98 | } | 98 | } |
99 | 99 | ||
100 | public IEventReceiver[] ScriptEngines | 100 | public IScriptEngine[] ScriptEngines |
101 | { | 101 | { |
102 | get { return m_ScriptEngines.ToArray(); } | 102 | get { return m_ScriptEngines.ToArray(); } |
103 | } | 103 | } |
104 | 104 | ||
105 | public AsyncCommandManager(IEventReceiver _ScriptEngine) | 105 | public AsyncCommandManager(IScriptEngine _ScriptEngine) |
106 | { | 106 | { |
107 | m_ScriptEngine = _ScriptEngine; | 107 | m_ScriptEngine = _ScriptEngine; |
108 | m_Scene = m_ScriptEngine.World; | 108 | m_Scene = m_ScriptEngine.World; |
@@ -202,7 +202,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
202 | // Check XMLRPCRequests | 202 | // Check XMLRPCRequests |
203 | m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); | 203 | m_XmlRequest[m_ScriptEngines[0]].CheckXMLRPCRequests(); |
204 | 204 | ||
205 | foreach (IEventReceiver s in m_ScriptEngines) | 205 | foreach (IScriptEngine s in m_ScriptEngines) |
206 | { | 206 | { |
207 | // Check Listeners | 207 | // Check Listeners |
208 | m_Listener[s].CheckListeners(); | 208 | m_Listener[s].CheckListeners(); |
@@ -223,7 +223,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
223 | /// </summary> | 223 | /// </summary> |
224 | /// <param name="localID"></param> | 224 | /// <param name="localID"></param> |
225 | /// <param name="itemID"></param> | 225 | /// <param name="itemID"></param> |
226 | public static void RemoveScript(IEventReceiver engine, uint localID, UUID itemID) | 226 | public static void RemoveScript(IScriptEngine engine, uint localID, UUID itemID) |
227 | { | 227 | { |
228 | // Remove a specific script | 228 | // Remove a specific script |
229 | 229 | ||
@@ -250,7 +250,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
250 | 250 | ||
251 | } | 251 | } |
252 | 252 | ||
253 | public static Object[] GetSerializationData(IEventReceiver engine, UUID itemID) | 253 | public static Object[] GetSerializationData(IScriptEngine engine, UUID itemID) |
254 | { | 254 | { |
255 | List<Object> data = new List<Object>(); | 255 | List<Object> data = new List<Object>(); |
256 | 256 | ||
@@ -281,7 +281,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
281 | return data.ToArray(); | 281 | return data.ToArray(); |
282 | } | 282 | } |
283 | 283 | ||
284 | public static void CreateFromData(IEventReceiver engine, uint localID, | 284 | public static void CreateFromData(IScriptEngine engine, uint localID, |
285 | UUID itemID, UUID hostID, Object[] data) | 285 | UUID itemID, UUID hostID, Object[] data) |
286 | { | 286 | { |
287 | int idx = 0; | 287 | int idx = 0; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 123f98f..59f5ccd 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -66,7 +66,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
66 | /// </summary> | 66 | /// </summary> |
67 | public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi | 67 | public class LSL_Api : MarshalByRefObject, ILSL_Api, IScriptApi |
68 | { | 68 | { |
69 | protected IEventReceiver m_ScriptEngine; | 69 | protected IScriptEngine m_ScriptEngine; |
70 | protected SceneObjectPart m_host; | 70 | protected SceneObjectPart m_host; |
71 | protected uint m_localID; | 71 | protected uint m_localID; |
72 | protected UUID m_itemID; | 72 | protected UUID m_itemID; |
@@ -80,7 +80,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
80 | 80 | ||
81 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | 81 | //private static readonly log4net.ILog m_log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
82 | 82 | ||
83 | public void Initialize(IEventReceiver ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) | 83 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) |
84 | { | 84 | { |
85 | m_ScriptEngine = ScriptEngine; | 85 | m_ScriptEngine = ScriptEngine; |
86 | m_host = host; | 86 | m_host = host; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs index 787d951..f9302e9 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs | |||
@@ -99,7 +99,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
99 | [Serializable] | 99 | [Serializable] |
100 | public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi | 100 | public class OSSL_Api : MarshalByRefObject, IOSSL_Api, IScriptApi |
101 | { | 101 | { |
102 | internal IEventReceiver m_ScriptEngine; | 102 | internal IScriptEngine m_ScriptEngine; |
103 | internal ILSL_Api m_LSL_Api; // get a reference to the LSL API so we can call methods housed there | 103 | internal ILSL_Api m_LSL_Api; // get a reference to the LSL API so we can call methods housed there |
104 | internal SceneObjectPart m_host; | 104 | internal SceneObjectPart m_host; |
105 | internal uint m_localID; | 105 | internal uint m_localID; |
@@ -110,7 +110,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
110 | internal float m_ScriptDistanceFactor = 1.0f; | 110 | internal float m_ScriptDistanceFactor = 1.0f; |
111 | internal Dictionary<string, List<UUID> > m_FunctionPerms = new Dictionary<string, List<UUID> >(); | 111 | internal Dictionary<string, List<UUID> > m_FunctionPerms = new Dictionary<string, List<UUID> >(); |
112 | 112 | ||
113 | public void Initialize(IEventReceiver ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) | 113 | public void Initialize(IScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID) |
114 | { | 114 | { |
115 | m_ScriptEngine = ScriptEngine; | 115 | m_ScriptEngine = ScriptEngine; |
116 | m_host = host; | 116 | m_host = host; |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs index 0c77a9d..f5a965b 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/HttpRequest.cs | |||
@@ -77,7 +77,7 @@ 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 (IEventReceiver e in m_CmdManager.ScriptEngines) | 80 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
81 | { | 81 | { |
82 | if (e.PostObjectEvent(httpInfo.localID, | 82 | if (e.PostObjectEvent(httpInfo.localID, |
83 | new EventParams("http_response", | 83 | new EventParams("http_response", |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs index 59d5060..b72d17c 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/Listener.cs | |||
@@ -67,7 +67,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Plugins | |||
67 | new LSL_Types.LSLString(lInfo.GetMessage()) | 67 | new LSL_Types.LSLString(lInfo.GetMessage()) |
68 | }; | 68 | }; |
69 | 69 | ||
70 | foreach (IEventReceiver e in m_CmdManager.ScriptEngines) | 70 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
71 | { | 71 | { |
72 | e.PostScriptEvent( | 72 | e.PostScriptEvent( |
73 | lInfo.GetItemID(), new EventParams( | 73 | lInfo.GetItemID(), new EventParams( |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs index 1c1ea0b..a7699a1 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/Plugins/XmlRequest.cs | |||
@@ -71,7 +71,7 @@ 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 (IEventReceiver e in m_CmdManager.ScriptEngines) | 74 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
75 | { | 75 | { |
76 | if (e.PostScriptEvent( | 76 | if (e.PostScriptEvent( |
77 | rInfo.GetItemID(), new EventParams( | 77 | rInfo.GetItemID(), new EventParams( |
@@ -100,7 +100,7 @@ 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 (IEventReceiver e in m_CmdManager.ScriptEngines) | 103 | foreach (IScriptEngine e in m_CmdManager.ScriptEngines) |
104 | { | 104 | { |
105 | if (e.PostScriptEvent( | 105 | if (e.PostScriptEvent( |
106 | srdInfo.m_itemID, new EventParams( | 106 | srdInfo.m_itemID, new EventParams( |
diff --git a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs index c6026fb..bc75ed5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs +++ b/OpenSim/Region/ScriptEngine/Shared/CodeTools/Compiler.cs | |||
@@ -83,8 +83,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.CodeTools | |||
83 | // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files | 83 | // private static int instanceID = new Random().Next(0, int.MaxValue); // Unique number to use on our compiled files |
84 | private static UInt64 scriptCompileCounter = 0; // And a counter | 84 | private static UInt64 scriptCompileCounter = 0; // And a counter |
85 | 85 | ||
86 | public IEventReceiver m_scriptEngine; | 86 | public IScriptEngine m_scriptEngine; |
87 | public Compiler(IEventReceiver scriptEngine) | 87 | public Compiler(IScriptEngine scriptEngine) |
88 | { | 88 | { |
89 | m_scriptEngine = scriptEngine; | 89 | m_scriptEngine = scriptEngine; |
90 | ReadConfig(); | 90 | ReadConfig(); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs index 98d7bbe..30f03ac 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Instance/ScriptInstance.cs | |||
@@ -848,5 +848,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Instance | |||
848 | 848 | ||
849 | return e.ToString(); | 849 | return e.ToString(); |
850 | } | 850 | } |
851 | |||
852 | public string GetAssemblyName() | ||
853 | { | ||
854 | return m_Assembly; | ||
855 | } | ||
856 | |||
857 | public string GetXMLState() | ||
858 | { | ||
859 | Stop(100); | ||
860 | return ScriptSerializer.Serialize(this); | ||
861 | } | ||
851 | } | 862 | } |
852 | } | 863 | } |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 9a4cb8b..221562e 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -985,5 +985,21 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
985 | controllingClient.AgentId); | 985 | controllingClient.AgentId); |
986 | } | 986 | } |
987 | } | 987 | } |
988 | |||
989 | public string GetAssemblyName(UUID itemID) | ||
990 | { | ||
991 | IScriptInstance instance = GetInstance(itemID); | ||
992 | if (instance == null) | ||
993 | return null; | ||
994 | return instance.GetAssemblyName(); | ||
995 | } | ||
996 | |||
997 | public string GetXMLState(UUID itemID) | ||
998 | { | ||
999 | IScriptInstance instance = GetInstance(itemID); | ||
1000 | if (instance == null) | ||
1001 | return null; | ||
1002 | return instance.GetXMLState(); | ||
1003 | } | ||
988 | } | 1004 | } |
989 | } | 1005 | } |