aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
index 50d04cd..19130bd 100644
--- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -130,17 +130,23 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms
130 m_scriptModule.PostScriptEvent(script, "link_message", args); 130 m_scriptModule.PostScriptEvent(script, "link_message", args);
131 } 131 }
132 132
133 private static MethodInfo GetMethodInfoFromType(Type target, string meth) 133 private static MethodInfo GetMethodInfoFromType(Type target, string meth, bool searchInstanceMethods)
134 { 134 {
135 BindingFlags getMethodFlags = 135 BindingFlags getMethodFlags =
136 BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance; 136 BindingFlags.NonPublic | BindingFlags.Public;
137
138 if (searchInstanceMethods)
139 getMethodFlags |= BindingFlags.Instance;
140 else
141 getMethodFlags |= BindingFlags.Static;
142
137 return target.GetMethod(meth, 143 return target.GetMethod(meth,
138 getMethodFlags); 144 getMethodFlags);
139 } 145 }
140 146
141 public void RegisterScriptInvocation(object target, string meth) 147 public void RegisterScriptInvocation(object target, string meth)
142 { 148 {
143 MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth); 149 MethodInfo mi = GetMethodInfoFromType(target.GetType(), meth, true);
144 if (mi == null) 150 if (mi == null)
145 { 151 {
146 m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); 152 m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth);