diff options
Diffstat (limited to 'OpenSim')
5 files changed, 24 insertions, 8 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index 2183c1c..34a4bfc 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |||
@@ -54,7 +54,7 @@ namespace OpenSim.Region.Framework.Interfaces | |||
54 | Type[] LookupTypeSignature(string fname); | 54 | Type[] LookupTypeSignature(string fname); |
55 | Type LookupReturnType(string fname); | 55 | Type LookupReturnType(string fname); |
56 | 56 | ||
57 | object InvokeOperation(UUID scriptId, string fname, params object[] parms); | 57 | object InvokeOperation(UUID hostId, UUID scriptId, string fname, params object[] parms); |
58 | 58 | ||
59 | /// <summary> | 59 | /// <summary> |
60 | /// Send a link_message event to an in-world script | 60 | /// Send a link_message event to an in-world script |
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index c2ec5b4..0605590 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -161,13 +161,13 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
161 | lock (m_scriptInvocation) | 161 | lock (m_scriptInvocation) |
162 | { | 162 | { |
163 | ParameterInfo[] parameters = fcall.Method.GetParameters (); | 163 | ParameterInfo[] parameters = fcall.Method.GetParameters (); |
164 | if (parameters.Length == 0) // Must have one UUID param | 164 | if (parameters.Length < 2) // Must have two UUID params |
165 | return; | 165 | return; |
166 | 166 | ||
167 | // Hide the first parameter | 167 | // Hide the first two parameters |
168 | Type[] parmTypes = new Type[parameters.Length - 1]; | 168 | Type[] parmTypes = new Type[parameters.Length - 2]; |
169 | for (int i = 1 ; i < parameters.Length ; i++) | 169 | for (int i = 2 ; i < parameters.Length ; i++) |
170 | parmTypes[i - 1] = parameters[i].ParameterType; | 170 | parmTypes[i - 2] = parameters[i].ParameterType; |
171 | m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); | 171 | m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); |
172 | } | 172 | } |
173 | } | 173 | } |
@@ -249,9 +249,10 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
249 | return null; | 249 | return null; |
250 | } | 250 | } |
251 | 251 | ||
252 | public object InvokeOperation(UUID scriptid, string fname, params object[] parms) | 252 | public object InvokeOperation(UUID hostid, UUID scriptid, string fname, params object[] parms) |
253 | { | 253 | { |
254 | List<object> olist = new List<object>(); | 254 | List<object> olist = new List<object>(); |
255 | olist.Add(hostid); | ||
255 | olist.Add(scriptid); | 256 | olist.Add(scriptid); |
256 | foreach (object o in parms) | 257 | foreach (object o in parms) |
257 | olist.Add(o); | 258 | olist.Add(o); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs index 1bcbcd3..7c07e15 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/MOD_Api.cs | |||
@@ -122,6 +122,15 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
122 | /// <param name="fname">The name of the function to invoke</param> | 122 | /// <param name="fname">The name of the function to invoke</param> |
123 | /// <param name="parms">List of parameters</param> | 123 | /// <param name="parms">List of parameters</param> |
124 | /// <returns>string result of the invocation</returns> | 124 | /// <returns>string result of the invocation</returns> |
125 | public void modInvokeN(string fname, params object[] parms) | ||
126 | { | ||
127 | Type returntype = m_comms.LookupReturnType(fname); | ||
128 | if (returntype != typeof(string)) | ||
129 | MODError(String.Format("return type mismatch for {0}",fname)); | ||
130 | |||
131 | modInvoke(fname,parms); | ||
132 | } | ||
133 | |||
125 | public LSL_String modInvokeS(string fname, params object[] parms) | 134 | public LSL_String modInvokeS(string fname, params object[] parms) |
126 | { | 135 | { |
127 | Type returntype = m_comms.LookupReturnType(fname); | 136 | Type returntype = m_comms.LookupReturnType(fname); |
@@ -243,7 +252,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
243 | // non-null but don't trust it completely | 252 | // non-null but don't trust it completely |
244 | try | 253 | try |
245 | { | 254 | { |
246 | object result = m_comms.InvokeOperation(m_itemID,fname,convertedParms); | 255 | object result = m_comms.InvokeOperation(m_host.UUID, m_itemID, fname, convertedParms); |
247 | if (result != null) | 256 | if (result != null) |
248 | return result; | 257 | return result; |
249 | 258 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IMOD_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IMOD_Api.cs index d258f76..aa78aaa 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IMOD_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Interface/IMOD_Api.cs | |||
@@ -41,6 +41,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api.Interfaces | |||
41 | public interface IMOD_Api | 41 | public interface IMOD_Api |
42 | { | 42 | { |
43 | // Invocation functions | 43 | // Invocation functions |
44 | void modInvokeN(string fname, params object[] parms); | ||
44 | LSL_String modInvokeS(string fname, params object[] parms); | 45 | LSL_String modInvokeS(string fname, params object[] parms); |
45 | LSL_Integer modInvokeI(string fname, params object[] parms); | 46 | LSL_Integer modInvokeI(string fname, params object[] parms); |
46 | LSL_Float modInvokeF(string fname, params object[] parms); | 47 | LSL_Float modInvokeF(string fname, params object[] parms); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/MOD_Stub.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/MOD_Stub.cs index e7a4b2b..1c47138 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/MOD_Stub.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Runtime/MOD_Stub.cs | |||
@@ -62,6 +62,11 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase | |||
62 | m_MOD_Functions = (IMOD_Api)api; | 62 | m_MOD_Functions = (IMOD_Api)api; |
63 | } | 63 | } |
64 | 64 | ||
65 | public void modInvokeN(string fname, params object[] parms) | ||
66 | { | ||
67 | m_MOD_Functions.modInvokeN(fname, parms); | ||
68 | } | ||
69 | |||
65 | public LSL_String modInvokeS(string fname, params object[] parms) | 70 | public LSL_String modInvokeS(string fname, params object[] parms) |
66 | { | 71 | { |
67 | return m_MOD_Functions.modInvokeS(fname, parms); | 72 | return m_MOD_Functions.modInvokeS(fname, parms); |