diff options
author | Melanie | 2012-03-25 20:07:43 +0100 |
---|---|---|
committer | Melanie | 2012-03-25 20:07:43 +0100 |
commit | 44f1f876562dd41c0c619462a57d6a33731729ac (patch) | |
tree | 96c7a583dcb483f2fe8d19787a381fae1985b1b1 /OpenSim/Region/OptionalModules | |
parent | Merge branch 'master' into careminster (diff) | |
parent | Simplify the module invocation registration. The types and method name (diff) | |
download | opensim-SC-44f1f876562dd41c0c619462a57d6a33731729ac.zip opensim-SC-44f1f876562dd41c0c619462a57d6a33731729ac.tar.gz opensim-SC-44f1f876562dd41c0c619462a57d6a33731729ac.tar.bz2 opensim-SC-44f1f876562dd41c0c619462a57d6a33731729ac.tar.xz |
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/OptionalModules')
-rwxr-xr-x | OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs | 28 |
2 files changed, 31 insertions, 7 deletions
diff --git a/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs b/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs index a3f68e5..e452124 100755 --- a/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs +++ b/OpenSim/Region/OptionalModules/PhysicsParameters/PhysicsParameters.cs | |||
@@ -264,14 +264,14 @@ namespace OpenSim.Region.OptionalModules.PhysicsParameters | |||
264 | 264 | ||
265 | private void WriteOut(string msg, params object[] args) | 265 | private void WriteOut(string msg, params object[] args) |
266 | { | 266 | { |
267 | m_log.InfoFormat(msg, args); | 267 | // m_log.InfoFormat(msg, args); |
268 | // MainConsole.Instance.OutputFormat(msg, args); | 268 | MainConsole.Instance.OutputFormat(msg, args); |
269 | } | 269 | } |
270 | 270 | ||
271 | private void WriteError(string msg, params object[] args) | 271 | private void WriteError(string msg, params object[] args) |
272 | { | 272 | { |
273 | m_log.ErrorFormat(msg, args); | 273 | // m_log.ErrorFormat(msg, args); |
274 | // MainConsole.Instance.OutputFormat(msg, args); | 274 | MainConsole.Instance.OutputFormat(msg, args); |
275 | } | 275 | } |
276 | } | 276 | } |
277 | } \ No newline at end of file | 277 | } |
diff --git a/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs b/OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs index a90362e..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) |
@@ -147,6 +163,14 @@ namespace OpenSim.Region.CoreModules.Scripting.ScriptModuleComms | |||
147 | return "modInvokeI"; | 163 | return "modInvokeI"; |
148 | else if (sid.ReturnType == typeof(float)) | 164 | else if (sid.ReturnType == typeof(float)) |
149 | return "modInvokeF"; | 165 | return "modInvokeF"; |
166 | else if (sid.ReturnType == typeof(UUID)) | ||
167 | return "modInvokeK"; | ||
168 | else if (sid.ReturnType == typeof(OpenMetaverse.Vector3)) | ||
169 | return "modInvokeV"; | ||
170 | else if (sid.ReturnType == typeof(OpenMetaverse.Quaternion)) | ||
171 | return "modInvokeR"; | ||
172 | else if (sid.ReturnType == typeof(object[])) | ||
173 | return "modInvokeL"; | ||
150 | } | 174 | } |
151 | } | 175 | } |
152 | 176 | ||