Fix compile error in ScriptModuelComms and add some debugging into the modInvoke

routines to simplify finding method registration issues.
0.7.4.1
Mic Bowman 2012-03-25 22:59:06 -07:00
parent 98a6c78943
commit 055269805d
1 changed files with 13 additions and 3 deletions

View File

@ -130,10 +130,18 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
public void RegisterScriptInvocation(object target, string meth) public void RegisterScriptInvocation(object target, string meth)
{ {
MethodInfo mi = target.GetType()..GetMethod(meth, m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}",meth,target.GetType().Name);
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
Type delegateType;
MethodInfo mi = target.GetType().GetMethod(meth,
BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
if (mi == null)
{
m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth);
return;
}
Type delegateType;
var typeArgs = mi.GetParameters() var typeArgs = mi.GetParameters()
.Select(p => p.ParameterType) .Select(p => p.ParameterType)
.ToList(); .ToList();
@ -197,6 +205,8 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
return "modInvokeR"; return "modInvokeR";
else if (sid.ReturnType == typeof(object[])) else if (sid.ReturnType == typeof(object[]))
return "modInvokeL"; return "modInvokeL";
m_log.WarnFormat("[MODULE COMMANDS] failed to find match for {0} with return type {1}",fname,sid.ReturnType.Name);
} }
} }