aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/Scripting
diff options
context:
space:
mode:
authorMelanie2012-03-25 20:07:43 +0100
committerMelanie2012-03-25 20:07:43 +0100
commit44f1f876562dd41c0c619462a57d6a33731729ac (patch)
tree96c7a583dcb483f2fe8d19787a381fae1985b1b1 /OpenSim/Region/OptionalModules/Scripting
parentMerge branch 'master' into careminster (diff)
parentSimplify the module invocation registration. The types and method name (diff)
downloadopensim-SC_OLD-44f1f876562dd41c0c619462a57d6a33731729ac.zip
opensim-SC_OLD-44f1f876562dd41c0c619462a57d6a33731729ac.tar.gz
opensim-SC_OLD-44f1f876562dd41c0c619462a57d6a33731729ac.tar.bz2
opensim-SC_OLD-44f1f876562dd41c0c619462a57d6a33731729ac.tar.xz
Merge branch 'master' into careminster
Diffstat (limited to 'OpenSim/Region/OptionalModules/Scripting')
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/ScriptModuleComms/ScriptModuleCommsModule.cs28
1 files changed, 26 insertions, 2 deletions
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