aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules
diff options
context:
space:
mode:
authorSignpostMarv2012-08-31 13:09:15 +0100
committerMelanie2012-08-31 14:32:32 +0100
commite6f43023b6fe682971b78175fbb694c18848eff0 (patch)
treeb71c5517fd74a9df366963876f5cedf5f548e484 /OpenSim/Region/OptionalModules
parentassign binding flags to variable (diff)
downloadopensim-SC-e6f43023b6fe682971b78175fbb694c18848eff0.zip
opensim-SC-e6f43023b6fe682971b78175fbb694c18848eff0.tar.gz
opensim-SC-e6f43023b6fe682971b78175fbb694c18848eff0.tar.bz2
opensim-SC-e6f43023b6fe682971b78175fbb694c18848eff0.tar.xz
adding support for finding static methods
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-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);