diff options
author | Tedd Hansen | 2008-01-17 15:22:35 +0000 |
---|---|---|
committer | Tedd Hansen | 2008-01-17 15:22:35 +0000 |
commit | 82d43db1ccbc2b13e21c88650165f82651b657e1 (patch) | |
tree | cffd57c063d69ffc670758f4c794239e1539d453 /OpenSim | |
parent | * Added llApplyImpulse in the global frame. The object must be physical befo... (diff) | |
download | opensim-SC-82d43db1ccbc2b13e21c88650165f82651b657e1.zip opensim-SC-82d43db1ccbc2b13e21c88650165f82651b657e1.tar.gz opensim-SC-82d43db1ccbc2b13e21c88650165f82651b657e1.tar.bz2 opensim-SC-82d43db1ccbc2b13e21c88650165f82651b657e1.tar.xz |
Added data structure to be passed through event execution queue so that events can use llDetect*-commands to find information about event.
Diffstat (limited to 'OpenSim')
9 files changed, 85 insertions, 47 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/IScript.cs b/OpenSim/Region/ScriptEngine/Common/IScript.cs index c94b187..2e1b143 100644 --- a/OpenSim/Region/ScriptEngine/Common/IScript.cs +++ b/OpenSim/Region/ScriptEngine/Common/IScript.cs | |||
@@ -26,6 +26,8 @@ | |||
26 | * | 26 | * |
27 | */ | 27 | */ |
28 | 28 | ||
29 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | ||
30 | |||
29 | namespace OpenSim.Region.ScriptEngine.Common | 31 | namespace OpenSim.Region.ScriptEngine.Common |
30 | { | 32 | { |
31 | public interface IScript | 33 | public interface IScript |
@@ -34,5 +36,6 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
34 | Executor Exec { get; } | 36 | Executor Exec { get; } |
35 | string Source { get; set; } | 37 | string Source { get; set; } |
36 | void Start(LSL_BuiltIn_Commands_Interface BuiltIn_Commands); | 38 | void Start(LSL_BuiltIn_Commands_Interface BuiltIn_Commands); |
39 | EventQueueManager.Queue_llDetectParams_Struct llDetectParams { get; set; } | ||
37 | } | 40 | } |
38 | } \ No newline at end of file | 41 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs index 5149f3a..bd64ee0 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs | |||
@@ -31,6 +31,7 @@ using System.Collections.Generic; | |||
31 | using System.Runtime.Remoting.Lifetime; | 31 | using System.Runtime.Remoting.Lifetime; |
32 | using System.Threading; | 32 | using System.Threading; |
33 | using OpenSim.Region.ScriptEngine.Common; | 33 | using OpenSim.Region.ScriptEngine.Common; |
34 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | ||
34 | using integer = System.Int32; | 35 | using integer = System.Int32; |
35 | using key = System.String; | 36 | using key = System.String; |
36 | using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3; | 37 | using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3; |
@@ -64,6 +65,12 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
64 | return lease; | 65 | return lease; |
65 | } | 66 | } |
66 | 67 | ||
68 | public EventQueueManager.Queue_llDetectParams_Struct _llDetectParams; | ||
69 | EventQueueManager.Queue_llDetectParams_Struct IScript.llDetectParams | ||
70 | { | ||
71 | get { return _llDetectParams; } | ||
72 | set { _llDetectParams = value; } | ||
73 | } | ||
67 | 74 | ||
68 | private Executor m_Exec; | 75 | private Executor m_Exec; |
69 | 76 | ||
@@ -127,6 +134,8 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
127 | } | 134 | } |
128 | 135 | ||
129 | 136 | ||
137 | |||
138 | |||
130 | // | 139 | // |
131 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs | 140 | // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs |
132 | // | 141 | // |
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs index c196322..58e4727 100644 --- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs | |||
@@ -37,6 +37,7 @@ using OpenSim.Framework; | |||
37 | using OpenSim.Region.Environment.Interfaces; | 37 | using OpenSim.Region.Environment.Interfaces; |
38 | using OpenSim.Region.Environment.Scenes; | 38 | using OpenSim.Region.Environment.Scenes; |
39 | using OpenSim.Region.ScriptEngine.Common; | 39 | using OpenSim.Region.ScriptEngine.Common; |
40 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | ||
40 | //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 41 | //using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
41 | 42 | ||
42 | namespace OpenSim.Region.ScriptEngine.Common | 43 | namespace OpenSim.Region.ScriptEngine.Common |
@@ -2368,7 +2369,7 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
2368 | { | 2369 | { |
2369 | LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID); | 2370 | LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID); |
2370 | object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), String.Empty, 0, String.Empty }; | 2371 | object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), String.Empty, 0, String.Empty }; |
2371 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", resobj); | 2372 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", EventQueueManager.llDetectNull, resobj); |
2372 | } | 2373 | } |
2373 | } | 2374 | } |
2374 | 2375 | ||
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs index a32a132..250a5df 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs | |||
@@ -76,13 +76,13 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
76 | public void changed(uint localID, uint change) | 76 | public void changed(uint localID, uint change) |
77 | { | 77 | { |
78 | // Add to queue for all scripts in localID, Object pass change. | 78 | // Add to queue for all scripts in localID, Object pass change. |
79 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID,"changed", new object[] {(int) change}); | 79 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "changed", EventQueueManager.llDetectNull, new object[] { (int)change }); |
80 | } | 80 | } |
81 | 81 | ||
82 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) | 82 | public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) |
83 | { | 83 | { |
84 | // Add to queue for all scripts in ObjectID object | 84 | // Add to queue for all scripts in ObjectID object |
85 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); | 85 | myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", EventQueueManager.llDetectNull, new object[] { (int)1 }); |
86 | } | 86 | } |
87 | 87 | ||
88 | public void OnRezScript(uint localID, LLUUID itemID, string script) | 88 | public void OnRezScript(uint localID, LLUUID itemID, string script) |
@@ -109,47 +109,47 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
109 | 109 | ||
110 | public void state_exit(uint localID, LLUUID itemID) | 110 | public void state_exit(uint localID, LLUUID itemID) |
111 | { | 111 | { |
112 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_exit"); | 112 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_exit", EventQueueManager.llDetectNull); |
113 | } | 113 | } |
114 | 114 | ||
115 | public void touch(uint localID, LLUUID itemID) | 115 | public void touch(uint localID, LLUUID itemID) |
116 | { | 116 | { |
117 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch"); | 117 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch", EventQueueManager.llDetectNull); |
118 | } | 118 | } |
119 | 119 | ||
120 | public void touch_end(uint localID, LLUUID itemID) | 120 | public void touch_end(uint localID, LLUUID itemID) |
121 | { | 121 | { |
122 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end"); | 122 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end", EventQueueManager.llDetectNull); |
123 | } | 123 | } |
124 | 124 | ||
125 | public void collision_start(uint localID, LLUUID itemID) | 125 | public void collision_start(uint localID, LLUUID itemID) |
126 | { | 126 | { |
127 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start"); | 127 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start", EventQueueManager.llDetectNull); |
128 | } | 128 | } |
129 | 129 | ||
130 | public void collision(uint localID, LLUUID itemID) | 130 | public void collision(uint localID, LLUUID itemID) |
131 | { | 131 | { |
132 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision"); | 132 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision", EventQueueManager.llDetectNull); |
133 | } | 133 | } |
134 | 134 | ||
135 | public void collision_end(uint localID, LLUUID itemID) | 135 | public void collision_end(uint localID, LLUUID itemID) |
136 | { | 136 | { |
137 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end"); | 137 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end", EventQueueManager.llDetectNull); |
138 | } | 138 | } |
139 | 139 | ||
140 | public void land_collision_start(uint localID, LLUUID itemID) | 140 | public void land_collision_start(uint localID, LLUUID itemID) |
141 | { | 141 | { |
142 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start"); | 142 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start", EventQueueManager.llDetectNull); |
143 | } | 143 | } |
144 | 144 | ||
145 | public void land_collision(uint localID, LLUUID itemID) | 145 | public void land_collision(uint localID, LLUUID itemID) |
146 | { | 146 | { |
147 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision"); | 147 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision", EventQueueManager.llDetectNull); |
148 | } | 148 | } |
149 | 149 | ||
150 | public void land_collision_end(uint localID, LLUUID itemID) | 150 | public void land_collision_end(uint localID, LLUUID itemID) |
151 | { | 151 | { |
152 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_end"); | 152 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_end", EventQueueManager.llDetectNull); |
153 | } | 153 | } |
154 | 154 | ||
155 | // Handled by long commands | 155 | // Handled by long commands |
@@ -160,108 +160,108 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
160 | 160 | ||
161 | public void listen(uint localID, LLUUID itemID) | 161 | public void listen(uint localID, LLUUID itemID) |
162 | { | 162 | { |
163 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "listen"); | 163 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "listen", EventQueueManager.llDetectNull); |
164 | } | 164 | } |
165 | 165 | ||
166 | public void on_rez(uint localID, LLUUID itemID) | 166 | public void on_rez(uint localID, LLUUID itemID) |
167 | { | 167 | { |
168 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "on_rez"); | 168 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "on_rez", EventQueueManager.llDetectNull); |
169 | } | 169 | } |
170 | 170 | ||
171 | public void sensor(uint localID, LLUUID itemID) | 171 | public void sensor(uint localID, LLUUID itemID) |
172 | { | 172 | { |
173 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "sensor"); | 173 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "sensor", EventQueueManager.llDetectNull); |
174 | } | 174 | } |
175 | 175 | ||
176 | public void no_sensor(uint localID, LLUUID itemID) | 176 | public void no_sensor(uint localID, LLUUID itemID) |
177 | { | 177 | { |
178 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor"); | 178 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor", EventQueueManager.llDetectNull); |
179 | } | 179 | } |
180 | 180 | ||
181 | public void control(uint localID, LLUUID itemID) | 181 | public void control(uint localID, LLUUID itemID) |
182 | { | 182 | { |
183 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control"); | 183 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control", EventQueueManager.llDetectNull); |
184 | } | 184 | } |
185 | 185 | ||
186 | public void money(uint localID, LLUUID itemID) | 186 | public void money(uint localID, LLUUID itemID) |
187 | { | 187 | { |
188 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "money"); | 188 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "money", EventQueueManager.llDetectNull); |
189 | } | 189 | } |
190 | 190 | ||
191 | public void email(uint localID, LLUUID itemID) | 191 | public void email(uint localID, LLUUID itemID) |
192 | { | 192 | { |
193 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email"); | 193 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email", EventQueueManager.llDetectNull); |
194 | } | 194 | } |
195 | 195 | ||
196 | public void at_target(uint localID, LLUUID itemID) | 196 | public void at_target(uint localID, LLUUID itemID) |
197 | { | 197 | { |
198 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target"); | 198 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target", EventQueueManager.llDetectNull); |
199 | } | 199 | } |
200 | 200 | ||
201 | public void not_at_target(uint localID, LLUUID itemID) | 201 | public void not_at_target(uint localID, LLUUID itemID) |
202 | { | 202 | { |
203 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target"); | 203 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target", EventQueueManager.llDetectNull); |
204 | } | 204 | } |
205 | 205 | ||
206 | public void at_rot_target(uint localID, LLUUID itemID) | 206 | public void at_rot_target(uint localID, LLUUID itemID) |
207 | { | 207 | { |
208 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_rot_target"); | 208 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_rot_target", EventQueueManager.llDetectNull); |
209 | } | 209 | } |
210 | 210 | ||
211 | public void not_at_rot_target(uint localID, LLUUID itemID) | 211 | public void not_at_rot_target(uint localID, LLUUID itemID) |
212 | { | 212 | { |
213 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_rot_target"); | 213 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_rot_target", EventQueueManager.llDetectNull); |
214 | } | 214 | } |
215 | 215 | ||
216 | public void run_time_permissions(uint localID, LLUUID itemID) | 216 | public void run_time_permissions(uint localID, LLUUID itemID) |
217 | { | 217 | { |
218 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "run_time_permissions"); | 218 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "run_time_permissions", EventQueueManager.llDetectNull); |
219 | } | 219 | } |
220 | 220 | ||
221 | public void changed(uint localID, LLUUID itemID) | 221 | public void changed(uint localID, LLUUID itemID) |
222 | { | 222 | { |
223 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "changed"); | 223 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "changed", EventQueueManager.llDetectNull); |
224 | } | 224 | } |
225 | 225 | ||
226 | public void attach(uint localID, LLUUID itemID) | 226 | public void attach(uint localID, LLUUID itemID) |
227 | { | 227 | { |
228 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "attach"); | 228 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "attach", EventQueueManager.llDetectNull); |
229 | } | 229 | } |
230 | 230 | ||
231 | public void dataserver(uint localID, LLUUID itemID) | 231 | public void dataserver(uint localID, LLUUID itemID) |
232 | { | 232 | { |
233 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "dataserver"); | 233 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "dataserver", EventQueueManager.llDetectNull); |
234 | } | 234 | } |
235 | 235 | ||
236 | public void link_message(uint localID, LLUUID itemID) | 236 | public void link_message(uint localID, LLUUID itemID) |
237 | { | 237 | { |
238 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "link_message"); | 238 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "link_message", EventQueueManager.llDetectNull); |
239 | } | 239 | } |
240 | 240 | ||
241 | public void moving_start(uint localID, LLUUID itemID) | 241 | public void moving_start(uint localID, LLUUID itemID) |
242 | { | 242 | { |
243 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_start"); | 243 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_start", EventQueueManager.llDetectNull); |
244 | } | 244 | } |
245 | 245 | ||
246 | public void moving_end(uint localID, LLUUID itemID) | 246 | public void moving_end(uint localID, LLUUID itemID) |
247 | { | 247 | { |
248 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_end"); | 248 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_end", EventQueueManager.llDetectNull); |
249 | } | 249 | } |
250 | 250 | ||
251 | public void object_rez(uint localID, LLUUID itemID) | 251 | public void object_rez(uint localID, LLUUID itemID) |
252 | { | 252 | { |
253 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "object_rez"); | 253 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "object_rez", EventQueueManager.llDetectNull); |
254 | } | 254 | } |
255 | 255 | ||
256 | public void remote_data(uint localID, LLUUID itemID) | 256 | public void remote_data(uint localID, LLUUID itemID) |
257 | { | 257 | { |
258 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "remote_data"); | 258 | myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "remote_data", EventQueueManager.llDetectNull); |
259 | } | 259 | } |
260 | 260 | ||
261 | // Handled by long commands | 261 | // Handled by long commands |
262 | public void http_response(uint localID, LLUUID itemID) | 262 | public void http_response(uint localID, LLUUID itemID) |
263 | { | 263 | { |
264 | // myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "http_response"); | 264 | // myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "http_response", EventQueueManager.llDetectNull); |
265 | } | 265 | } |
266 | } | 266 | } |
267 | } \ No newline at end of file | 267 | } \ No newline at end of file |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs index af91027..ced4863 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs | |||
@@ -96,10 +96,31 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
96 | public uint localID; | 96 | public uint localID; |
97 | public LLUUID itemID; | 97 | public LLUUID itemID; |
98 | public string functionName; | 98 | public string functionName; |
99 | public Queue_llDetectParams_Struct llDetectParams; | ||
99 | public object[] param; | 100 | public object[] param; |
100 | } | 101 | } |
101 | 102 | ||
102 | /// <summary> | 103 | /// <summary> |
104 | /// Shared empty llDetectNull | ||
105 | /// </summary> | ||
106 | public readonly static Queue_llDetectParams_Struct llDetectNull = new Queue_llDetectParams_Struct(); | ||
107 | |||
108 | /// <summary> | ||
109 | /// Structure to hold data for llDetect* commands | ||
110 | /// </summary> | ||
111 | public struct Queue_llDetectParams_Struct | ||
112 | { | ||
113 | // More or less just a placeholder for the actual moving of additional data | ||
114 | // should be fixed to something better :) | ||
115 | public LSL_Types.key[] _key; | ||
116 | public LSL_Types.Quaternion[] _Quaternion; | ||
117 | public LSL_Types.Vector3[] _Vector3; | ||
118 | public bool[] _bool; | ||
119 | public int[] _int; | ||
120 | public string [] _string; | ||
121 | } | ||
122 | |||
123 | /// <summary> | ||
103 | /// List of localID locks for mutex processing of script events | 124 | /// List of localID locks for mutex processing of script events |
104 | /// </summary> | 125 | /// </summary> |
105 | private List<uint> objectLocks = new List<uint>(); | 126 | private List<uint> objectLocks = new List<uint>(); |
@@ -211,7 +232,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
211 | + ", QIS.functionName: " + QIS.functionName); | 232 | + ", QIS.functionName: " + QIS.functionName); |
212 | #endif | 233 | #endif |
213 | m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, | 234 | m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, |
214 | QIS.functionName, QIS.param); | 235 | QIS.functionName, QIS.llDetectParams, QIS.param); |
215 | } | 236 | } |
216 | catch (Exception e) | 237 | catch (Exception e) |
217 | { | 238 | { |
@@ -311,10 +332,10 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
311 | /// <summary> | 332 | /// <summary> |
312 | /// Add event to event execution queue | 333 | /// Add event to event execution queue |
313 | /// </summary> | 334 | /// </summary> |
314 | /// <param name="localID"></param> | 335 | /// <param name="localID">Region object ID</param> |
315 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 336 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
316 | /// <param name="param">Array of parameters to match event mask</param> | 337 | /// <param name="param">Array of parameters to match event mask</param> |
317 | public void AddToObjectQueue(uint localID, string FunctionName, params object[] param) | 338 | public void AddToObjectQueue(uint localID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) |
318 | { | 339 | { |
319 | // Determine all scripts in Object and add to their queue | 340 | // Determine all scripts in Object and add to their queue |
320 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); | 341 | //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); |
@@ -334,18 +355,18 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
334 | { | 355 | { |
335 | // Add to each script in that object | 356 | // Add to each script in that object |
336 | // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? | 357 | // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter? |
337 | AddToScriptQueue(localID, itemID, FunctionName, param); | 358 | AddToScriptQueue(localID, itemID, FunctionName, qParams, param); |
338 | } | 359 | } |
339 | } | 360 | } |
340 | 361 | ||
341 | /// <summary> | 362 | /// <summary> |
342 | /// Add event to event execution queue | 363 | /// Add event to event execution queue |
343 | /// </summary> | 364 | /// </summary> |
344 | /// <param name="localID"></param> | 365 | /// <param name="localID">Region object ID</param> |
345 | /// <param name="itemID"></param> | 366 | /// <param name="itemID">Region script ID</param> |
346 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> | 367 | /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> |
347 | /// <param name="param">Array of parameters to match event mask</param> | 368 | /// <param name="param">Array of parameters to match event mask</param> |
348 | public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, params object[] param) | 369 | public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, Queue_llDetectParams_Struct qParams, params object[] param) |
349 | { | 370 | { |
350 | lock (queueLock) | 371 | lock (queueLock) |
351 | { | 372 | { |
@@ -354,6 +375,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
354 | QIS.localID = localID; | 375 | QIS.localID = localID; |
355 | QIS.itemID = itemID; | 376 | QIS.itemID = itemID; |
356 | QIS.functionName = FunctionName; | 377 | QIS.functionName = FunctionName; |
378 | QIS.llDetectParams = qParams; | ||
357 | QIS.param = param; | 379 | QIS.param = param; |
358 | 380 | ||
359 | // Add it to queue | 381 | // Add it to queue |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs index 7271d72..7d66638 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs | |||
@@ -185,7 +185,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
185 | if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) | 185 | if (ts.next.ToUniversalTime() < DateTime.Now.ToUniversalTime()) |
186 | { | 186 | { |
187 | // Add it to queue | 187 | // Add it to queue |
188 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", | 188 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(ts.localID, ts.itemID, "timer", EventQueueManager.llDetectNull, |
189 | new object[] {}); | 189 | new object[] {}); |
190 | // set next interval | 190 | // set next interval |
191 | 191 | ||
@@ -230,7 +230,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
230 | }; | 230 | }; |
231 | 231 | ||
232 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 232 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
233 | httpInfo.localID, httpInfo.itemID, "http_response", resobj | 233 | httpInfo.localID, httpInfo.itemID, "http_response", EventQueueManager.llDetectNull, resobj |
234 | ); | 234 | ); |
235 | 235 | ||
236 | httpInfo.Stop(); | 236 | httpInfo.Stop(); |
@@ -264,7 +264,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
264 | rInfo.GetStrVal() | 264 | rInfo.GetStrVal() |
265 | }; | 265 | }; |
266 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 266 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
267 | rInfo.GetLocalID(), rInfo.GetItemID(), "remote_data", resobj | 267 | rInfo.GetLocalID(), rInfo.GetItemID(), "remote_data", EventQueueManager.llDetectNull, resobj |
268 | ); | 268 | ); |
269 | } | 269 | } |
270 | } | 270 | } |
@@ -287,7 +287,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
287 | }; | 287 | }; |
288 | 288 | ||
289 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( | 289 | m_ScriptEngine.m_EventQueueManager.AddToScriptQueue( |
290 | lInfo.GetLocalID(), lInfo.GetItemID(), "listen", resobj | 290 | lInfo.GetLocalID(), lInfo.GetItemID(), "listen", EventQueueManager.llDetectNull, resobj |
291 | ); | 291 | ); |
292 | } | 292 | } |
293 | } | 293 | } |
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs index 784e849..ea87581 100644 --- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs | |||
@@ -232,7 +232,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
232 | /// <param name="itemID">Script ID</param> | 232 | /// <param name="itemID">Script ID</param> |
233 | /// <param name="FunctionName">Name of function</param> | 233 | /// <param name="FunctionName">Name of function</param> |
234 | /// <param name="args">Arguments to pass to function</param> | 234 | /// <param name="args">Arguments to pass to function</param> |
235 | internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, object[] args) | 235 | internal void ExecuteEvent(uint localID, LLUUID itemID, string FunctionName, EventQueueManager.Queue_llDetectParams_Struct qParams, object[] args) |
236 | { | 236 | { |
237 | #if DEBUG | 237 | #if DEBUG |
238 | Console.WriteLine("ScriptEngine: Inside ExecuteEvent for event " + FunctionName); | 238 | Console.WriteLine("ScriptEngine: Inside ExecuteEvent for event " + FunctionName); |
@@ -247,6 +247,7 @@ namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase | |||
247 | Console.WriteLine("ScriptEngine: Executing event: " + FunctionName); | 247 | Console.WriteLine("ScriptEngine: Executing event: " + FunctionName); |
248 | #endif | 248 | #endif |
249 | // Must be done in correct AppDomain, so leaving it up to the script itself | 249 | // Must be done in correct AppDomain, so leaving it up to the script itself |
250 | Script.llDetectParams = qParams; | ||
250 | Script.Exec.ExecuteEvent(FunctionName, args); | 251 | Script.Exec.ExecuteEvent(FunctionName, args); |
251 | } | 252 | } |
252 | 253 | ||
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs index 2bb40ee..3bc64be 100644 --- a/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/DotNetEngine/ScriptManager.cs | |||
@@ -36,6 +36,7 @@ using libsecondlife; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Environment.Scenes; | 37 | using OpenSim.Region.Environment.Scenes; |
38 | using OpenSim.Region.ScriptEngine.Common; | 38 | using OpenSim.Region.ScriptEngine.Common; |
39 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | ||
39 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; | 40 | using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; |
40 | 41 | ||
41 | namespace OpenSim.Region.ScriptEngine.DotNetEngine | 42 | namespace OpenSim.Region.ScriptEngine.DotNetEngine |
@@ -99,7 +100,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine | |||
99 | CompiledScript.Start(LSLB); | 100 | CompiledScript.Start(LSLB); |
100 | 101 | ||
101 | // Fire the first start-event | 102 | // Fire the first start-event |
102 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", new object[] { }); | 103 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); |
103 | } | 104 | } |
104 | catch (Exception e) | 105 | catch (Exception e) |
105 | { | 106 | { |
diff --git a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs index bd26ce4..de7b466 100644 --- a/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs +++ b/OpenSim/Region/ScriptEngine/LSOEngine/ScriptManager.cs | |||
@@ -36,6 +36,7 @@ using libsecondlife; | |||
36 | using OpenSim.Framework; | 36 | using OpenSim.Framework; |
37 | using OpenSim.Region.Environment.Scenes; | 37 | using OpenSim.Region.Environment.Scenes; |
38 | using OpenSim.Region.ScriptEngine.Common; | 38 | using OpenSim.Region.ScriptEngine.Common; |
39 | using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; | ||
39 | 40 | ||
40 | namespace OpenSim.Region.ScriptEngine.LSOEngine | 41 | namespace OpenSim.Region.ScriptEngine.LSOEngine |
41 | { | 42 | { |
@@ -96,7 +97,7 @@ namespace OpenSim.Region.ScriptEngine.LSOEngine | |||
96 | CompiledScript.Start(LSLB); | 97 | CompiledScript.Start(LSLB); |
97 | 98 | ||
98 | // Fire the first start-event | 99 | // Fire the first start-event |
99 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", new object[] { }); | 100 | m_scriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_entry", EventQueueManager.llDetectNull, new object[] { }); |
100 | } | 101 | } |
101 | catch (Exception e) | 102 | catch (Exception e) |
102 | { | 103 | { |