aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/XMREngine/MMRInternalFuncDict.cs
diff options
context:
space:
mode:
authorUbitUmarov2018-02-23 14:52:34 +0000
committerUbitUmarov2018-02-23 14:52:34 +0000
commit2129d941acbc5f83aca4dc4c30a62d3226888136 (patch)
treee12f2391978c923ef780f558ee5a32d857ee9124 /OpenSim/Region/ScriptEngine/XMREngine/MMRInternalFuncDict.cs
parentMerge branch 'master' into httptests (diff)
downloadopensim-SC-2129d941acbc5f83aca4dc4c30a62d3226888136.zip
opensim-SC-2129d941acbc5f83aca4dc4c30a62d3226888136.tar.gz
opensim-SC-2129d941acbc5f83aca4dc4c30a62d3226888136.tar.bz2
opensim-SC-2129d941acbc5f83aca4dc4c30a62d3226888136.tar.xz
rename XMREngine as Yengine (still not all done), big mess source formating changes, move state files to proper folder, fix a source file locking on errors, more changes for cross platform including from Mike,... yes yes i know a messy commit
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/YEngine/MMRInternalFuncDict.cs (renamed from OpenSim/Region/ScriptEngine/XMREngine/MMRInternalFuncDict.cs)57
1 files changed, 33 insertions, 24 deletions
diff --git a/OpenSim/Region/ScriptEngine/XMREngine/MMRInternalFuncDict.cs b/OpenSim/Region/ScriptEngine/YEngine/MMRInternalFuncDict.cs
index c2c01b5..5d1cbc0 100644
--- a/OpenSim/Region/ScriptEngine/XMREngine/MMRInternalFuncDict.cs
+++ b/OpenSim/Region/ScriptEngine/YEngine/MMRInternalFuncDict.cs
@@ -30,9 +30,11 @@ using System.Collections.Generic;
30using System.IO; 30using System.IO;
31using System.Reflection; 31using System.Reflection;
32 32
33namespace OpenSim.Region.ScriptEngine.XMREngine { 33namespace OpenSim.Region.ScriptEngine.Yengine
34{
34 35
35 public class InternalFuncDict : VarDict { 36 public class InternalFuncDict: VarDict
37 {
36 38
37 /** 39 /**
38 * @brief build dictionary of internal functions from an interface. 40 * @brief build dictionary of internal functions from an interface.
@@ -41,50 +43,57 @@ namespace OpenSim.Region.ScriptEngine.XMREngine {
41 * false: catalog by simple name only, eg, state_entry 43 * false: catalog by simple name only, eg, state_entry
42 * @returns dictionary of function definition tokens 44 * @returns dictionary of function definition tokens
43 */ 45 */
44 public InternalFuncDict (Type iface, bool inclSig) 46 public InternalFuncDict(Type iface, bool inclSig)
45 : base (false) 47 : base(false)
46 { 48 {
47 /* 49 /*
48 * Loop through list of all methods declared in the interface. 50 * Loop through list of all methods declared in the interface.
49 */ 51 */
50 System.Reflection.MethodInfo[] ifaceMethods = iface.GetMethods (); 52 System.Reflection.MethodInfo[] ifaceMethods = iface.GetMethods();
51 foreach (System.Reflection.MethodInfo ifaceMethod in ifaceMethods) { 53 foreach(System.Reflection.MethodInfo ifaceMethod in ifaceMethods)
54 {
52 string key = ifaceMethod.Name; 55 string key = ifaceMethod.Name;
53 56
54 /* 57 /*
55 * Only do ones that begin with lower-case letters... 58 * Only do ones that begin with lower-case letters...
56 * as any others can't be referenced by scripts 59 * as any others can't be referenced by scripts
57 */ 60 */
58 if ((key[0] < 'a') || (key[0] > 'z')) continue; 61 if((key[0] < 'a') || (key[0] > 'z'))
62 continue;
59 63
60 try { 64 try
65 {
61 66
62 /* 67 /*
63 * Create a corresponding TokenDeclVar struct. 68 * Create a corresponding TokenDeclVar struct.
64 */ 69 */
65 System.Reflection.ParameterInfo[] parameters = ifaceMethod.GetParameters (); 70 System.Reflection.ParameterInfo[] parameters = ifaceMethod.GetParameters();
66 TokenArgDecl argDecl = new TokenArgDecl (null); 71 TokenArgDecl argDecl = new TokenArgDecl(null);
67 for (int i = 0; i < parameters.Length; i++) { 72 for(int i = 0; i < parameters.Length; i++)
73 {
68 System.Reflection.ParameterInfo param = parameters[i]; 74 System.Reflection.ParameterInfo param = parameters[i];
69 TokenType type = TokenType.FromSysType (null, param.ParameterType); 75 TokenType type = TokenType.FromSysType(null, param.ParameterType);
70 TokenName name = new TokenName (null, param.Name); 76 TokenName name = new TokenName(null, param.Name);
71 argDecl.AddArg (type, name); 77 argDecl.AddArg(type, name);
72 } 78 }
73 TokenDeclVar declFunc = new TokenDeclVar (null, null, null); 79 TokenDeclVar declFunc = new TokenDeclVar(null, null, null);
74 declFunc.name = new TokenName (null, key); 80 declFunc.name = new TokenName(null, key);
75 declFunc.retType = TokenType.FromSysType (null, ifaceMethod.ReturnType); 81 declFunc.retType = TokenType.FromSysType(null, ifaceMethod.ReturnType);
76 declFunc.argDecl = argDecl; 82 declFunc.argDecl = argDecl;
77 83
78 /* 84 /*
79 * Add the TokenDeclVar struct to the dictionary. 85 * Add the TokenDeclVar struct to the dictionary.
80 */ 86 */
81 this.AddEntry (declFunc); 87 this.AddEntry(declFunc);
82 } catch (Exception except) { 88 }
89 catch(Exception except)
90 {
83 91
84 string msg = except.ToString (); 92 string msg = except.ToString();
85 int i = msg.IndexOf ("\n"); 93 int i = msg.IndexOf("\n");
86 if (i > 0) msg = msg.Substring (0, i); 94 if(i > 0)
87 Console.WriteLine ("InternalFuncDict*: {0}: {1}", key, msg); 95 msg = msg.Substring(0, i);
96 Console.WriteLine("InternalFuncDict*: {0}: {1}", key, msg);
88 97
89 ///??? IGNORE ANY THAT FAIL - LIKE UNRECOGNIZED TYPE ???/// 98 ///??? IGNORE ANY THAT FAIL - LIKE UNRECOGNIZED TYPE ???///
90 } 99 }