diff options
author | Melanie | 2012-03-25 19:52:38 +0100 |
---|---|---|
committer | Melanie | 2012-03-25 19:52:38 +0100 |
commit | cb44808504e48125d630823880ee8e710afcd9ea (patch) | |
tree | 449a991ba060770b230244332015d0b6c7b41cef /OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-cb44808504e48125d630823880ee8e710afcd9ea.zip opensim-SC_OLD-cb44808504e48125d630823880ee8e710afcd9ea.tar.gz opensim-SC_OLD-cb44808504e48125d630823880ee8e710afcd9ea.tar.bz2 opensim-SC_OLD-cb44808504e48125d630823880ee8e710afcd9ea.tar.xz |
Simplify the module invocation registration. The types and method name
can be pulled fromt he delegate so we don't need to pass them explicitly
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms')
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index 0661c65..8e8a0b6 100644 --- a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs +++ b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | |||
@@ -126,14 +126,30 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
126 | m_scriptModule.PostScriptEvent(script, "link_message", args); | 126 | m_scriptModule.PostScriptEvent(script, "link_message", args); |
127 | } | 127 | } |
128 | 128 | ||
129 | public void RegisterScriptInvocation(string fname, ScriptInvocation fcall, Type[] csig, Type rsig) | 129 | public void RegisterScriptInvocation(ScriptInvocation fcall) |
130 | { | 130 | { |
131 | lock (m_scriptInvocation) | 131 | lock (m_scriptInvocation) |
132 | { | 132 | { |
133 | m_scriptInvocation[fname] = new ScriptInvocationData(fname,fcall,csig,rsig); | 133 | ParameterInfo[] parameters = fcall.Method.GetParameters (); |
134 | Type[] parmTypes = new Type[parameters.Length]; | ||
135 | for (int i = 0 ; i < parameters.Length ; i++) | ||
136 | parmTypes[i] = parameters[i].ParameterType; | ||
137 | m_scriptInvocation[fcall.Method.Name] = new ScriptInvocationData(fcall.Method.Name, fcall, parmTypes, fcall.Method.ReturnType); | ||
134 | } | 138 | } |
135 | } | 139 | } |
136 | 140 | ||
141 | public ScriptInvocation[] GetScriptInvocationList() | ||
142 | { | ||
143 | List<ScriptInvocation> ret = new List<ScriptInvocation>(); | ||
144 | |||
145 | lock (m_scriptInvocation) | ||
146 | { | ||
147 | foreach (ScriptInvocationData d in m_scriptInvocation.Values) | ||
148 | ret.Add(d.ScriptInvocationFn); | ||
149 | } | ||
150 | return ret.ToArray(); | ||
151 | } | ||
152 | |||
137 | public string LookupModInvocation(string fname) | 153 | public string LookupModInvocation(string fname) |
138 | { | 154 | { |
139 | lock (m_scriptInvocation) | 155 | lock (m_scriptInvocation) |