diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | 18 |
2 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index 34a4bfc..bfe1e8d 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |||
@@ -47,6 +47,8 @@ namespace OpenSim.Region.Framework.Interfaces | |||
47 | event ScriptCommand OnScriptCommand; | 47 | event ScriptCommand OnScriptCommand; |
48 | 48 | ||
49 | void RegisterScriptInvocation(object target, string method); | 49 | void RegisterScriptInvocation(object target, string method); |
50 | void RegisterScriptInvocation(object target, MethodInfo method); | ||
51 | void RegisterScriptInvocation(object target, string[] methods); | ||
50 | Delegate[] GetScriptInvocationList(); | 52 | Delegate[] GetScriptInvocationList(); |
51 | 53 | ||
52 | Delegate LookupScriptInvocation(string fname); | 54 | Delegate LookupScriptInvocation(string fname); |
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 0605590..cab30de 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -130,9 +130,6 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
130 | 130 | ||
131 | public void RegisterScriptInvocation(object target, string meth) | 131 | public void RegisterScriptInvocation(object target, string meth) |
132 | { | 132 | { |
133 | m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}",meth,target.GetType().Name); | ||
134 | |||
135 | |||
136 | MethodInfo mi = target.GetType().GetMethod(meth, | 133 | MethodInfo mi = target.GetType().GetMethod(meth, |
137 | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); | 134 | BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); |
138 | if (mi == null) | 135 | if (mi == null) |
@@ -140,7 +137,20 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
140 | m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); | 137 | m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); |
141 | return; | 138 | return; |
142 | } | 139 | } |
143 | 140 | ||
141 | RegisterScriptInvocation(target, mi); | ||
142 | } | ||
143 | |||
144 | public void RegisterScriptInvocation(object target, string[] meth) | ||
145 | { | ||
146 | foreach (string m in meth) | ||
147 | RegisterScriptInvocation(target, m); | ||
148 | } | ||
149 | |||
150 | public void RegisterScriptInvocation(object target, MethodInfo mi) | ||
151 | { | ||
152 | m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, target.GetType().Name); | ||
153 | |||
144 | Type delegateType; | 154 | Type delegateType; |
145 | var typeArgs = mi.GetParameters() | 155 | var typeArgs = mi.GetParameters() |
146 | .Select(p => p.ParameterType) | 156 | .Select(p => p.ParameterType) |