diff options
author | SignpostMarv | 2012-09-14 13:17:07 +0100 |
---|---|---|
committer | Melanie | 2012-09-17 14:15:47 +0100 |
commit | f9721573d956092c2d993ee41654f3f5e160401c (patch) | |
tree | 157a221bbc9b6776b696ad4f7441be2d96b0e414 /OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |
parent | preventing a null reference exception from being thrown (diff) | |
download | opensim-SC_OLD-f9721573d956092c2d993ee41654f3f5e160401c.zip opensim-SC_OLD-f9721573d956092c2d993ee41654f3f5e160401c.tar.gz opensim-SC_OLD-f9721573d956092c2d993ee41654f3f5e160401c.tar.bz2 opensim-SC_OLD-f9721573d956092c2d993ee41654f3f5e160401c.tar.xz |
Implementing ability to register script constants and invocations on a region module automatically
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs index dae7c00..277c9ed 100644 --- a/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs +++ b/OpenSim/Region/Framework/Interfaces/IScriptModuleComms.cs | |||
@@ -75,6 +75,14 @@ namespace OpenSim.Region.Framework.Interfaces | |||
75 | void RegisterScriptInvocation(Type target, string[] methods); | 75 | void RegisterScriptInvocation(Type target, string[] methods); |
76 | 76 | ||
77 | /// <summary> | 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> | ||
78 | /// Returns an array of all registered script calls | 86 | /// Returns an array of all registered script calls |
79 | /// </summary> | 87 | /// </summary> |
80 | /// <returns></returns> | 88 | /// <returns></returns> |
@@ -98,9 +106,24 @@ namespace OpenSim.Region.Framework.Interfaces | |||
98 | 106 | ||
99 | /// For constants | 107 | /// For constants |
100 | void RegisterConstant(string cname, object value); | 108 | void RegisterConstant(string cname, object value); |
109 | |||
110 | /// <summary> | ||
111 | /// Automatically register all constants on a region module by | ||
112 | /// checking for fields with <see cref="ScriptConstantAttribute"/>. | ||
113 | /// </summary> | ||
114 | /// <param name="target"></param> | ||
115 | void RegisterConstants(IRegionModuleBase target); | ||
101 | object LookupModConstant(string cname); | 116 | object LookupModConstant(string cname); |
102 | 117 | ||
103 | // For use ONLY by the script API | 118 | // For use ONLY by the script API |
104 | void RaiseEvent(UUID script, string id, string module, string command, string key); | 119 | void RaiseEvent(UUID script, string id, string module, string command, string key); |
105 | } | 120 | } |
121 | |||
122 | [AttributeUsage(AttributeTargets.Method)] | ||
123 | public class ScriptInvocationAttribute : Attribute | ||
124 | { } | ||
125 | |||
126 | [AttributeUsage(AttributeTargets.Field)] | ||
127 | public class ScriptConstantAttribute : Attribute | ||
128 | { } | ||
106 | } | 129 | } |