aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMelanie2012-03-26 16:46:07 +0100
committerMelanie2012-03-26 16:46:07 +0100
commitad865ab4fc6703610d15336fa22fa2a62f628979 (patch)
tree5f1f78a6b7c82ed4b63868c5784047126fc7e926 /OpenSim
parentBulletSim: fix typo introducted by previous checkins (git merge sometimes mak... (diff)
downloadopensim-SC-ad865ab4fc6703610d15336fa22fa2a62f628979.zip
opensim-SC-ad865ab4fc6703610d15336fa22fa2a62f628979.tar.gz
opensim-SC-ad865ab4fc6703610d15336fa22fa2a62f628979.tar.bz2
opensim-SC-ad865ab4fc6703610d15336fa22fa2a62f628979.tar.xz
Add some more overloads to allow registering overloaded methods and lists
of methods.
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs2
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs18
2 files changed, 16 insertions, 4 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
index 34a4bfc..bfe1e8d 100644
--- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
+++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs
@@ -47,6 +47,8 @@ namespace OpenSim.Region.Framework.Interfaces
47 event ScriptCommand OnScriptCommand; 47 event ScriptCommand OnScriptCommand;
48 48
49 void RegisterScriptInvocation(object target, string method); 49 void RegisterScriptInvocation(object target, string method);
50 void RegisterScriptInvocation(object target, MethodInfo method);
51 void RegisterScriptInvocation(object target, string[] methods);
50 Delegate[] GetScriptInvocationList(); 52 Delegate[] GetScriptInvocationList();
51 53
52 Delegate LookupScriptInvocation(string fname); 54 Delegate LookupScriptInvocation(string fname);
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)