diff options
Diffstat (limited to 'OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | 71 |
1 files changed, 70 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index ed71a95..93930ce 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |||
@@ -46,9 +46,46 @@ namespace OpenSim.Region.Framework.Interfaces | |||
46 | /// </summary> | 46 | /// </summary> |
47 | event ScriptCommand OnScriptCommand; | 47 | event ScriptCommand OnScriptCommand; |
48 | 48 | ||
49 | /// <summary> | ||
50 | /// Register an instance method as a script call by method name | ||
51 | /// </summary> | ||
52 | /// <param name="target"></param> | ||
53 | /// <param name="method"></param> | ||
49 | void RegisterScriptInvocation(object target, string method); | 54 | void RegisterScriptInvocation(object target, string method); |
55 | |||
56 | /// <summary> | ||
57 | /// Register a static or instance method as a script call by method info | ||
58 | /// </summary> | ||
59 | /// <param name="target">If target is a Type object, will assume method is static.</param> | ||
60 | /// <param name="method"></param> | ||
50 | void RegisterScriptInvocation(object target, MethodInfo method); | 61 | void RegisterScriptInvocation(object target, MethodInfo method); |
62 | |||
63 | /// <summary> | ||
64 | /// Register one or more instance methods as script calls by method name | ||
65 | /// </summary> | ||
66 | /// <param name="target"></param> | ||
67 | /// <param name="methods"></param> | ||
51 | void RegisterScriptInvocation(object target, string[] methods); | 68 | void RegisterScriptInvocation(object target, string[] methods); |
69 | |||
70 | /// <summary> | ||
71 | /// Register one or more static methods as script calls by method name | ||
72 | /// </summary> | ||
73 | /// <param name="target"></param> | ||
74 | /// <param name="methods"></param> | ||
75 | void RegisterScriptInvocation(Type target, string[] methods); | ||
76 | |||
77 | /// <summary> | ||
78 | /// Automatically register script invocations by checking for methods | ||
79 | /// with <see cref="ScriptInvocationAttribute"/>. Should only check | ||
80 | /// public methods. | ||
81 | /// </summary> | ||
82 | /// <param name="target"></param> | ||
83 | void RegisterScriptInvocations(IRegionModuleBase target); | ||
84 | |||
85 | /// <summary> | ||
86 | /// Returns an array of all registered script calls | ||
87 | /// </summary> | ||
88 | /// <returns></returns> | ||
52 | Delegate[] GetScriptInvocationList(); | 89 | Delegate[] GetScriptInvocationList(); |
53 | 90 | ||
54 | Delegate LookupScriptInvocation(string fname); | 91 | Delegate LookupScriptInvocation(string fname); |
@@ -67,11 +104,43 @@ namespace OpenSim.Region.Framework.Interfaces | |||
67 | /// <param name="key"></param> | 104 | /// <param name="key"></param> |
68 | void DispatchReply(UUID scriptId, int code, string text, string key); | 105 | void DispatchReply(UUID scriptId, int code, string text, string key); |
69 | 106 | ||
70 | /// For constants | 107 | /// <summary> |
108 | /// Operation to for a region module to register a constant to be used | ||
109 | /// by the script engine | ||
110 | /// </summary> | ||
111 | /// <param name="cname"> | ||
112 | /// The name of the constant. LSL convention is for constant names to | ||
113 | /// be uppercase. | ||
114 | /// </param> | ||
115 | /// <param name="value"> | ||
116 | /// The value of the constant. Should be of a type that can be | ||
117 | /// converted to one of <see cref="OpenSim.Region.ScriptEngine.Shared.LSL_Types"/> | ||
118 | /// </param> | ||
71 | void RegisterConstant(string cname, object value); | 119 | void RegisterConstant(string cname, object value); |
120 | |||
121 | /// <summary> | ||
122 | /// Automatically register all constants on a region module by | ||
123 | /// checking for fields with <see cref="ScriptConstantAttribute"/>. | ||
124 | /// </summary> | ||
125 | /// <param name="target"></param> | ||
126 | void RegisterConstants(IRegionModuleBase target); | ||
127 | |||
128 | /// <summary> | ||
129 | /// Operation to check for a registered constant | ||
130 | /// </summary> | ||
131 | /// <param name="cname">Name of constant</param> | ||
132 | /// <returns>Value of constant or null if none found.</returns> | ||
72 | object LookupModConstant(string cname); | 133 | object LookupModConstant(string cname); |
73 | 134 | ||
74 | // For use ONLY by the script API | 135 | // For use ONLY by the script API |
75 | void RaiseEvent(UUID script, string id, string module, string command, string key); | 136 | void RaiseEvent(UUID script, string id, string module, string command, string key); |
76 | } | 137 | } |
138 | |||
139 | [AttributeUsage(AttributeTargets.Method)] | ||
140 | public class ScriptInvocationAttribute : Attribute | ||
141 | { } | ||
142 | |||
143 | [AttributeUsage(AttributeTargets.Field)] | ||
144 | public class ScriptConstantAttribute : Attribute | ||
145 | { } | ||
77 | } | 146 | } |