From dff746df7be488d8ff35c91a974f406216222423 Mon Sep 17 00:00:00 2001 From: SignpostMarv Date: Fri, 31 Aug 2012 12:56:30 +0100 Subject: moving code that will be common into private static method --- .../Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 705a847..de0e864 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -130,10 +130,17 @@ namespace OpenSim.Region.OptionalModules.Scripting.ScriptModuleComms m_scriptModule.PostScriptEvent(script, "link_message", args); } - public void RegisterScriptInvocation(object target, string meth) + private static MethodInfo GetMethodInfoFromType(object target, string meth) { MethodInfo mi = target.GetType().GetMethod(meth, BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); + + return mi; + } + + public void RegisterScriptInvocation(object target, string meth) + { + MethodInfo mi = GetMethodInfoFromType(target, meth); if (mi == null) { m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); -- cgit v1.1