aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting
diff options
context:
space:
mode:
authorMelanie2012-03-26 16:46:07 +0100
committerMelanie2012-03-26 16:46:07 +0100
commitad865ab4fc6703610d15336fa22fa2a62f628979 (patch)
tree5f1f78a6b7c82ed4b63868c5784047126fc7e926 /OpenSim/Region/OptionalModules/Scripting
parentBulletSim: fix typo introducted by previous checkins (git merge sometimes mak... (diff)
downloadopensim-SC_OLD-ad865ab4fc6703610d15336fa22fa2a62f628979.zip
opensim-SC_OLD-ad865ab4fc6703610d15336fa22fa2a62f628979.tar.gz
opensim-SC_OLD-ad865ab4fc6703610d15336fa22fa2a62f628979.tar.bz2
opensim-SC_OLD-ad865ab4fc6703610d15336fa22fa2a62f628979.tar.xz
Add some more overloads to allow registering overloaded methods and lists
of methods.
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs18
1 files changed, 14 insertions, 4 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
index 0605590..cab30de 100644
--- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs
@@ -130,9 +130,6 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
130 130
131 public void RegisterScriptInvocation(object target, string meth) 131 public void RegisterScriptInvocation(object target, string meth)
132 { 132 {
133 m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}",meth,target.GetType().Name);
134
135
136 MethodInfo mi = target.GetType().GetMethod(meth, 133 MethodInfo mi = target.GetType().GetMethod(meth,
137 BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance); 134 BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Instance);
138 if (mi == null) 135 if (mi == null)
@@ -140,7 +137,20 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms
140 m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth); 137 m_log.WarnFormat("[MODULE COMMANDS] Failed to register method {0}",meth);
141 return; 138 return;
142 } 139 }
143 140
141 RegisterScriptInvocation(target, mi);
142 }
143
144 public void RegisterScriptInvocation(object target, string[] meth)
145 {
146 foreach (string m in meth)
147 RegisterScriptInvocation(target, m);
148 }
149
150 public void RegisterScriptInvocation(object target, MethodInfo mi)
151 {
152 m_log.DebugFormat("[MODULE COMMANDS] Register method {0} from type {1}", mi.Name, target.GetType().Name);
153
144 Type delegateType; 154 Type delegateType;
145 var typeArgs = mi.GetParameters() 155 var typeArgs = mi.GetParameters()
146 .Select(p => p.ParameterType) 156 .Select(p => p.ParameterType)