From 055269805d88c5f3d347d3ba7d03db2182a78277 Mon Sep 17 00:00:00 2001 From: Mic Bowman Date: Sun, 25 Mar 2012 22:59:06 -0700 Subject: [PATCH] Fix compile error in ScriptModuelComms and add some debugging into the modInvoke routines to simplify finding method registration issues. --- .../ScriptModuleComms/ScriptModuleCommsModule.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 7fc875919b..c2ec5b4a92 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs @@ -130,10 +130,18 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms public void RegisterScriptInvocation(object target, string meth) { - MethodInfo mi = target.GetType()..GetMethod(meth, - BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); - Type delegateType; + m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}",meth,target.GetType().Name); + + 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() .Select(p => p.ParameterType) .ToList(); @@ -197,6 +205,8 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms return "modInvokeR"; else if (sid.ReturnType == typeof(object[])) return "modInvokeL"; + + m_log.WarnFormat("[MODULE COMMANDS] failed to find match for {0} with return type {1}",fname,sid.ReturnType.Name); } }