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 /OpenSim/Region/ScriptEngine | |
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.
Diffstat (limited to 'OpenSim/Region/ScriptEngine')
4 files changed, 34 insertions, 0 deletions
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 | { |