moving code that will be common into private static method

0.7.4-extended
SignpostMarv 2012-08-31 12:56:30 +01:00 committed by Justin Clark-Casey (justincc)
parent 901aa4153e
commit 341dcbede6
1 changed files with 8 additions and 1 deletions

View File

@ -130,10 +130,17 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
m_scriptModule.PostScriptEvent(script, "link_message", args); 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, MethodInfo mi = target.GetType().GetMethod(meth,
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
return mi;
}
public void RegisterScriptInvocation(object target, string meth)
{
MethodInfo mi = GetMethodInfoFromType(target, meth);
if (mi == null) if (mi == null)
{ {
m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth);