diff options
author | Melanie Thielker | 2009-04-10 21:08:33 +0000 |
---|---|---|
committer | Melanie Thielker | 2009-04-10 21:08:33 +0000 |
commit | 8902923b12718399edf7b6bf39ea0ff37002ae24 (patch) | |
tree | c9653ecff6ca48935438ea944e695e1503f7ffc5 | |
parent | Expose the XMLRPC listener port on the IXMLRPC interface to allow (diff) | |
download | opensim-SC_OLD-8902923b12718399edf7b6bf39ea0ff37002ae24.zip opensim-SC_OLD-8902923b12718399edf7b6bf39ea0ff37002ae24.tar.gz opensim-SC_OLD-8902923b12718399edf7b6bf39ea0ff37002ae24.tar.bz2 opensim-SC_OLD-8902923b12718399edf7b6bf39ea0ff37002ae24.tar.xz |
Introduce IXmlRpcRouter, an interface that allows registering XMLRPC
UUIDs with a central marshaller for grids, or publish the ULS for objects
elsewhere.
6 files changed, 76 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs index 6ba0068..7d7f904 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModule.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModule.cs | |||
@@ -25,15 +25,18 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | ||
28 | using OpenMetaverse; | 29 | using OpenMetaverse; |
29 | 30 | ||
30 | namespace OpenSim.Region.Framework.Interfaces | 31 | namespace OpenSim.Region.Framework.Interfaces |
31 | { | 32 | { |
32 | public interface IScriptModule | 33 | public interface IScriptModule : IRegionModule |
33 | { | 34 | { |
34 | string ScriptEngineName { get; } | 35 | string ScriptEngineName { get; } |
35 | 36 | ||
36 | string GetAssemblyName(UUID itemID); | 37 | string GetAssemblyName(UUID itemID); |
37 | string GetXMLState(UUID itemID); | 38 | string GetXMLState(UUID itemID); |
39 | |||
40 | bool PostScriptEvent(UUID itemID, string name, Object[] args); | ||
38 | } | 41 | } |
39 | } | 42 | } |
diff --git a/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs b/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs new file mode 100644 index 0000000..c38319a --- /dev/null +++ b/OpenSim/Region/Framework/Interfaces/IXmlRpcRouter.cs | |||
@@ -0,0 +1,38 @@ | |||
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 OpenMetaverse; | ||
29 | |||
30 | namespace OpenSim.Region.Framework.Interfaces | ||
31 | { | ||
32 | public interface IXmlRpcRouter | ||
33 | { | ||
34 | void RegisterNewReceiver(IScriptModule scriptEngine, UUID channelID, UUID objectID, UUID itemID, string url); | ||
35 | void ScriptRemoved(UUID itemID); | ||
36 | void ObjectRemoved(UUID objectID); | ||
37 | } | ||
38 | } | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs index b850227..34a7c7a 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptEngine.cs | |||
@@ -96,6 +96,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
96 | get { return "ScriptEngine.DotNetEngine"; } | 96 | get { return "ScriptEngine.DotNetEngine"; } |
97 | } | 97 | } |
98 | 98 | ||
99 | public IScriptModule ScriptModule | ||
100 | { | ||
101 | get { return this; } | ||
102 | } | ||
103 | |||
99 | public event ScriptRemoved OnScriptRemoved; | 104 | public event ScriptRemoved OnScriptRemoved; |
100 | public event ObjectRemoved OnObjectRemoved; | 105 | public event ObjectRemoved OnObjectRemoved; |
101 | 106 | ||
@@ -212,6 +217,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
212 | p.EventName, p.DetectParams, p.Params); | 217 | p.EventName, p.DetectParams, p.Params); |
213 | } | 218 | } |
214 | 219 | ||
220 | public bool PostScriptEvent(UUID itemID, string name, Object[] p) | ||
221 | { | ||
222 | return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); | ||
223 | } | ||
224 | |||
215 | public DetectParams GetDetectParams(UUID itemID, int number) | 225 | public DetectParams GetDetectParams(UUID itemID, int number) |
216 | { | 226 | { |
217 | uint localID = m_ScriptManager.GetLocalID(itemID); | 227 | uint localID = m_ScriptManager.GetLocalID(itemID); |
diff --git a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs index 8da46f4..fd352cf 100644 --- a/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs +++ b/OpenSim/Region/ScriptEngine/Interfaces/IScriptEngine.cs | |||
@@ -29,6 +29,7 @@ using log4net; | |||
29 | using System; | 29 | using System; |
30 | using OpenSim.Region.ScriptEngine.Shared; | 30 | using OpenSim.Region.ScriptEngine.Shared; |
31 | using OpenSim.Region.Framework.Scenes; | 31 | using OpenSim.Region.Framework.Scenes; |
32 | using OpenSim.Region.Framework.Interfaces; | ||
32 | using OpenMetaverse; | 33 | using OpenMetaverse; |
33 | using Nini.Config; | 34 | using Nini.Config; |
34 | using OpenSim.Region.ScriptEngine.Interfaces; | 35 | using OpenSim.Region.ScriptEngine.Interfaces; |
@@ -54,6 +55,8 @@ namespace OpenSim.Region.ScriptEngine.Interfaces | |||
54 | 55 | ||
55 | Scene World { get; } | 56 | Scene World { get; } |
56 | 57 | ||
58 | IScriptModule ScriptModule { get; } | ||
59 | |||
57 | event ScriptRemoved OnScriptRemoved; | 60 | event ScriptRemoved OnScriptRemoved; |
58 | event ObjectRemoved OnObjectRemoved; | 61 | event ObjectRemoved OnObjectRemoved; |
59 | 62 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index d3543ad..f4e7990 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -6108,6 +6108,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
6108 | if (xmlrpcMod.IsEnabled()) | 6108 | if (xmlrpcMod.IsEnabled()) |
6109 | { | 6109 | { |
6110 | UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero); | 6110 | UUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID, UUID.Zero); |
6111 | IXmlRpcRouter xmlRpcRouter = m_ScriptEngine.World.RequestModuleInterface<IXmlRpcRouter>(); | ||
6112 | if (xmlRpcRouter != null) | ||
6113 | xmlRpcRouter.RegisterNewReceiver(m_ScriptEngine.ScriptModule, channelID, m_host.UUID, m_itemID, "http://"+System.Environment.MachineName+":"+xmlrpcMod.Port.ToString()+"/"); | ||
6111 | object[] resobj = new object[] { new LSL_Integer(1), new LSL_String(channelID.ToString()), new LSL_String(UUID.Zero.ToString()), new LSL_String(String.Empty), new LSL_Integer(0), new LSL_String(String.Empty) }; | 6114 | object[] resobj = new object[] { new LSL_Integer(1), new LSL_String(channelID.ToString()), new LSL_String(UUID.Zero.ToString()), new LSL_String(String.Empty), new LSL_Integer(0), new LSL_String(String.Empty) }; |
6112 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( | 6115 | m_ScriptEngine.PostScriptEvent(m_itemID, new EventParams( |
6113 | "remote_data", resobj, | 6116 | "remote_data", resobj, |
diff --git a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs index 357ee32..a78dad6 100644 --- a/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs +++ b/OpenSim/Region/ScriptEngine/XEngine/XEngine.cs | |||
@@ -78,6 +78,7 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
78 | #pragma warning disable 414 | 78 | #pragma warning disable 414 |
79 | private EventManager m_EventManager; | 79 | private EventManager m_EventManager; |
80 | #pragma warning restore 414 | 80 | #pragma warning restore 414 |
81 | private IXmlRpcRouter m_XmlRpcRouter; | ||
81 | private int m_EventLimit; | 82 | private int m_EventLimit; |
82 | private bool m_KillTimedOutScripts; | 83 | private bool m_KillTimedOutScripts; |
83 | 84 | ||
@@ -130,6 +131,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
130 | get { return m_ScriptEngines; } | 131 | get { return m_ScriptEngines; } |
131 | } | 132 | } |
132 | 133 | ||
134 | public IScriptModule ScriptModule | ||
135 | { | ||
136 | get { return this; } | ||
137 | } | ||
138 | |||
133 | // private struct RezScriptParms | 139 | // private struct RezScriptParms |
134 | // { | 140 | // { |
135 | // uint LocalID; | 141 | // uint LocalID; |
@@ -222,6 +228,13 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
222 | m_MaxScriptQueue, m_StackSize); | 228 | m_MaxScriptQueue, m_StackSize); |
223 | 229 | ||
224 | m_Scene.StackModuleInterface<IScriptModule>(this); | 230 | m_Scene.StackModuleInterface<IScriptModule>(this); |
231 | |||
232 | m_XmlRpcRouter = m_Scene.RequestModuleInterface<IXmlRpcRouter>(); | ||
233 | if (m_XmlRpcRouter != null) | ||
234 | { | ||
235 | OnScriptRemoved += m_XmlRpcRouter.ScriptRemoved; | ||
236 | OnObjectRemoved += m_XmlRpcRouter.ObjectRemoved; | ||
237 | } | ||
225 | } | 238 | } |
226 | 239 | ||
227 | public void PostInitialise() | 240 | public void PostInitialise() |
@@ -917,6 +930,11 @@ namespace OpenSim.Region.ScriptEngine.XEngine | |||
917 | return false; | 930 | return false; |
918 | } | 931 | } |
919 | 932 | ||
933 | public bool PostScriptEvent(UUID itemID, string name, Object[] p) | ||
934 | { | ||
935 | return PostScriptEvent(itemID, new EventParams(name, p, new DetectParams[0])); | ||
936 | } | ||
937 | |||
920 | public Assembly OnAssemblyResolve(object sender, | 938 | public Assembly OnAssemblyResolve(object sender, |
921 | ResolveEventArgs args) | 939 | ResolveEventArgs args) |
922 | { | 940 | { |