aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTedd Hansen2008-01-12 14:45:59 +0000
committerTedd Hansen2008-01-12 14:45:59 +0000
commit0081c060d0bb66e842a381e1a15a6cf01c0bd793 (patch)
tree19a02716e74838a6a7856a265cdc2319feb136b7
parentAdded license to new files (diff)
downloadopensim-SC-0081c060d0bb66e842a381e1a15a6cf01c0bd793.zip
opensim-SC-0081c060d0bb66e842a381e1a15a6cf01c0bd793.tar.gz
opensim-SC-0081c060d0bb66e842a381e1a15a6cf01c0bd793.tar.bz2
opensim-SC-0081c060d0bb66e842a381e1a15a6cf01c0bd793.tar.xz
Set eol
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs4328
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs6004
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs476
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs114
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs518
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs726
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs588
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs262
-rw-r--r--OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs694
9 files changed, 6855 insertions, 6855 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
index 5de9a85..43865c8 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BaseClass.cs
@@ -1,2165 +1,2165 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Runtime.Remoting.Lifetime; 31using System.Runtime.Remoting.Lifetime;
32using System.Threading; 32using System.Threading;
33using OpenSim.Region.ScriptEngine.Common; 33using OpenSim.Region.ScriptEngine.Common;
34using integer = System.Int32; 34using integer = System.Int32;
35using key = System.String; 35using key = System.String;
36using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3; 36using vector = OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3;
37using rotation = OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion; 37using rotation = OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion;
38 38
39namespace OpenSim.Region.ScriptEngine.Common 39namespace OpenSim.Region.ScriptEngine.Common
40{ 40{
41 public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript 41 public class LSL_BaseClass : MarshalByRefObject, LSL_BuiltIn_Commands_Interface, IScript
42 { 42 {
43 43
44 // 44 //
45 // Included as base for any LSL-script that is compiled. 45 // Included as base for any LSL-script that is compiled.
46 // Any function added here will be accessible to the LSL script. But it must also be added to "LSL_BuiltIn_Commands_Interface" in "OpenSim.Region.ScriptEngine.Common" class. 46 // Any function added here will be accessible to the LSL script. But it must also be added to "LSL_BuiltIn_Commands_Interface" in "OpenSim.Region.ScriptEngine.Common" class.
47 // 47 //
48 // Security note: This script will be running inside an restricted AppDomain. Currently AppDomain is not very restricted. 48 // Security note: This script will be running inside an restricted AppDomain. Currently AppDomain is not very restricted.
49 // 49 //
50 50
51 // Object never expires 51 // Object never expires
52 public override Object InitializeLifetimeService() 52 public override Object InitializeLifetimeService()
53 { 53 {
54 //Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()"); 54 //Console.WriteLine("LSL_BaseClass: InitializeLifetimeService()");
55 // return null; 55 // return null;
56 ILease lease = (ILease)base.InitializeLifetimeService(); 56 ILease lease = (ILease)base.InitializeLifetimeService();
57 57
58 if (lease.CurrentState == LeaseState.Initial) 58 if (lease.CurrentState == LeaseState.Initial)
59 { 59 {
60 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); 60 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1);
61 //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); 61 //lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
62 //lease.RenewOnCallTime = TimeSpan.FromSeconds(2); 62 //lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
63 } 63 }
64 return lease; 64 return lease;
65 } 65 }
66 66
67 67
68 private Executor m_Exec; 68 private Executor m_Exec;
69 69
70 Executor IScript.Exec 70 Executor IScript.Exec
71 { 71 {
72 get 72 get
73 { 73 {
74 if (m_Exec == null) 74 if (m_Exec == null)
75 m_Exec = new Executor(this); 75 m_Exec = new Executor(this);
76 return m_Exec; 76 return m_Exec;
77 } 77 }
78 } 78 }
79 79
80 80
81 public LSL_BuiltIn_Commands_Interface m_LSL_Functions; 81 public LSL_BuiltIn_Commands_Interface m_LSL_Functions;
82 private string _Source = ""; 82 private string _Source = "";
83 public string Source 83 public string Source
84 { 84 {
85 get 85 get
86 { 86 {
87 return _Source; 87 return _Source;
88 } 88 }
89 set { _Source = value; } 89 set { _Source = value; }
90 } 90 }
91 91
92 92
93 public LSL_BaseClass() 93 public LSL_BaseClass()
94 { 94 {
95 } 95 }
96 96
97 public string State() 97 public string State()
98 { 98 {
99 return m_LSL_Functions.State(); 99 return m_LSL_Functions.State();
100 } 100 }
101 101
102 102
103 103
104 public void Start(LSL_BuiltIn_Commands_Interface LSL_Functions) 104 public void Start(LSL_BuiltIn_Commands_Interface LSL_Functions)
105 { 105 {
106 m_LSL_Functions = LSL_Functions; 106 m_LSL_Functions = LSL_Functions;
107 107
108 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called."); 108 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called.");
109 109
110 // Get this AppDomain's settings and display some of them. 110 // Get this AppDomain's settings and display some of them.
111 AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation; 111 AppDomainSetup ads = AppDomain.CurrentDomain.SetupInformation;
112 Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}", 112 Console.WriteLine("AppName={0}, AppBase={1}, ConfigFile={2}",
113 ads.ApplicationName, 113 ads.ApplicationName,
114 ads.ApplicationBase, 114 ads.ApplicationBase,
115 ads.ConfigurationFile 115 ads.ConfigurationFile
116 ); 116 );
117 117
118 // Display the name of the calling AppDomain and the name 118 // Display the name of the calling AppDomain and the name
119 // of the second domain. 119 // of the second domain.
120 // NOTE: The application's thread has transitioned between 120 // NOTE: The application's thread has transitioned between
121 // AppDomains. 121 // AppDomains.
122 Console.WriteLine("Calling to '{0}'.", 122 Console.WriteLine("Calling to '{0}'.",
123 Thread.GetDomain().FriendlyName 123 Thread.GetDomain().FriendlyName
124 ); 124 );
125 125
126 return; 126 return;
127 } 127 }
128 128
129 129
130 // 130 //
131 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 131 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
132 // 132 //
133 // They are only forwarders to LSL_BuiltIn_Commands.cs 133 // They are only forwarders to LSL_BuiltIn_Commands.cs
134 // 134 //
135 public double llSin(double f) 135 public double llSin(double f)
136 { 136 {
137 return m_LSL_Functions.llSin(f); 137 return m_LSL_Functions.llSin(f);
138 } 138 }
139 139
140 public double llCos(double f) 140 public double llCos(double f)
141 { 141 {
142 return m_LSL_Functions.llCos(f); 142 return m_LSL_Functions.llCos(f);
143 } 143 }
144 144
145 public double llTan(double f) 145 public double llTan(double f)
146 { 146 {
147 return m_LSL_Functions.llTan(f); 147 return m_LSL_Functions.llTan(f);
148 } 148 }
149 149
150 public double llAtan2(double x, double y) 150 public double llAtan2(double x, double y)
151 { 151 {
152 return m_LSL_Functions.llAtan2(x, y); 152 return m_LSL_Functions.llAtan2(x, y);
153 } 153 }
154 154
155 public double llSqrt(double f) 155 public double llSqrt(double f)
156 { 156 {
157 return m_LSL_Functions.llSqrt(f); 157 return m_LSL_Functions.llSqrt(f);
158 } 158 }
159 159
160 public double llPow(double fbase, double fexponent) 160 public double llPow(double fbase, double fexponent)
161 { 161 {
162 return m_LSL_Functions.llPow(fbase, fexponent); 162 return m_LSL_Functions.llPow(fbase, fexponent);
163 } 163 }
164 164
165 public int llAbs(int i) 165 public int llAbs(int i)
166 { 166 {
167 return m_LSL_Functions.llAbs(i); 167 return m_LSL_Functions.llAbs(i);
168 } 168 }
169 169
170 public double llFabs(double f) 170 public double llFabs(double f)
171 { 171 {
172 return m_LSL_Functions.llFabs(f); 172 return m_LSL_Functions.llFabs(f);
173 } 173 }
174 174
175 public double llFrand(double mag) 175 public double llFrand(double mag)
176 { 176 {
177 return m_LSL_Functions.llFrand(mag); 177 return m_LSL_Functions.llFrand(mag);
178 } 178 }
179 179
180 public int llFloor(double f) 180 public int llFloor(double f)
181 { 181 {
182 return m_LSL_Functions.llFloor(f); 182 return m_LSL_Functions.llFloor(f);
183 } 183 }
184 184
185 public int llCeil(double f) 185 public int llCeil(double f)
186 { 186 {
187 return m_LSL_Functions.llCeil(f); 187 return m_LSL_Functions.llCeil(f);
188 } 188 }
189 189
190 public int llRound(double f) 190 public int llRound(double f)
191 { 191 {
192 return m_LSL_Functions.llRound(f); 192 return m_LSL_Functions.llRound(f);
193 } 193 }
194 194
195 public double llVecMag(vector v) 195 public double llVecMag(vector v)
196 { 196 {
197 return m_LSL_Functions.llVecMag(v); 197 return m_LSL_Functions.llVecMag(v);
198 } 198 }
199 199
200 public vector llVecNorm(vector v) 200 public vector llVecNorm(vector v)
201 { 201 {
202 return m_LSL_Functions.llVecNorm(v); 202 return m_LSL_Functions.llVecNorm(v);
203 } 203 }
204 204
205 public double llVecDist(vector a, vector b) 205 public double llVecDist(vector a, vector b)
206 { 206 {
207 return m_LSL_Functions.llVecDist(a, b); 207 return m_LSL_Functions.llVecDist(a, b);
208 } 208 }
209 209
210 public vector llRot2Euler(rotation r) 210 public vector llRot2Euler(rotation r)
211 { 211 {
212 return m_LSL_Functions.llRot2Euler(r); 212 return m_LSL_Functions.llRot2Euler(r);
213 } 213 }
214 214
215 public rotation llEuler2Rot(vector v) 215 public rotation llEuler2Rot(vector v)
216 { 216 {
217 return m_LSL_Functions.llEuler2Rot(v); 217 return m_LSL_Functions.llEuler2Rot(v);
218 } 218 }
219 219
220 public rotation llAxes2Rot(vector fwd, vector left, vector up) 220 public rotation llAxes2Rot(vector fwd, vector left, vector up)
221 { 221 {
222 return m_LSL_Functions.llAxes2Rot(fwd, left, up); 222 return m_LSL_Functions.llAxes2Rot(fwd, left, up);
223 } 223 }
224 224
225 public vector llRot2Fwd(rotation r) 225 public vector llRot2Fwd(rotation r)
226 { 226 {
227 return m_LSL_Functions.llRot2Fwd(r); 227 return m_LSL_Functions.llRot2Fwd(r);
228 } 228 }
229 229
230 public vector llRot2Left(rotation r) 230 public vector llRot2Left(rotation r)
231 { 231 {
232 return m_LSL_Functions.llRot2Left(r); 232 return m_LSL_Functions.llRot2Left(r);
233 } 233 }
234 234
235 public vector llRot2Up(rotation r) 235 public vector llRot2Up(rotation r)
236 { 236 {
237 return m_LSL_Functions.llRot2Up(r); 237 return m_LSL_Functions.llRot2Up(r);
238 } 238 }
239 239
240 public rotation llRotBetween(vector start, vector end) 240 public rotation llRotBetween(vector start, vector end)
241 { 241 {
242 return m_LSL_Functions.llRotBetween(start, end); 242 return m_LSL_Functions.llRotBetween(start, end);
243 } 243 }
244 244
245 public void llWhisper(int channelID, string text) 245 public void llWhisper(int channelID, string text)
246 { 246 {
247 m_LSL_Functions.llWhisper(channelID, text); 247 m_LSL_Functions.llWhisper(channelID, text);
248 } 248 }
249 249
250 public void llSay(int channelID, string text) 250 public void llSay(int channelID, string text)
251 { 251 {
252 m_LSL_Functions.llSay(channelID, text); 252 m_LSL_Functions.llSay(channelID, text);
253 } 253 }
254 254
255 // 255 //
256 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 256 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
257 // 257 //
258 public void llShout(int channelID, string text) 258 public void llShout(int channelID, string text)
259 { 259 {
260 m_LSL_Functions.llShout(channelID, text); 260 m_LSL_Functions.llShout(channelID, text);
261 } 261 }
262 262
263 public int llListen(int channelID, string name, string ID, string msg) 263 public int llListen(int channelID, string name, string ID, string msg)
264 { 264 {
265 return m_LSL_Functions.llListen(channelID, name, ID, msg); 265 return m_LSL_Functions.llListen(channelID, name, ID, msg);
266 } 266 }
267 267
268 public void llListenControl(int number, int active) 268 public void llListenControl(int number, int active)
269 { 269 {
270 m_LSL_Functions.llListenControl(number, active); 270 m_LSL_Functions.llListenControl(number, active);
271 } 271 }
272 272
273 public void llListenRemove(int number) 273 public void llListenRemove(int number)
274 { 274 {
275 m_LSL_Functions.llListenRemove(number); 275 m_LSL_Functions.llListenRemove(number);
276 } 276 }
277 277
278 public void llSensor(string name, string id, int type, double range, double arc) 278 public void llSensor(string name, string id, int type, double range, double arc)
279 { 279 {
280 m_LSL_Functions.llSensor(name, id, type, range, arc); 280 m_LSL_Functions.llSensor(name, id, type, range, arc);
281 } 281 }
282 282
283 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) 283 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
284 { 284 {
285 m_LSL_Functions.llSensorRepeat(name, id, type, range, arc, rate); 285 m_LSL_Functions.llSensorRepeat(name, id, type, range, arc, rate);
286 } 286 }
287 287
288 public void llSensorRemove() 288 public void llSensorRemove()
289 { 289 {
290 m_LSL_Functions.llSensorRemove(); 290 m_LSL_Functions.llSensorRemove();
291 } 291 }
292 292
293 public string llDetectedName(int number) 293 public string llDetectedName(int number)
294 { 294 {
295 return m_LSL_Functions.llDetectedName(number); 295 return m_LSL_Functions.llDetectedName(number);
296 } 296 }
297 297
298 public string llDetectedKey(int number) 298 public string llDetectedKey(int number)
299 { 299 {
300 return m_LSL_Functions.llDetectedKey(number); 300 return m_LSL_Functions.llDetectedKey(number);
301 } 301 }
302 302
303 public string llDetectedOwner(int number) 303 public string llDetectedOwner(int number)
304 { 304 {
305 return m_LSL_Functions.llDetectedOwner(number); 305 return m_LSL_Functions.llDetectedOwner(number);
306 } 306 }
307 307
308 public int llDetectedType(int number) 308 public int llDetectedType(int number)
309 { 309 {
310 return m_LSL_Functions.llDetectedType(number); 310 return m_LSL_Functions.llDetectedType(number);
311 } 311 }
312 312
313 public vector llDetectedPos(int number) 313 public vector llDetectedPos(int number)
314 { 314 {
315 return m_LSL_Functions.llDetectedPos(number); 315 return m_LSL_Functions.llDetectedPos(number);
316 } 316 }
317 317
318 public vector llDetectedVel(int number) 318 public vector llDetectedVel(int number)
319 { 319 {
320 return m_LSL_Functions.llDetectedVel(number); 320 return m_LSL_Functions.llDetectedVel(number);
321 } 321 }
322 322
323 public vector llDetectedGrab(int number) 323 public vector llDetectedGrab(int number)
324 { 324 {
325 return m_LSL_Functions.llDetectedGrab(number); 325 return m_LSL_Functions.llDetectedGrab(number);
326 } 326 }
327 327
328 public rotation llDetectedRot(int number) 328 public rotation llDetectedRot(int number)
329 { 329 {
330 return m_LSL_Functions.llDetectedRot(number); 330 return m_LSL_Functions.llDetectedRot(number);
331 } 331 }
332 332
333 public int llDetectedGroup(int number) 333 public int llDetectedGroup(int number)
334 { 334 {
335 return m_LSL_Functions.llDetectedGroup(number); 335 return m_LSL_Functions.llDetectedGroup(number);
336 } 336 }
337 337
338 public int llDetectedLinkNumber(int number) 338 public int llDetectedLinkNumber(int number)
339 { 339 {
340 return m_LSL_Functions.llDetectedLinkNumber(number); 340 return m_LSL_Functions.llDetectedLinkNumber(number);
341 } 341 }
342 342
343 // 343 //
344 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 344 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
345 // 345 //
346 public void llDie() 346 public void llDie()
347 { 347 {
348 m_LSL_Functions.llDie(); 348 m_LSL_Functions.llDie();
349 } 349 }
350 350
351 public double llGround(vector offset) 351 public double llGround(vector offset)
352 { 352 {
353 return m_LSL_Functions.llGround(offset); 353 return m_LSL_Functions.llGround(offset);
354 } 354 }
355 355
356 public double llCloud(vector offset) 356 public double llCloud(vector offset)
357 { 357 {
358 return m_LSL_Functions.llCloud(offset); 358 return m_LSL_Functions.llCloud(offset);
359 } 359 }
360 360
361 public vector llWind(vector offset) 361 public vector llWind(vector offset)
362 { 362 {
363 return m_LSL_Functions.llWind(offset); 363 return m_LSL_Functions.llWind(offset);
364 } 364 }
365 365
366 public void llSetStatus(int status, int value) 366 public void llSetStatus(int status, int value)
367 { 367 {
368 m_LSL_Functions.llSetStatus(status, value); 368 m_LSL_Functions.llSetStatus(status, value);
369 } 369 }
370 370
371 public int llGetStatus(int status) 371 public int llGetStatus(int status)
372 { 372 {
373 return m_LSL_Functions.llGetStatus(status); 373 return m_LSL_Functions.llGetStatus(status);
374 } 374 }
375 375
376 public void llSetScale(vector scale) 376 public void llSetScale(vector scale)
377 { 377 {
378 m_LSL_Functions.llSetScale(scale); 378 m_LSL_Functions.llSetScale(scale);
379 } 379 }
380 380
381 public vector llGetScale() 381 public vector llGetScale()
382 { 382 {
383 return m_LSL_Functions.llGetScale(); 383 return m_LSL_Functions.llGetScale();
384 } 384 }
385 385
386 public void llSetColor(vector color, int face) 386 public void llSetColor(vector color, int face)
387 { 387 {
388 m_LSL_Functions.llSetColor(color, face); 388 m_LSL_Functions.llSetColor(color, face);
389 } 389 }
390 390
391 public double llGetAlpha(int face) 391 public double llGetAlpha(int face)
392 { 392 {
393 return m_LSL_Functions.llGetAlpha(face); 393 return m_LSL_Functions.llGetAlpha(face);
394 } 394 }
395 395
396 public void llSetAlpha(double alpha, int face) 396 public void llSetAlpha(double alpha, int face)
397 { 397 {
398 m_LSL_Functions.llSetAlpha(alpha, face); 398 m_LSL_Functions.llSetAlpha(alpha, face);
399 } 399 }
400 400
401 public vector llGetColor(int face) 401 public vector llGetColor(int face)
402 { 402 {
403 return m_LSL_Functions.llGetColor(face); 403 return m_LSL_Functions.llGetColor(face);
404 } 404 }
405 405
406 public void llSetTexture(string texture, int face) 406 public void llSetTexture(string texture, int face)
407 { 407 {
408 m_LSL_Functions.llSetTexture(texture, face); 408 m_LSL_Functions.llSetTexture(texture, face);
409 } 409 }
410 410
411 public void llScaleTexture(double u, double v, int face) 411 public void llScaleTexture(double u, double v, int face)
412 { 412 {
413 m_LSL_Functions.llScaleTexture(u, v, face); 413 m_LSL_Functions.llScaleTexture(u, v, face);
414 } 414 }
415 415
416 public void llOffsetTexture(double u, double v, int face) 416 public void llOffsetTexture(double u, double v, int face)
417 { 417 {
418 m_LSL_Functions.llOffsetTexture(u, v, face); 418 m_LSL_Functions.llOffsetTexture(u, v, face);
419 } 419 }
420 420
421 public void llRotateTexture(double rotation, int face) 421 public void llRotateTexture(double rotation, int face)
422 { 422 {
423 m_LSL_Functions.llRotateTexture(rotation, face); 423 m_LSL_Functions.llRotateTexture(rotation, face);
424 } 424 }
425 425
426 public string llGetTexture(int face) 426 public string llGetTexture(int face)
427 { 427 {
428 return m_LSL_Functions.llGetTexture(face); 428 return m_LSL_Functions.llGetTexture(face);
429 } 429 }
430 430
431 // 431 //
432 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 432 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
433 // 433 //
434 public void llSetPos(vector pos) 434 public void llSetPos(vector pos)
435 { 435 {
436 m_LSL_Functions.llSetPos(pos); 436 m_LSL_Functions.llSetPos(pos);
437 } 437 }
438 438
439 public vector llGetPos() 439 public vector llGetPos()
440 { 440 {
441 return m_LSL_Functions.llGetPos(); 441 return m_LSL_Functions.llGetPos();
442 } 442 }
443 443
444 public vector llGetLocalPos() 444 public vector llGetLocalPos()
445 { 445 {
446 return m_LSL_Functions.llGetLocalPos(); 446 return m_LSL_Functions.llGetLocalPos();
447 } 447 }
448 448
449 public void llSetRot(rotation rot) 449 public void llSetRot(rotation rot)
450 { 450 {
451 m_LSL_Functions.llSetRot(rot); 451 m_LSL_Functions.llSetRot(rot);
452 } 452 }
453 453
454 public rotation llGetRot() 454 public rotation llGetRot()
455 { 455 {
456 return m_LSL_Functions.llGetRot(); 456 return m_LSL_Functions.llGetRot();
457 } 457 }
458 458
459 public rotation llGetLocalRot() 459 public rotation llGetLocalRot()
460 { 460 {
461 return m_LSL_Functions.llGetLocalRot(); 461 return m_LSL_Functions.llGetLocalRot();
462 } 462 }
463 463
464 public void llSetForce(vector force, int local) 464 public void llSetForce(vector force, int local)
465 { 465 {
466 m_LSL_Functions.llSetForce(force, local); 466 m_LSL_Functions.llSetForce(force, local);
467 } 467 }
468 468
469 public vector llGetForce() 469 public vector llGetForce()
470 { 470 {
471 return m_LSL_Functions.llGetForce(); 471 return m_LSL_Functions.llGetForce();
472 } 472 }
473 473
474 public int llTarget(vector position, double range) 474 public int llTarget(vector position, double range)
475 { 475 {
476 return m_LSL_Functions.llTarget(position, range); 476 return m_LSL_Functions.llTarget(position, range);
477 } 477 }
478 478
479 public void llTargetRemove(int number) 479 public void llTargetRemove(int number)
480 { 480 {
481 m_LSL_Functions.llTargetRemove(number); 481 m_LSL_Functions.llTargetRemove(number);
482 } 482 }
483 483
484 public int llRotTarget(rotation rot, double error) 484 public int llRotTarget(rotation rot, double error)
485 { 485 {
486 return m_LSL_Functions.llRotTarget(rot, error); 486 return m_LSL_Functions.llRotTarget(rot, error);
487 } 487 }
488 488
489 public void llRotTargetRemove(int number) 489 public void llRotTargetRemove(int number)
490 { 490 {
491 m_LSL_Functions.llRotTargetRemove(number); 491 m_LSL_Functions.llRotTargetRemove(number);
492 } 492 }
493 493
494 public void llMoveToTarget(vector target, double tau) 494 public void llMoveToTarget(vector target, double tau)
495 { 495 {
496 m_LSL_Functions.llMoveToTarget(target, tau); 496 m_LSL_Functions.llMoveToTarget(target, tau);
497 } 497 }
498 498
499 public void llStopMoveToTarget() 499 public void llStopMoveToTarget()
500 { 500 {
501 m_LSL_Functions.llStopMoveToTarget(); 501 m_LSL_Functions.llStopMoveToTarget();
502 } 502 }
503 503
504 public void llApplyImpulse(vector force, int local) 504 public void llApplyImpulse(vector force, int local)
505 { 505 {
506 m_LSL_Functions.llApplyImpulse(force, local); 506 m_LSL_Functions.llApplyImpulse(force, local);
507 } 507 }
508 508
509 // 509 //
510 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 510 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
511 // 511 //
512 public void llApplyRotationalImpulse(vector force, int local) 512 public void llApplyRotationalImpulse(vector force, int local)
513 { 513 {
514 m_LSL_Functions.llApplyRotationalImpulse(force, local); 514 m_LSL_Functions.llApplyRotationalImpulse(force, local);
515 } 515 }
516 516
517 public void llSetTorque(vector torque, int local) 517 public void llSetTorque(vector torque, int local)
518 { 518 {
519 m_LSL_Functions.llSetTorque(torque, local); 519 m_LSL_Functions.llSetTorque(torque, local);
520 } 520 }
521 521
522 public vector llGetTorque() 522 public vector llGetTorque()
523 { 523 {
524 return m_LSL_Functions.llGetTorque(); 524 return m_LSL_Functions.llGetTorque();
525 } 525 }
526 526
527 public void llSetForceAndTorque(vector force, vector torque, int local) 527 public void llSetForceAndTorque(vector force, vector torque, int local)
528 { 528 {
529 m_LSL_Functions.llSetForceAndTorque(force, torque, local); 529 m_LSL_Functions.llSetForceAndTorque(force, torque, local);
530 } 530 }
531 531
532 public vector llGetVel() 532 public vector llGetVel()
533 { 533 {
534 return m_LSL_Functions.llGetVel(); 534 return m_LSL_Functions.llGetVel();
535 } 535 }
536 536
537 public vector llGetAccel() 537 public vector llGetAccel()
538 { 538 {
539 return m_LSL_Functions.llGetAccel(); 539 return m_LSL_Functions.llGetAccel();
540 } 540 }
541 541
542 public vector llGetOmega() 542 public vector llGetOmega()
543 { 543 {
544 return m_LSL_Functions.llGetOmega(); 544 return m_LSL_Functions.llGetOmega();
545 } 545 }
546 546
547 public double llGetTimeOfDay() 547 public double llGetTimeOfDay()
548 { 548 {
549 return m_LSL_Functions.llGetTimeOfDay(); 549 return m_LSL_Functions.llGetTimeOfDay();
550 } 550 }
551 551
552 public double llGetWallclock() 552 public double llGetWallclock()
553 { 553 {
554 return m_LSL_Functions.llGetWallclock(); 554 return m_LSL_Functions.llGetWallclock();
555 } 555 }
556 556
557 public double llGetTime() 557 public double llGetTime()
558 { 558 {
559 return m_LSL_Functions.llGetTime(); 559 return m_LSL_Functions.llGetTime();
560 } 560 }
561 561
562 public void llResetTime() 562 public void llResetTime()
563 { 563 {
564 m_LSL_Functions.llResetTime(); 564 m_LSL_Functions.llResetTime();
565 } 565 }
566 566
567 public double llGetAndResetTime() 567 public double llGetAndResetTime()
568 { 568 {
569 return m_LSL_Functions.llGetAndResetTime(); 569 return m_LSL_Functions.llGetAndResetTime();
570 } 570 }
571 571
572 public void llSound() 572 public void llSound()
573 { 573 {
574 m_LSL_Functions.llSound(); 574 m_LSL_Functions.llSound();
575 } 575 }
576 576
577 public void llPlaySound(string sound, double volume) 577 public void llPlaySound(string sound, double volume)
578 { 578 {
579 m_LSL_Functions.llPlaySound(sound, volume); 579 m_LSL_Functions.llPlaySound(sound, volume);
580 } 580 }
581 581
582 public void llLoopSound(string sound, double volume) 582 public void llLoopSound(string sound, double volume)
583 { 583 {
584 m_LSL_Functions.llLoopSound(sound, volume); 584 m_LSL_Functions.llLoopSound(sound, volume);
585 } 585 }
586 586
587 public void llLoopSoundMaster(string sound, double volume) 587 public void llLoopSoundMaster(string sound, double volume)
588 { 588 {
589 m_LSL_Functions.llLoopSoundMaster(sound, volume); 589 m_LSL_Functions.llLoopSoundMaster(sound, volume);
590 } 590 }
591 591
592 public void llLoopSoundSlave(string sound, double volume) 592 public void llLoopSoundSlave(string sound, double volume)
593 { 593 {
594 m_LSL_Functions.llLoopSoundSlave(sound, volume); 594 m_LSL_Functions.llLoopSoundSlave(sound, volume);
595 } 595 }
596 596
597 public void llPlaySoundSlave(string sound, double volume) 597 public void llPlaySoundSlave(string sound, double volume)
598 { 598 {
599 m_LSL_Functions.llPlaySoundSlave(sound, volume); 599 m_LSL_Functions.llPlaySoundSlave(sound, volume);
600 } 600 }
601 601
602 // 602 //
603 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 603 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
604 // 604 //
605 public void llTriggerSound(string sound, double volume) 605 public void llTriggerSound(string sound, double volume)
606 { 606 {
607 m_LSL_Functions.llTriggerSound(sound, volume); 607 m_LSL_Functions.llTriggerSound(sound, volume);
608 } 608 }
609 609
610 public void llStopSound() 610 public void llStopSound()
611 { 611 {
612 m_LSL_Functions.llStopSound(); 612 m_LSL_Functions.llStopSound();
613 } 613 }
614 614
615 public void llPreloadSound(string sound) 615 public void llPreloadSound(string sound)
616 { 616 {
617 m_LSL_Functions.llPreloadSound(sound); 617 m_LSL_Functions.llPreloadSound(sound);
618 } 618 }
619 619
620 public string llGetSubString(string src, int start, int end) 620 public string llGetSubString(string src, int start, int end)
621 { 621 {
622 return m_LSL_Functions.llGetSubString(src, start, end); 622 return m_LSL_Functions.llGetSubString(src, start, end);
623 } 623 }
624 624
625 public string llDeleteSubString(string src, int start, int end) 625 public string llDeleteSubString(string src, int start, int end)
626 { 626 {
627 return m_LSL_Functions.llDeleteSubString(src, start, end); 627 return m_LSL_Functions.llDeleteSubString(src, start, end);
628 } 628 }
629 629
630 public string llInsertString(string dst, int position, string src) 630 public string llInsertString(string dst, int position, string src)
631 { 631 {
632 return m_LSL_Functions.llInsertString(dst, position, src); 632 return m_LSL_Functions.llInsertString(dst, position, src);
633 } 633 }
634 634
635 public string llToUpper(string source) 635 public string llToUpper(string source)
636 { 636 {
637 return m_LSL_Functions.llToUpper(source); 637 return m_LSL_Functions.llToUpper(source);
638 } 638 }
639 639
640 public string llToLower(string source) 640 public string llToLower(string source)
641 { 641 {
642 return m_LSL_Functions.llToLower(source); 642 return m_LSL_Functions.llToLower(source);
643 } 643 }
644 644
645 public int llGiveMoney(string destination, int amount) 645 public int llGiveMoney(string destination, int amount)
646 { 646 {
647 return m_LSL_Functions.llGiveMoney(destination, amount); 647 return m_LSL_Functions.llGiveMoney(destination, amount);
648 } 648 }
649 649
650 public void llMakeExplosion() 650 public void llMakeExplosion()
651 { 651 {
652 m_LSL_Functions.llMakeExplosion(); 652 m_LSL_Functions.llMakeExplosion();
653 } 653 }
654 654
655 public void llMakeFountain() 655 public void llMakeFountain()
656 { 656 {
657 m_LSL_Functions.llMakeFountain(); 657 m_LSL_Functions.llMakeFountain();
658 } 658 }
659 659
660 public void llMakeSmoke() 660 public void llMakeSmoke()
661 { 661 {
662 m_LSL_Functions.llMakeSmoke(); 662 m_LSL_Functions.llMakeSmoke();
663 } 663 }
664 664
665 public void llMakeFire() 665 public void llMakeFire()
666 { 666 {
667 m_LSL_Functions.llMakeFire(); 667 m_LSL_Functions.llMakeFire();
668 } 668 }
669 669
670 public void llRezObject(string inventory, vector pos, rotation rot, int param) 670 public void llRezObject(string inventory, vector pos, rotation rot, int param)
671 { 671 {
672 m_LSL_Functions.llRezObject(inventory, pos, rot, param); 672 m_LSL_Functions.llRezObject(inventory, pos, rot, param);
673 } 673 }
674 674
675 public void llLookAt(vector target, double strength, double damping) 675 public void llLookAt(vector target, double strength, double damping)
676 { 676 {
677 m_LSL_Functions.llLookAt(target, strength, damping); 677 m_LSL_Functions.llLookAt(target, strength, damping);
678 } 678 }
679 679
680 public void llStopLookAt() 680 public void llStopLookAt()
681 { 681 {
682 m_LSL_Functions.llStopLookAt(); 682 m_LSL_Functions.llStopLookAt();
683 } 683 }
684 684
685 public void llSetTimerEvent(double sec) 685 public void llSetTimerEvent(double sec)
686 { 686 {
687 m_LSL_Functions.llSetTimerEvent(sec); 687 m_LSL_Functions.llSetTimerEvent(sec);
688 } 688 }
689 689
690 public void llSleep(double sec) 690 public void llSleep(double sec)
691 { 691 {
692 m_LSL_Functions.llSleep(sec); 692 m_LSL_Functions.llSleep(sec);
693 } 693 }
694 694
695 // 695 //
696 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 696 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
697 // 697 //
698 public double llGetMass() 698 public double llGetMass()
699 { 699 {
700 return m_LSL_Functions.llGetMass(); 700 return m_LSL_Functions.llGetMass();
701 } 701 }
702 702
703 public void llCollisionFilter(string name, string id, int accept) 703 public void llCollisionFilter(string name, string id, int accept)
704 { 704 {
705 m_LSL_Functions.llCollisionFilter(name, id, accept); 705 m_LSL_Functions.llCollisionFilter(name, id, accept);
706 } 706 }
707 707
708 public void llTakeControls(int controls, int accept, int pass_on) 708 public void llTakeControls(int controls, int accept, int pass_on)
709 { 709 {
710 m_LSL_Functions.llTakeControls(controls, accept, pass_on); 710 m_LSL_Functions.llTakeControls(controls, accept, pass_on);
711 } 711 }
712 712
713 public void llReleaseControls() 713 public void llReleaseControls()
714 { 714 {
715 m_LSL_Functions.llReleaseControls(); 715 m_LSL_Functions.llReleaseControls();
716 } 716 }
717 717
718 public void llAttachToAvatar(int attachment) 718 public void llAttachToAvatar(int attachment)
719 { 719 {
720 m_LSL_Functions.llAttachToAvatar(attachment); 720 m_LSL_Functions.llAttachToAvatar(attachment);
721 } 721 }
722 722
723 public void llDetachFromAvatar() 723 public void llDetachFromAvatar()
724 { 724 {
725 m_LSL_Functions.llDetachFromAvatar(); 725 m_LSL_Functions.llDetachFromAvatar();
726 } 726 }
727 727
728 public void llTakeCamera() 728 public void llTakeCamera()
729 { 729 {
730 m_LSL_Functions.llTakeCamera(); 730 m_LSL_Functions.llTakeCamera();
731 } 731 }
732 732
733 public void llReleaseCamera() 733 public void llReleaseCamera()
734 { 734 {
735 m_LSL_Functions.llReleaseCamera(); 735 m_LSL_Functions.llReleaseCamera();
736 } 736 }
737 737
738 public string llGetOwner() 738 public string llGetOwner()
739 { 739 {
740 return m_LSL_Functions.llGetOwner(); 740 return m_LSL_Functions.llGetOwner();
741 } 741 }
742 742
743 public void llInstantMessage(string user, string message) 743 public void llInstantMessage(string user, string message)
744 { 744 {
745 m_LSL_Functions.llInstantMessage(user, message); 745 m_LSL_Functions.llInstantMessage(user, message);
746 } 746 }
747 747
748 public void llEmail(string address, string subject, string message) 748 public void llEmail(string address, string subject, string message)
749 { 749 {
750 m_LSL_Functions.llEmail(address, subject, message); 750 m_LSL_Functions.llEmail(address, subject, message);
751 } 751 }
752 752
753 public void llGetNextEmail(string address, string subject) 753 public void llGetNextEmail(string address, string subject)
754 { 754 {
755 m_LSL_Functions.llGetNextEmail(address, subject); 755 m_LSL_Functions.llGetNextEmail(address, subject);
756 } 756 }
757 757
758 public string llGetKey() 758 public string llGetKey()
759 { 759 {
760 return m_LSL_Functions.llGetKey(); 760 return m_LSL_Functions.llGetKey();
761 } 761 }
762 762
763 public void llSetBuoyancy(double buoyancy) 763 public void llSetBuoyancy(double buoyancy)
764 { 764 {
765 m_LSL_Functions.llSetBuoyancy(buoyancy); 765 m_LSL_Functions.llSetBuoyancy(buoyancy);
766 } 766 }
767 767
768 public void llSetHoverHeight(double height, int water, double tau) 768 public void llSetHoverHeight(double height, int water, double tau)
769 { 769 {
770 m_LSL_Functions.llSetHoverHeight(height, water, tau); 770 m_LSL_Functions.llSetHoverHeight(height, water, tau);
771 } 771 }
772 772
773 public void llStopHover() 773 public void llStopHover()
774 { 774 {
775 m_LSL_Functions.llStopHover(); 775 m_LSL_Functions.llStopHover();
776 } 776 }
777 777
778 public void llMinEventDelay(double delay) 778 public void llMinEventDelay(double delay)
779 { 779 {
780 m_LSL_Functions.llMinEventDelay(delay); 780 m_LSL_Functions.llMinEventDelay(delay);
781 } 781 }
782 782
783 public void llSoundPreload() 783 public void llSoundPreload()
784 { 784 {
785 m_LSL_Functions.llSoundPreload(); 785 m_LSL_Functions.llSoundPreload();
786 } 786 }
787 787
788 public void llRotLookAt(rotation target, double strength, double damping) 788 public void llRotLookAt(rotation target, double strength, double damping)
789 { 789 {
790 m_LSL_Functions.llRotLookAt(target, strength, damping); 790 m_LSL_Functions.llRotLookAt(target, strength, damping);
791 } 791 }
792 792
793 // 793 //
794 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 794 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
795 // 795 //
796 public int llStringLength(string str) 796 public int llStringLength(string str)
797 { 797 {
798 return m_LSL_Functions.llStringLength(str); 798 return m_LSL_Functions.llStringLength(str);
799 } 799 }
800 800
801 public void llStartAnimation(string anim) 801 public void llStartAnimation(string anim)
802 { 802 {
803 m_LSL_Functions.llStartAnimation(anim); 803 m_LSL_Functions.llStartAnimation(anim);
804 } 804 }
805 805
806 public void llStopAnimation(string anim) 806 public void llStopAnimation(string anim)
807 { 807 {
808 m_LSL_Functions.llStopAnimation(anim); 808 m_LSL_Functions.llStopAnimation(anim);
809 } 809 }
810 810
811 public void llPointAt() 811 public void llPointAt()
812 { 812 {
813 m_LSL_Functions.llPointAt(); 813 m_LSL_Functions.llPointAt();
814 } 814 }
815 815
816 public void llStopPointAt() 816 public void llStopPointAt()
817 { 817 {
818 m_LSL_Functions.llStopPointAt(); 818 m_LSL_Functions.llStopPointAt();
819 } 819 }
820 820
821 public void llTargetOmega(vector axis, double spinrate, double gain) 821 public void llTargetOmega(vector axis, double spinrate, double gain)
822 { 822 {
823 m_LSL_Functions.llTargetOmega(axis, spinrate, gain); 823 m_LSL_Functions.llTargetOmega(axis, spinrate, gain);
824 } 824 }
825 825
826 public int llGetStartParameter() 826 public int llGetStartParameter()
827 { 827 {
828 return m_LSL_Functions.llGetStartParameter(); 828 return m_LSL_Functions.llGetStartParameter();
829 } 829 }
830 830
831 public void llGodLikeRezObject(string inventory, vector pos) 831 public void llGodLikeRezObject(string inventory, vector pos)
832 { 832 {
833 m_LSL_Functions.llGodLikeRezObject(inventory, pos); 833 m_LSL_Functions.llGodLikeRezObject(inventory, pos);
834 } 834 }
835 835
836 public void llRequestPermissions(string agent, int perm) 836 public void llRequestPermissions(string agent, int perm)
837 { 837 {
838 m_LSL_Functions.llRequestPermissions(agent, perm); 838 m_LSL_Functions.llRequestPermissions(agent, perm);
839 } 839 }
840 840
841 public string llGetPermissionsKey() 841 public string llGetPermissionsKey()
842 { 842 {
843 return m_LSL_Functions.llGetPermissionsKey(); 843 return m_LSL_Functions.llGetPermissionsKey();
844 } 844 }
845 845
846 public int llGetPermissions() 846 public int llGetPermissions()
847 { 847 {
848 return m_LSL_Functions.llGetPermissions(); 848 return m_LSL_Functions.llGetPermissions();
849 } 849 }
850 850
851 public int llGetLinkNumber() 851 public int llGetLinkNumber()
852 { 852 {
853 return m_LSL_Functions.llGetLinkNumber(); 853 return m_LSL_Functions.llGetLinkNumber();
854 } 854 }
855 855
856 public void llSetLinkColor(int linknumber, vector color, int face) 856 public void llSetLinkColor(int linknumber, vector color, int face)
857 { 857 {
858 m_LSL_Functions.llSetLinkColor(linknumber, color, face); 858 m_LSL_Functions.llSetLinkColor(linknumber, color, face);
859 } 859 }
860 860
861 public void llCreateLink(string target, int parent) 861 public void llCreateLink(string target, int parent)
862 { 862 {
863 m_LSL_Functions.llCreateLink(target, parent); 863 m_LSL_Functions.llCreateLink(target, parent);
864 } 864 }
865 865
866 public void llBreakLink(int linknum) 866 public void llBreakLink(int linknum)
867 { 867 {
868 m_LSL_Functions.llBreakLink(linknum); 868 m_LSL_Functions.llBreakLink(linknum);
869 } 869 }
870 870
871 public void llBreakAllLinks() 871 public void llBreakAllLinks()
872 { 872 {
873 m_LSL_Functions.llBreakAllLinks(); 873 m_LSL_Functions.llBreakAllLinks();
874 } 874 }
875 875
876 public string llGetLinkKey(int linknum) 876 public string llGetLinkKey(int linknum)
877 { 877 {
878 return m_LSL_Functions.llGetLinkKey(linknum); 878 return m_LSL_Functions.llGetLinkKey(linknum);
879 } 879 }
880 880
881 public string llGetLinkName(int linknum) 881 public string llGetLinkName(int linknum)
882 { 882 {
883 return m_LSL_Functions.llGetLinkName(linknum); 883 return m_LSL_Functions.llGetLinkName(linknum);
884 } 884 }
885 885
886 public int llGetInventoryNumber(int type) 886 public int llGetInventoryNumber(int type)
887 { 887 {
888 return m_LSL_Functions.llGetInventoryNumber(type); 888 return m_LSL_Functions.llGetInventoryNumber(type);
889 } 889 }
890 890
891 public string llGetInventoryName(int type, int number) 891 public string llGetInventoryName(int type, int number)
892 { 892 {
893 return m_LSL_Functions.llGetInventoryName(type, number); 893 return m_LSL_Functions.llGetInventoryName(type, number);
894 } 894 }
895 895
896 // 896 //
897 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 897 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
898 // 898 //
899 public void llSetScriptState(string name, int run) 899 public void llSetScriptState(string name, int run)
900 { 900 {
901 m_LSL_Functions.llSetScriptState(name, run); 901 m_LSL_Functions.llSetScriptState(name, run);
902 } 902 }
903 903
904 public double llGetEnergy() 904 public double llGetEnergy()
905 { 905 {
906 return m_LSL_Functions.llGetEnergy(); 906 return m_LSL_Functions.llGetEnergy();
907 } 907 }
908 908
909 public void llGiveInventory(string destination, string inventory) 909 public void llGiveInventory(string destination, string inventory)
910 { 910 {
911 m_LSL_Functions.llGiveInventory(destination, inventory); 911 m_LSL_Functions.llGiveInventory(destination, inventory);
912 } 912 }
913 913
914 public void llRemoveInventory(string item) 914 public void llRemoveInventory(string item)
915 { 915 {
916 m_LSL_Functions.llRemoveInventory(item); 916 m_LSL_Functions.llRemoveInventory(item);
917 } 917 }
918 918
919 public void llSetText(string text, vector color, double alpha) 919 public void llSetText(string text, vector color, double alpha)
920 { 920 {
921 m_LSL_Functions.llSetText(text, color, alpha); 921 m_LSL_Functions.llSetText(text, color, alpha);
922 } 922 }
923 923
924 public double llWater(vector offset) 924 public double llWater(vector offset)
925 { 925 {
926 return m_LSL_Functions.llWater(offset); 926 return m_LSL_Functions.llWater(offset);
927 } 927 }
928 928
929 public void llPassTouches(int pass) 929 public void llPassTouches(int pass)
930 { 930 {
931 m_LSL_Functions.llPassTouches(pass); 931 m_LSL_Functions.llPassTouches(pass);
932 } 932 }
933 933
934 public string llRequestAgentData(string id, int data) 934 public string llRequestAgentData(string id, int data)
935 { 935 {
936 return m_LSL_Functions.llRequestAgentData(id, data); 936 return m_LSL_Functions.llRequestAgentData(id, data);
937 } 937 }
938 938
939 public string llRequestInventoryData(string name) 939 public string llRequestInventoryData(string name)
940 { 940 {
941 return m_LSL_Functions.llRequestInventoryData(name); 941 return m_LSL_Functions.llRequestInventoryData(name);
942 } 942 }
943 943
944 public void llSetDamage(double damage) 944 public void llSetDamage(double damage)
945 { 945 {
946 m_LSL_Functions.llSetDamage(damage); 946 m_LSL_Functions.llSetDamage(damage);
947 } 947 }
948 948
949 public void llTeleportAgentHome(string agent) 949 public void llTeleportAgentHome(string agent)
950 { 950 {
951 m_LSL_Functions.llTeleportAgentHome(agent); 951 m_LSL_Functions.llTeleportAgentHome(agent);
952 } 952 }
953 953
954 public void llModifyLand(int action, int brush) 954 public void llModifyLand(int action, int brush)
955 { 955 {
956 m_LSL_Functions.llModifyLand(action, brush); 956 m_LSL_Functions.llModifyLand(action, brush);
957 } 957 }
958 958
959 public void llCollisionSound(string impact_sound, double impact_volume) 959 public void llCollisionSound(string impact_sound, double impact_volume)
960 { 960 {
961 m_LSL_Functions.llCollisionSound(impact_sound, impact_volume); 961 m_LSL_Functions.llCollisionSound(impact_sound, impact_volume);
962 } 962 }
963 963
964 public void llCollisionSprite(string impact_sprite) 964 public void llCollisionSprite(string impact_sprite)
965 { 965 {
966 m_LSL_Functions.llCollisionSprite(impact_sprite); 966 m_LSL_Functions.llCollisionSprite(impact_sprite);
967 } 967 }
968 968
969 public string llGetAnimation(string id) 969 public string llGetAnimation(string id)
970 { 970 {
971 return m_LSL_Functions.llGetAnimation(id); 971 return m_LSL_Functions.llGetAnimation(id);
972 } 972 }
973 973
974 public void llResetScript() 974 public void llResetScript()
975 { 975 {
976 m_LSL_Functions.llResetScript(); 976 m_LSL_Functions.llResetScript();
977 } 977 }
978 978
979 public void llMessageLinked(int linknum, int num, string str, string id) 979 public void llMessageLinked(int linknum, int num, string str, string id)
980 { 980 {
981 m_LSL_Functions.llMessageLinked(linknum, num, str, id); 981 m_LSL_Functions.llMessageLinked(linknum, num, str, id);
982 } 982 }
983 983
984 public void llPushObject(string target, vector impulse, vector ang_impulse, int local) 984 public void llPushObject(string target, vector impulse, vector ang_impulse, int local)
985 { 985 {
986 m_LSL_Functions.llPushObject(target, impulse, ang_impulse, local); 986 m_LSL_Functions.llPushObject(target, impulse, ang_impulse, local);
987 } 987 }
988 988
989 public void llPassCollisions(int pass) 989 public void llPassCollisions(int pass)
990 { 990 {
991 m_LSL_Functions.llPassCollisions(pass); 991 m_LSL_Functions.llPassCollisions(pass);
992 } 992 }
993 993
994 public string llGetScriptName() 994 public string llGetScriptName()
995 { 995 {
996 return m_LSL_Functions.llGetScriptName(); 996 return m_LSL_Functions.llGetScriptName();
997 } 997 }
998 998
999 public int llGetNumberOfSides() 999 public int llGetNumberOfSides()
1000 { 1000 {
1001 return m_LSL_Functions.llGetNumberOfSides(); 1001 return m_LSL_Functions.llGetNumberOfSides();
1002 } 1002 }
1003 1003
1004 // 1004 //
1005 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1005 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1006 // 1006 //
1007 public rotation llAxisAngle2Rot(vector axis, double angle) 1007 public rotation llAxisAngle2Rot(vector axis, double angle)
1008 { 1008 {
1009 return m_LSL_Functions.llAxisAngle2Rot(axis, angle); 1009 return m_LSL_Functions.llAxisAngle2Rot(axis, angle);
1010 } 1010 }
1011 1011
1012 public vector llRot2Axis(rotation rot) 1012 public vector llRot2Axis(rotation rot)
1013 { 1013 {
1014 return m_LSL_Functions.llRot2Axis(rot); 1014 return m_LSL_Functions.llRot2Axis(rot);
1015 } 1015 }
1016 1016
1017 public void llRot2Angle() 1017 public void llRot2Angle()
1018 { 1018 {
1019 m_LSL_Functions.llRot2Angle(); 1019 m_LSL_Functions.llRot2Angle();
1020 } 1020 }
1021 1021
1022 public double llAcos(double val) 1022 public double llAcos(double val)
1023 { 1023 {
1024 return m_LSL_Functions.llAcos(val); 1024 return m_LSL_Functions.llAcos(val);
1025 } 1025 }
1026 1026
1027 public double llAsin(double val) 1027 public double llAsin(double val)
1028 { 1028 {
1029 return m_LSL_Functions.llAsin(val); 1029 return m_LSL_Functions.llAsin(val);
1030 } 1030 }
1031 1031
1032 public double llAngleBetween(rotation a, rotation b) 1032 public double llAngleBetween(rotation a, rotation b)
1033 { 1033 {
1034 return m_LSL_Functions.llAngleBetween(a, b); 1034 return m_LSL_Functions.llAngleBetween(a, b);
1035 } 1035 }
1036 1036
1037 public string llGetInventoryKey(string name) 1037 public string llGetInventoryKey(string name)
1038 { 1038 {
1039 return m_LSL_Functions.llGetInventoryKey(name); 1039 return m_LSL_Functions.llGetInventoryKey(name);
1040 } 1040 }
1041 1041
1042 public void llAllowInventoryDrop(int add) 1042 public void llAllowInventoryDrop(int add)
1043 { 1043 {
1044 m_LSL_Functions.llAllowInventoryDrop(add); 1044 m_LSL_Functions.llAllowInventoryDrop(add);
1045 } 1045 }
1046 1046
1047 public vector llGetSunDirection() 1047 public vector llGetSunDirection()
1048 { 1048 {
1049 return m_LSL_Functions.llGetSunDirection(); 1049 return m_LSL_Functions.llGetSunDirection();
1050 } 1050 }
1051 1051
1052 public vector llGetTextureOffset(int face) 1052 public vector llGetTextureOffset(int face)
1053 { 1053 {
1054 return m_LSL_Functions.llGetTextureOffset(face); 1054 return m_LSL_Functions.llGetTextureOffset(face);
1055 } 1055 }
1056 1056
1057 public vector llGetTextureScale(int side) 1057 public vector llGetTextureScale(int side)
1058 { 1058 {
1059 return m_LSL_Functions.llGetTextureScale(side); 1059 return m_LSL_Functions.llGetTextureScale(side);
1060 } 1060 }
1061 1061
1062 public double llGetTextureRot(int side) 1062 public double llGetTextureRot(int side)
1063 { 1063 {
1064 return m_LSL_Functions.llGetTextureRot(side); 1064 return m_LSL_Functions.llGetTextureRot(side);
1065 } 1065 }
1066 1066
1067 public int llSubStringIndex(string source, string pattern) 1067 public int llSubStringIndex(string source, string pattern)
1068 { 1068 {
1069 return m_LSL_Functions.llSubStringIndex(source, pattern); 1069 return m_LSL_Functions.llSubStringIndex(source, pattern);
1070 } 1070 }
1071 1071
1072 public string llGetOwnerKey(string id) 1072 public string llGetOwnerKey(string id)
1073 { 1073 {
1074 return m_LSL_Functions.llGetOwnerKey(id); 1074 return m_LSL_Functions.llGetOwnerKey(id);
1075 } 1075 }
1076 1076
1077 public vector llGetCenterOfMass() 1077 public vector llGetCenterOfMass()
1078 { 1078 {
1079 return m_LSL_Functions.llGetCenterOfMass(); 1079 return m_LSL_Functions.llGetCenterOfMass();
1080 } 1080 }
1081 1081
1082 public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) 1082 public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending)
1083 { 1083 {
1084 return m_LSL_Functions.llListSort(src, stride, ascending); 1084 return m_LSL_Functions.llListSort(src, stride, ascending);
1085 } 1085 }
1086 1086
1087 public int llGetListLength(LSL_Types.list src) 1087 public int llGetListLength(LSL_Types.list src)
1088 { 1088 {
1089 return m_LSL_Functions.llGetListLength(src); 1089 return m_LSL_Functions.llGetListLength(src);
1090 } 1090 }
1091 1091
1092 // 1092 //
1093 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1093 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1094 // 1094 //
1095 public int llList2Integer(LSL_Types.list src, int index) 1095 public int llList2Integer(LSL_Types.list src, int index)
1096 { 1096 {
1097 return m_LSL_Functions.llList2Integer(src, index); 1097 return m_LSL_Functions.llList2Integer(src, index);
1098 } 1098 }
1099 1099
1100 public double osList2Double(LSL_Types.list src, int index) 1100 public double osList2Double(LSL_Types.list src, int index)
1101 { 1101 {
1102 return m_LSL_Functions.osList2Double(src, index); 1102 return m_LSL_Functions.osList2Double(src, index);
1103 } 1103 }
1104 1104
1105 public string llList2String(LSL_Types.list src, int index) 1105 public string llList2String(LSL_Types.list src, int index)
1106 { 1106 {
1107 return m_LSL_Functions.llList2String(src, index); 1107 return m_LSL_Functions.llList2String(src, index);
1108 } 1108 }
1109 1109
1110 public string llList2Key(LSL_Types.list src, int index) 1110 public string llList2Key(LSL_Types.list src, int index)
1111 { 1111 {
1112 return m_LSL_Functions.llList2Key(src, index); 1112 return m_LSL_Functions.llList2Key(src, index);
1113 } 1113 }
1114 1114
1115 public vector llList2Vector(LSL_Types.list src, int index) 1115 public vector llList2Vector(LSL_Types.list src, int index)
1116 { 1116 {
1117 return m_LSL_Functions.llList2Vector(src, index); 1117 return m_LSL_Functions.llList2Vector(src, index);
1118 } 1118 }
1119 1119
1120 public rotation llList2Rot(LSL_Types.list src, int index) 1120 public rotation llList2Rot(LSL_Types.list src, int index)
1121 { 1121 {
1122 return m_LSL_Functions.llList2Rot(src, index); 1122 return m_LSL_Functions.llList2Rot(src, index);
1123 } 1123 }
1124 1124
1125 public LSL_Types.list llList2List(LSL_Types.list src, int start, int end) 1125 public LSL_Types.list llList2List(LSL_Types.list src, int start, int end)
1126 { 1126 {
1127 return m_LSL_Functions.llList2List(src, start, end); 1127 return m_LSL_Functions.llList2List(src, start, end);
1128 } 1128 }
1129 1129
1130 public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end) 1130 public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end)
1131 { 1131 {
1132 return m_LSL_Functions.llDeleteSubList(src, start, end); 1132 return m_LSL_Functions.llDeleteSubList(src, start, end);
1133 } 1133 }
1134 1134
1135 public int llGetListEntryType(LSL_Types.list src, int index) 1135 public int llGetListEntryType(LSL_Types.list src, int index)
1136 { 1136 {
1137 return m_LSL_Functions.llGetListEntryType(src, index); 1137 return m_LSL_Functions.llGetListEntryType(src, index);
1138 } 1138 }
1139 1139
1140 public string llList2CSV(LSL_Types.list src) 1140 public string llList2CSV(LSL_Types.list src)
1141 { 1141 {
1142 return m_LSL_Functions.llList2CSV(src); 1142 return m_LSL_Functions.llList2CSV(src);
1143 } 1143 }
1144 1144
1145 public LSL_Types.list llCSV2List(string src) 1145 public LSL_Types.list llCSV2List(string src)
1146 { 1146 {
1147 return m_LSL_Functions.llCSV2List(src); 1147 return m_LSL_Functions.llCSV2List(src);
1148 } 1148 }
1149 1149
1150 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) 1150 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride)
1151 { 1151 {
1152 return m_LSL_Functions.llListRandomize(src, stride); 1152 return m_LSL_Functions.llListRandomize(src, stride);
1153 } 1153 }
1154 1154
1155 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) 1155 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride)
1156 { 1156 {
1157 return m_LSL_Functions.llList2ListStrided(src, start, end, stride); 1157 return m_LSL_Functions.llList2ListStrided(src, start, end, stride);
1158 } 1158 }
1159 1159
1160 public vector llGetRegionCorner() 1160 public vector llGetRegionCorner()
1161 { 1161 {
1162 return m_LSL_Functions.llGetRegionCorner(); 1162 return m_LSL_Functions.llGetRegionCorner();
1163 } 1163 }
1164 1164
1165 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start) 1165 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start)
1166 { 1166 {
1167 return m_LSL_Functions.llListInsertList(dest, src, start); 1167 return m_LSL_Functions.llListInsertList(dest, src, start);
1168 } 1168 }
1169 1169
1170 public int llListFindList(LSL_Types.list src, LSL_Types.list test) 1170 public int llListFindList(LSL_Types.list src, LSL_Types.list test)
1171 { 1171 {
1172 return m_LSL_Functions.llListFindList(src, test); 1172 return m_LSL_Functions.llListFindList(src, test);
1173 } 1173 }
1174 1174
1175 public string llGetObjectName() 1175 public string llGetObjectName()
1176 { 1176 {
1177 return m_LSL_Functions.llGetObjectName(); 1177 return m_LSL_Functions.llGetObjectName();
1178 } 1178 }
1179 1179
1180 public void llSetObjectName(string name) 1180 public void llSetObjectName(string name)
1181 { 1181 {
1182 m_LSL_Functions.llSetObjectName(name); 1182 m_LSL_Functions.llSetObjectName(name);
1183 } 1183 }
1184 1184
1185 public string llGetDate() 1185 public string llGetDate()
1186 { 1186 {
1187 return m_LSL_Functions.llGetDate(); 1187 return m_LSL_Functions.llGetDate();
1188 } 1188 }
1189 1189
1190 public int llEdgeOfWorld(vector pos, vector dir) 1190 public int llEdgeOfWorld(vector pos, vector dir)
1191 { 1191 {
1192 return m_LSL_Functions.llEdgeOfWorld(pos, dir); 1192 return m_LSL_Functions.llEdgeOfWorld(pos, dir);
1193 } 1193 }
1194 1194
1195 public int llGetAgentInfo(string id) 1195 public int llGetAgentInfo(string id)
1196 { 1196 {
1197 return m_LSL_Functions.llGetAgentInfo(id); 1197 return m_LSL_Functions.llGetAgentInfo(id);
1198 } 1198 }
1199 1199
1200 // 1200 //
1201 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1201 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1202 // 1202 //
1203 public void llAdjustSoundVolume(double volume) 1203 public void llAdjustSoundVolume(double volume)
1204 { 1204 {
1205 m_LSL_Functions.llAdjustSoundVolume(volume); 1205 m_LSL_Functions.llAdjustSoundVolume(volume);
1206 } 1206 }
1207 1207
1208 public void llSetSoundQueueing(int queue) 1208 public void llSetSoundQueueing(int queue)
1209 { 1209 {
1210 m_LSL_Functions.llSetSoundQueueing(queue); 1210 m_LSL_Functions.llSetSoundQueueing(queue);
1211 } 1211 }
1212 1212
1213 public void llSetSoundRadius(double radius) 1213 public void llSetSoundRadius(double radius)
1214 { 1214 {
1215 m_LSL_Functions.llSetSoundRadius(radius); 1215 m_LSL_Functions.llSetSoundRadius(radius);
1216 } 1216 }
1217 1217
1218 public string llKey2Name(string id) 1218 public string llKey2Name(string id)
1219 { 1219 {
1220 return m_LSL_Functions.llKey2Name(id); 1220 return m_LSL_Functions.llKey2Name(id);
1221 } 1221 }
1222 1222
1223 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) 1223 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
1224 { 1224 {
1225 m_LSL_Functions.llSetTextureAnim(mode, face, sizex, sizey, start, length, rate); 1225 m_LSL_Functions.llSetTextureAnim(mode, face, sizex, sizey, start, length, rate);
1226 } 1226 }
1227 1227
1228 public void llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west) 1228 public void llTriggerSoundLimited(string sound, double volume, vector top_north_east, vector bottom_south_west)
1229 { 1229 {
1230 m_LSL_Functions.llTriggerSoundLimited(sound, volume, top_north_east, bottom_south_west); 1230 m_LSL_Functions.llTriggerSoundLimited(sound, volume, top_north_east, bottom_south_west);
1231 } 1231 }
1232 1232
1233 public void llEjectFromLand(string pest) 1233 public void llEjectFromLand(string pest)
1234 { 1234 {
1235 m_LSL_Functions.llEjectFromLand(pest); 1235 m_LSL_Functions.llEjectFromLand(pest);
1236 } 1236 }
1237 1237
1238 public void llParseString2List() 1238 public void llParseString2List()
1239 { 1239 {
1240 m_LSL_Functions.llParseString2List(); 1240 m_LSL_Functions.llParseString2List();
1241 } 1241 }
1242 1242
1243 public int llOverMyLand(string id) 1243 public int llOverMyLand(string id)
1244 { 1244 {
1245 return m_LSL_Functions.llOverMyLand(id); 1245 return m_LSL_Functions.llOverMyLand(id);
1246 } 1246 }
1247 1247
1248 public string llGetLandOwnerAt(vector pos) 1248 public string llGetLandOwnerAt(vector pos)
1249 { 1249 {
1250 return m_LSL_Functions.llGetLandOwnerAt(pos); 1250 return m_LSL_Functions.llGetLandOwnerAt(pos);
1251 } 1251 }
1252 1252
1253 public string llGetNotecardLine(string name, int line) 1253 public string llGetNotecardLine(string name, int line)
1254 { 1254 {
1255 return m_LSL_Functions.llGetNotecardLine(name, line); 1255 return m_LSL_Functions.llGetNotecardLine(name, line);
1256 } 1256 }
1257 1257
1258 public vector llGetAgentSize(string id) 1258 public vector llGetAgentSize(string id)
1259 { 1259 {
1260 return m_LSL_Functions.llGetAgentSize(id); 1260 return m_LSL_Functions.llGetAgentSize(id);
1261 } 1261 }
1262 1262
1263 public int llSameGroup(string agent) 1263 public int llSameGroup(string agent)
1264 { 1264 {
1265 return m_LSL_Functions.llSameGroup(agent); 1265 return m_LSL_Functions.llSameGroup(agent);
1266 } 1266 }
1267 1267
1268 public void llUnSit(string id) 1268 public void llUnSit(string id)
1269 { 1269 {
1270 m_LSL_Functions.llUnSit(id); 1270 m_LSL_Functions.llUnSit(id);
1271 } 1271 }
1272 1272
1273 public vector llGroundSlope(vector offset) 1273 public vector llGroundSlope(vector offset)
1274 { 1274 {
1275 return m_LSL_Functions.llGroundSlope(offset); 1275 return m_LSL_Functions.llGroundSlope(offset);
1276 } 1276 }
1277 1277
1278 public vector llGroundNormal(vector offset) 1278 public vector llGroundNormal(vector offset)
1279 { 1279 {
1280 return m_LSL_Functions.llGroundNormal(offset); 1280 return m_LSL_Functions.llGroundNormal(offset);
1281 } 1281 }
1282 1282
1283 public vector llGroundContour(vector offset) 1283 public vector llGroundContour(vector offset)
1284 { 1284 {
1285 return m_LSL_Functions.llGroundContour(offset); 1285 return m_LSL_Functions.llGroundContour(offset);
1286 } 1286 }
1287 1287
1288 public int llGetAttached() 1288 public int llGetAttached()
1289 { 1289 {
1290 return m_LSL_Functions.llGetAttached(); 1290 return m_LSL_Functions.llGetAttached();
1291 } 1291 }
1292 1292
1293 public int llGetFreeMemory() 1293 public int llGetFreeMemory()
1294 { 1294 {
1295 return m_LSL_Functions.llGetFreeMemory(); 1295 return m_LSL_Functions.llGetFreeMemory();
1296 } 1296 }
1297 1297
1298 public string llGetRegionName() 1298 public string llGetRegionName()
1299 { 1299 {
1300 return m_LSL_Functions.llGetRegionName(); 1300 return m_LSL_Functions.llGetRegionName();
1301 } 1301 }
1302 1302
1303 public double llGetRegionTimeDilation() 1303 public double llGetRegionTimeDilation()
1304 { 1304 {
1305 return m_LSL_Functions.llGetRegionTimeDilation(); 1305 return m_LSL_Functions.llGetRegionTimeDilation();
1306 } 1306 }
1307 1307
1308 public double llGetRegionFPS() 1308 public double llGetRegionFPS()
1309 { 1309 {
1310 return m_LSL_Functions.llGetRegionFPS(); 1310 return m_LSL_Functions.llGetRegionFPS();
1311 } 1311 }
1312 1312
1313 // 1313 //
1314 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1314 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1315 // 1315 //
1316 public void llParticleSystem(List<Object> rules) 1316 public void llParticleSystem(List<Object> rules)
1317 { 1317 {
1318 m_LSL_Functions.llParticleSystem(rules); 1318 m_LSL_Functions.llParticleSystem(rules);
1319 } 1319 }
1320 1320
1321 public void llGroundRepel(double height, int water, double tau) 1321 public void llGroundRepel(double height, int water, double tau)
1322 { 1322 {
1323 m_LSL_Functions.llGroundRepel(height, water, tau); 1323 m_LSL_Functions.llGroundRepel(height, water, tau);
1324 } 1324 }
1325 1325
1326 public void llGiveInventoryList() 1326 public void llGiveInventoryList()
1327 { 1327 {
1328 m_LSL_Functions.llGiveInventoryList(); 1328 m_LSL_Functions.llGiveInventoryList();
1329 } 1329 }
1330 1330
1331 public void llSetVehicleType(int type) 1331 public void llSetVehicleType(int type)
1332 { 1332 {
1333 m_LSL_Functions.llSetVehicleType(type); 1333 m_LSL_Functions.llSetVehicleType(type);
1334 } 1334 }
1335 1335
1336 public void llSetVehicledoubleParam(int param, double value) 1336 public void llSetVehicledoubleParam(int param, double value)
1337 { 1337 {
1338 m_LSL_Functions.llSetVehicledoubleParam(param, value); 1338 m_LSL_Functions.llSetVehicledoubleParam(param, value);
1339 } 1339 }
1340 1340
1341 public void llSetVehicleVectorParam(int param, vector vec) 1341 public void llSetVehicleVectorParam(int param, vector vec)
1342 { 1342 {
1343 m_LSL_Functions.llSetVehicleVectorParam(param, vec); 1343 m_LSL_Functions.llSetVehicleVectorParam(param, vec);
1344 } 1344 }
1345 1345
1346 public void llSetVehicleRotationParam(int param, rotation rot) 1346 public void llSetVehicleRotationParam(int param, rotation rot)
1347 { 1347 {
1348 m_LSL_Functions.llSetVehicleRotationParam(param, rot); 1348 m_LSL_Functions.llSetVehicleRotationParam(param, rot);
1349 } 1349 }
1350 1350
1351 public void llSetVehicleFlags(int flags) 1351 public void llSetVehicleFlags(int flags)
1352 { 1352 {
1353 m_LSL_Functions.llSetVehicleFlags(flags); 1353 m_LSL_Functions.llSetVehicleFlags(flags);
1354 } 1354 }
1355 1355
1356 public void llRemoveVehicleFlags(int flags) 1356 public void llRemoveVehicleFlags(int flags)
1357 { 1357 {
1358 m_LSL_Functions.llRemoveVehicleFlags(flags); 1358 m_LSL_Functions.llRemoveVehicleFlags(flags);
1359 } 1359 }
1360 1360
1361 public void llSitTarget(vector offset, rotation rot) 1361 public void llSitTarget(vector offset, rotation rot)
1362 { 1362 {
1363 m_LSL_Functions.llSitTarget(offset, rot); 1363 m_LSL_Functions.llSitTarget(offset, rot);
1364 } 1364 }
1365 1365
1366 public string llAvatarOnSitTarget() 1366 public string llAvatarOnSitTarget()
1367 { 1367 {
1368 return m_LSL_Functions.llAvatarOnSitTarget(); 1368 return m_LSL_Functions.llAvatarOnSitTarget();
1369 } 1369 }
1370 1370
1371 public void llAddToLandPassList(string avatar, double hours) 1371 public void llAddToLandPassList(string avatar, double hours)
1372 { 1372 {
1373 m_LSL_Functions.llAddToLandPassList(avatar, hours); 1373 m_LSL_Functions.llAddToLandPassList(avatar, hours);
1374 } 1374 }
1375 1375
1376 public void llSetTouchText(string text) 1376 public void llSetTouchText(string text)
1377 { 1377 {
1378 m_LSL_Functions.llSetTouchText(text); 1378 m_LSL_Functions.llSetTouchText(text);
1379 } 1379 }
1380 1380
1381 public void llSetSitText(string text) 1381 public void llSetSitText(string text)
1382 { 1382 {
1383 m_LSL_Functions.llSetSitText(text); 1383 m_LSL_Functions.llSetSitText(text);
1384 } 1384 }
1385 1385
1386 public void llSetCameraEyeOffset(vector offset) 1386 public void llSetCameraEyeOffset(vector offset)
1387 { 1387 {
1388 m_LSL_Functions.llSetCameraEyeOffset(offset); 1388 m_LSL_Functions.llSetCameraEyeOffset(offset);
1389 } 1389 }
1390 1390
1391 public void llSetCameraAtOffset(vector offset) 1391 public void llSetCameraAtOffset(vector offset)
1392 { 1392 {
1393 m_LSL_Functions.llSetCameraAtOffset(offset); 1393 m_LSL_Functions.llSetCameraAtOffset(offset);
1394 } 1394 }
1395 1395
1396 public string llDumpList2String(LSL_Types.list src, string seperator) 1396 public string llDumpList2String(LSL_Types.list src, string seperator)
1397 { 1397 {
1398 return m_LSL_Functions.llDumpList2String(src, seperator); 1398 return m_LSL_Functions.llDumpList2String(src, seperator);
1399 } 1399 }
1400 1400
1401 public void llScriptDanger(vector pos) 1401 public void llScriptDanger(vector pos)
1402 { 1402 {
1403 m_LSL_Functions.llScriptDanger(pos); 1403 m_LSL_Functions.llScriptDanger(pos);
1404 } 1404 }
1405 1405
1406 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) 1406 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel)
1407 { 1407 {
1408 m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel); 1408 m_LSL_Functions.llDialog(avatar, message, buttons, chat_channel);
1409 } 1409 }
1410 1410
1411 public void llVolumeDetect(int detect) 1411 public void llVolumeDetect(int detect)
1412 { 1412 {
1413 m_LSL_Functions.llVolumeDetect(detect); 1413 m_LSL_Functions.llVolumeDetect(detect);
1414 } 1414 }
1415 1415
1416 public void llResetOtherScript(string name) 1416 public void llResetOtherScript(string name)
1417 { 1417 {
1418 m_LSL_Functions.llResetOtherScript(name); 1418 m_LSL_Functions.llResetOtherScript(name);
1419 } 1419 }
1420 1420
1421 public int llGetScriptState(string name) 1421 public int llGetScriptState(string name)
1422 { 1422 {
1423 return m_LSL_Functions.llGetScriptState(name); 1423 return m_LSL_Functions.llGetScriptState(name);
1424 } 1424 }
1425 1425
1426 public void llRemoteLoadScript() 1426 public void llRemoteLoadScript()
1427 { 1427 {
1428 m_LSL_Functions.llRemoteLoadScript(); 1428 m_LSL_Functions.llRemoteLoadScript();
1429 } 1429 }
1430 1430
1431 public void llSetRemoteScriptAccessPin(int pin) 1431 public void llSetRemoteScriptAccessPin(int pin)
1432 { 1432 {
1433 m_LSL_Functions.llSetRemoteScriptAccessPin(pin); 1433 m_LSL_Functions.llSetRemoteScriptAccessPin(pin);
1434 } 1434 }
1435 1435
1436 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) 1436 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param)
1437 { 1437 {
1438 m_LSL_Functions.llRemoteLoadScriptPin(target, name, pin, running, start_param); 1438 m_LSL_Functions.llRemoteLoadScriptPin(target, name, pin, running, start_param);
1439 } 1439 }
1440 1440
1441 // 1441 //
1442 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1442 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1443 // 1443 //
1444 public void llOpenRemoteDataChannel() 1444 public void llOpenRemoteDataChannel()
1445 { 1445 {
1446 m_LSL_Functions.llOpenRemoteDataChannel(); 1446 m_LSL_Functions.llOpenRemoteDataChannel();
1447 } 1447 }
1448 1448
1449 public string llSendRemoteData(string channel, string dest, int idata, string sdata) 1449 public string llSendRemoteData(string channel, string dest, int idata, string sdata)
1450 { 1450 {
1451 return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata); 1451 return m_LSL_Functions.llSendRemoteData(channel, dest, idata, sdata);
1452 } 1452 }
1453 1453
1454 public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) 1454 public void llRemoteDataReply(string channel, string message_id, string sdata, int idata)
1455 { 1455 {
1456 m_LSL_Functions.llRemoteDataReply(channel, message_id, sdata, idata); 1456 m_LSL_Functions.llRemoteDataReply(channel, message_id, sdata, idata);
1457 } 1457 }
1458 1458
1459 public void llCloseRemoteDataChannel(string channel) 1459 public void llCloseRemoteDataChannel(string channel)
1460 { 1460 {
1461 m_LSL_Functions.llCloseRemoteDataChannel(channel); 1461 m_LSL_Functions.llCloseRemoteDataChannel(channel);
1462 } 1462 }
1463 1463
1464 public string llMD5String(string src, int nonce) 1464 public string llMD5String(string src, int nonce)
1465 { 1465 {
1466 return m_LSL_Functions.llMD5String(src, nonce); 1466 return m_LSL_Functions.llMD5String(src, nonce);
1467 } 1467 }
1468 1468
1469 public void llSetPrimitiveParams(LSL_Types.list rules) 1469 public void llSetPrimitiveParams(LSL_Types.list rules)
1470 { 1470 {
1471 m_LSL_Functions.llSetPrimitiveParams(rules); 1471 m_LSL_Functions.llSetPrimitiveParams(rules);
1472 } 1472 }
1473 1473
1474 public string llStringToBase64(string str) 1474 public string llStringToBase64(string str)
1475 { 1475 {
1476 return m_LSL_Functions.llStringToBase64(str); 1476 return m_LSL_Functions.llStringToBase64(str);
1477 } 1477 }
1478 1478
1479 public string llBase64ToString(string str) 1479 public string llBase64ToString(string str)
1480 { 1480 {
1481 return m_LSL_Functions.llBase64ToString(str); 1481 return m_LSL_Functions.llBase64ToString(str);
1482 } 1482 }
1483 1483
1484 public void llXorBase64Strings() 1484 public void llXorBase64Strings()
1485 { 1485 {
1486 m_LSL_Functions.llXorBase64Strings(); 1486 m_LSL_Functions.llXorBase64Strings();
1487 } 1487 }
1488 1488
1489 public void llRemoteDataSetRegion() 1489 public void llRemoteDataSetRegion()
1490 { 1490 {
1491 m_LSL_Functions.llRemoteDataSetRegion(); 1491 m_LSL_Functions.llRemoteDataSetRegion();
1492 } 1492 }
1493 1493
1494 public double llLog10(double val) 1494 public double llLog10(double val)
1495 { 1495 {
1496 return m_LSL_Functions.llLog10(val); 1496 return m_LSL_Functions.llLog10(val);
1497 } 1497 }
1498 1498
1499 public double llLog(double val) 1499 public double llLog(double val)
1500 { 1500 {
1501 return m_LSL_Functions.llLog(val); 1501 return m_LSL_Functions.llLog(val);
1502 } 1502 }
1503 1503
1504 public LSL_Types.list llGetAnimationList(string id) 1504 public LSL_Types.list llGetAnimationList(string id)
1505 { 1505 {
1506 return m_LSL_Functions.llGetAnimationList(id); 1506 return m_LSL_Functions.llGetAnimationList(id);
1507 } 1507 }
1508 1508
1509 public void llSetParcelMusicURL(string url) 1509 public void llSetParcelMusicURL(string url)
1510 { 1510 {
1511 m_LSL_Functions.llSetParcelMusicURL(url); 1511 m_LSL_Functions.llSetParcelMusicURL(url);
1512 } 1512 }
1513 1513
1514 public vector llGetRootPosition() 1514 public vector llGetRootPosition()
1515 { 1515 {
1516 return m_LSL_Functions.llGetRootPosition(); 1516 return m_LSL_Functions.llGetRootPosition();
1517 } 1517 }
1518 1518
1519 public rotation llGetRootRotation() 1519 public rotation llGetRootRotation()
1520 { 1520 {
1521 return m_LSL_Functions.llGetRootRotation(); 1521 return m_LSL_Functions.llGetRootRotation();
1522 } 1522 }
1523 1523
1524 public string llGetObjectDesc() 1524 public string llGetObjectDesc()
1525 { 1525 {
1526 return m_LSL_Functions.llGetObjectDesc(); 1526 return m_LSL_Functions.llGetObjectDesc();
1527 } 1527 }
1528 1528
1529 public void llSetObjectDesc(string desc) 1529 public void llSetObjectDesc(string desc)
1530 { 1530 {
1531 m_LSL_Functions.llSetObjectDesc(desc); 1531 m_LSL_Functions.llSetObjectDesc(desc);
1532 } 1532 }
1533 1533
1534 public string llGetCreator() 1534 public string llGetCreator()
1535 { 1535 {
1536 return m_LSL_Functions.llGetCreator(); 1536 return m_LSL_Functions.llGetCreator();
1537 } 1537 }
1538 1538
1539 public string llGetTimestamp() 1539 public string llGetTimestamp()
1540 { 1540 {
1541 return m_LSL_Functions.llGetTimestamp(); 1541 return m_LSL_Functions.llGetTimestamp();
1542 } 1542 }
1543 1543
1544 public void llSetLinkAlpha(int linknumber, double alpha, int face) 1544 public void llSetLinkAlpha(int linknumber, double alpha, int face)
1545 { 1545 {
1546 m_LSL_Functions.llSetLinkAlpha(linknumber, alpha, face); 1546 m_LSL_Functions.llSetLinkAlpha(linknumber, alpha, face);
1547 } 1547 }
1548 1548
1549 public int llGetNumberOfPrims() 1549 public int llGetNumberOfPrims()
1550 { 1550 {
1551 return m_LSL_Functions.llGetNumberOfPrims(); 1551 return m_LSL_Functions.llGetNumberOfPrims();
1552 } 1552 }
1553 1553
1554 public string llGetNumberOfNotecardLines(string name) 1554 public string llGetNumberOfNotecardLines(string name)
1555 { 1555 {
1556 return m_LSL_Functions.llGetNumberOfNotecardLines(name); 1556 return m_LSL_Functions.llGetNumberOfNotecardLines(name);
1557 } 1557 }
1558 1558
1559 public LSL_Types.list llGetBoundingBox(string obj) 1559 public LSL_Types.list llGetBoundingBox(string obj)
1560 { 1560 {
1561 return m_LSL_Functions.llGetBoundingBox(obj); 1561 return m_LSL_Functions.llGetBoundingBox(obj);
1562 } 1562 }
1563 1563
1564 public vector llGetGeometricCenter() 1564 public vector llGetGeometricCenter()
1565 { 1565 {
1566 return m_LSL_Functions.llGetGeometricCenter(); 1566 return m_LSL_Functions.llGetGeometricCenter();
1567 } 1567 }
1568 1568
1569 public void llGetPrimitiveParams() 1569 public void llGetPrimitiveParams()
1570 { 1570 {
1571 m_LSL_Functions.llGetPrimitiveParams(); 1571 m_LSL_Functions.llGetPrimitiveParams();
1572 } 1572 }
1573 1573
1574 // 1574 //
1575 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1575 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1576 // 1576 //
1577 public string llIntegerToBase64(int number) 1577 public string llIntegerToBase64(int number)
1578 { 1578 {
1579 return m_LSL_Functions.llIntegerToBase64(number); 1579 return m_LSL_Functions.llIntegerToBase64(number);
1580 } 1580 }
1581 1581
1582 public int llBase64ToInteger(string str) 1582 public int llBase64ToInteger(string str)
1583 { 1583 {
1584 return m_LSL_Functions.llBase64ToInteger(str); 1584 return m_LSL_Functions.llBase64ToInteger(str);
1585 } 1585 }
1586 1586
1587 public double llGetGMTclock() 1587 public double llGetGMTclock()
1588 { 1588 {
1589 return m_LSL_Functions.llGetGMTclock(); 1589 return m_LSL_Functions.llGetGMTclock();
1590 } 1590 }
1591 1591
1592 public string llGetSimulatorHostname() 1592 public string llGetSimulatorHostname()
1593 { 1593 {
1594 return m_LSL_Functions.llGetSimulatorHostname(); 1594 return m_LSL_Functions.llGetSimulatorHostname();
1595 } 1595 }
1596 1596
1597 public void llSetLocalRot(rotation rot) 1597 public void llSetLocalRot(rotation rot)
1598 { 1598 {
1599 m_LSL_Functions.llSetLocalRot(rot); 1599 m_LSL_Functions.llSetLocalRot(rot);
1600 } 1600 }
1601 1601
1602 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers) 1602 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers)
1603 { 1603 {
1604 return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers); 1604 return m_LSL_Functions.llParseStringKeepNulls(src, seperators, spacers);
1605 } 1605 }
1606 1606
1607 public void llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, int param) 1607 public void llRezAtRoot(string inventory, vector position, vector velocity, rotation rot, int param)
1608 { 1608 {
1609 m_LSL_Functions.llRezAtRoot(inventory, position, velocity, rot, param); 1609 m_LSL_Functions.llRezAtRoot(inventory, position, velocity, rot, param);
1610 } 1610 }
1611 1611
1612 public int llGetObjectPermMask(int mask) 1612 public int llGetObjectPermMask(int mask)
1613 { 1613 {
1614 return m_LSL_Functions.llGetObjectPermMask(mask); 1614 return m_LSL_Functions.llGetObjectPermMask(mask);
1615 } 1615 }
1616 1616
1617 public void llSetObjectPermMask(int mask, int value) 1617 public void llSetObjectPermMask(int mask, int value)
1618 { 1618 {
1619 m_LSL_Functions.llSetObjectPermMask(mask, value); 1619 m_LSL_Functions.llSetObjectPermMask(mask, value);
1620 } 1620 }
1621 1621
1622 public void llGetInventoryPermMask(string item, int mask) 1622 public void llGetInventoryPermMask(string item, int mask)
1623 { 1623 {
1624 m_LSL_Functions.llGetInventoryPermMask(item, mask); 1624 m_LSL_Functions.llGetInventoryPermMask(item, mask);
1625 } 1625 }
1626 1626
1627 public void llSetInventoryPermMask(string item, int mask, int value) 1627 public void llSetInventoryPermMask(string item, int mask, int value)
1628 { 1628 {
1629 m_LSL_Functions.llSetInventoryPermMask(item, mask, value); 1629 m_LSL_Functions.llSetInventoryPermMask(item, mask, value);
1630 } 1630 }
1631 1631
1632 public string llGetInventoryCreator(string item) 1632 public string llGetInventoryCreator(string item)
1633 { 1633 {
1634 return m_LSL_Functions.llGetInventoryCreator(item); 1634 return m_LSL_Functions.llGetInventoryCreator(item);
1635 } 1635 }
1636 1636
1637 public void llOwnerSay(string msg) 1637 public void llOwnerSay(string msg)
1638 { 1638 {
1639 m_LSL_Functions.llOwnerSay(msg); 1639 m_LSL_Functions.llOwnerSay(msg);
1640 } 1640 }
1641 1641
1642 public void llRequestSimulatorData(string simulator, int data) 1642 public void llRequestSimulatorData(string simulator, int data)
1643 { 1643 {
1644 m_LSL_Functions.llRequestSimulatorData(simulator, data); 1644 m_LSL_Functions.llRequestSimulatorData(simulator, data);
1645 } 1645 }
1646 1646
1647 public void llForceMouselook(int mouselook) 1647 public void llForceMouselook(int mouselook)
1648 { 1648 {
1649 m_LSL_Functions.llForceMouselook(mouselook); 1649 m_LSL_Functions.llForceMouselook(mouselook);
1650 } 1650 }
1651 1651
1652 public double llGetObjectMass(string id) 1652 public double llGetObjectMass(string id)
1653 { 1653 {
1654 return m_LSL_Functions.llGetObjectMass(id); 1654 return m_LSL_Functions.llGetObjectMass(id);
1655 } 1655 }
1656 1656
1657 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) 1657 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
1658 { 1658 {
1659 return m_LSL_Functions.llListReplaceList(dest, src, start, end); 1659 return m_LSL_Functions.llListReplaceList(dest, src, start, end);
1660 } 1660 }
1661 1661
1662 public void llLoadURL(string avatar_id, string message, string url) 1662 public void llLoadURL(string avatar_id, string message, string url)
1663 { 1663 {
1664 m_LSL_Functions.llLoadURL(avatar_id, message, url); 1664 m_LSL_Functions.llLoadURL(avatar_id, message, url);
1665 } 1665 }
1666 1666
1667 public void llParcelMediaCommandList(LSL_Types.list commandList) 1667 public void llParcelMediaCommandList(LSL_Types.list commandList)
1668 { 1668 {
1669 m_LSL_Functions.llParcelMediaCommandList(commandList); 1669 m_LSL_Functions.llParcelMediaCommandList(commandList);
1670 } 1670 }
1671 1671
1672 public void llParcelMediaQuery() 1672 public void llParcelMediaQuery()
1673 { 1673 {
1674 m_LSL_Functions.llParcelMediaQuery(); 1674 m_LSL_Functions.llParcelMediaQuery();
1675 } 1675 }
1676 1676
1677 public int llModPow(int a, int b, int c) 1677 public int llModPow(int a, int b, int c)
1678 { 1678 {
1679 return m_LSL_Functions.llModPow(a, b, c); 1679 return m_LSL_Functions.llModPow(a, b, c);
1680 } 1680 }
1681 1681
1682 // 1682 //
1683 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1683 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1684 // 1684 //
1685 public int llGetInventoryType(string name) 1685 public int llGetInventoryType(string name)
1686 { 1686 {
1687 return m_LSL_Functions.llGetInventoryType(name); 1687 return m_LSL_Functions.llGetInventoryType(name);
1688 } 1688 }
1689 1689
1690 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons) 1690 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons)
1691 { 1691 {
1692 m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons); 1692 m_LSL_Functions.llSetPayPrice(price, quick_pay_buttons);
1693 } 1693 }
1694 1694
1695 public vector llGetCameraPos() 1695 public vector llGetCameraPos()
1696 { 1696 {
1697 return m_LSL_Functions.llGetCameraPos(); 1697 return m_LSL_Functions.llGetCameraPos();
1698 } 1698 }
1699 1699
1700 public rotation llGetCameraRot() 1700 public rotation llGetCameraRot()
1701 { 1701 {
1702 return m_LSL_Functions.llGetCameraRot(); 1702 return m_LSL_Functions.llGetCameraRot();
1703 } 1703 }
1704 1704
1705 public void llSetPrimURL() 1705 public void llSetPrimURL()
1706 { 1706 {
1707 m_LSL_Functions.llSetPrimURL(); 1707 m_LSL_Functions.llSetPrimURL();
1708 } 1708 }
1709 1709
1710 public void llRefreshPrimURL() 1710 public void llRefreshPrimURL()
1711 { 1711 {
1712 m_LSL_Functions.llRefreshPrimURL(); 1712 m_LSL_Functions.llRefreshPrimURL();
1713 } 1713 }
1714 1714
1715 public string llEscapeURL(string url) 1715 public string llEscapeURL(string url)
1716 { 1716 {
1717 return m_LSL_Functions.llEscapeURL(url); 1717 return m_LSL_Functions.llEscapeURL(url);
1718 } 1718 }
1719 1719
1720 public string llUnescapeURL(string url) 1720 public string llUnescapeURL(string url)
1721 { 1721 {
1722 return m_LSL_Functions.llUnescapeURL(url); 1722 return m_LSL_Functions.llUnescapeURL(url);
1723 } 1723 }
1724 1724
1725 public void llMapDestination(string simname, vector pos, vector look_at) 1725 public void llMapDestination(string simname, vector pos, vector look_at)
1726 { 1726 {
1727 m_LSL_Functions.llMapDestination(simname, pos, look_at); 1727 m_LSL_Functions.llMapDestination(simname, pos, look_at);
1728 } 1728 }
1729 1729
1730 public void llAddToLandBanList(string avatar, double hours) 1730 public void llAddToLandBanList(string avatar, double hours)
1731 { 1731 {
1732 m_LSL_Functions.llAddToLandBanList(avatar, hours); 1732 m_LSL_Functions.llAddToLandBanList(avatar, hours);
1733 } 1733 }
1734 1734
1735 public void llRemoveFromLandPassList(string avatar) 1735 public void llRemoveFromLandPassList(string avatar)
1736 { 1736 {
1737 m_LSL_Functions.llRemoveFromLandPassList(avatar); 1737 m_LSL_Functions.llRemoveFromLandPassList(avatar);
1738 } 1738 }
1739 1739
1740 public void llRemoveFromLandBanList(string avatar) 1740 public void llRemoveFromLandBanList(string avatar)
1741 { 1741 {
1742 m_LSL_Functions.llRemoveFromLandBanList(avatar); 1742 m_LSL_Functions.llRemoveFromLandBanList(avatar);
1743 } 1743 }
1744 1744
1745 public void llSetCameraParams(LSL_Types.list rules) 1745 public void llSetCameraParams(LSL_Types.list rules)
1746 { 1746 {
1747 m_LSL_Functions.llSetCameraParams(rules); 1747 m_LSL_Functions.llSetCameraParams(rules);
1748 } 1748 }
1749 1749
1750 public void llClearCameraParams() 1750 public void llClearCameraParams()
1751 { 1751 {
1752 m_LSL_Functions.llClearCameraParams(); 1752 m_LSL_Functions.llClearCameraParams();
1753 } 1753 }
1754 1754
1755 public double llListStatistics(int operation, LSL_Types.list src) 1755 public double llListStatistics(int operation, LSL_Types.list src)
1756 { 1756 {
1757 return m_LSL_Functions.llListStatistics(operation, src); 1757 return m_LSL_Functions.llListStatistics(operation, src);
1758 } 1758 }
1759 1759
1760 public int llGetUnixTime() 1760 public int llGetUnixTime()
1761 { 1761 {
1762 return m_LSL_Functions.llGetUnixTime(); 1762 return m_LSL_Functions.llGetUnixTime();
1763 } 1763 }
1764 1764
1765 public int llGetParcelFlags(vector pos) 1765 public int llGetParcelFlags(vector pos)
1766 { 1766 {
1767 return m_LSL_Functions.llGetParcelFlags(pos); 1767 return m_LSL_Functions.llGetParcelFlags(pos);
1768 } 1768 }
1769 1769
1770 public int llGetRegionFlags() 1770 public int llGetRegionFlags()
1771 { 1771 {
1772 return m_LSL_Functions.llGetRegionFlags(); 1772 return m_LSL_Functions.llGetRegionFlags();
1773 } 1773 }
1774 1774
1775 public string llXorBase64StringsCorrect(string str1, string str2) 1775 public string llXorBase64StringsCorrect(string str1, string str2)
1776 { 1776 {
1777 return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2); 1777 return m_LSL_Functions.llXorBase64StringsCorrect(str1, str2);
1778 } 1778 }
1779 1779
1780 public string llHTTPRequest(string url, LSL_Types.list parameters, string body) 1780 public string llHTTPRequest(string url, LSL_Types.list parameters, string body)
1781 { 1781 {
1782 return m_LSL_Functions.llHTTPRequest(url, parameters, body); 1782 return m_LSL_Functions.llHTTPRequest(url, parameters, body);
1783 } 1783 }
1784 1784
1785 public void llResetLandBanList() 1785 public void llResetLandBanList()
1786 { 1786 {
1787 m_LSL_Functions.llResetLandBanList(); 1787 m_LSL_Functions.llResetLandBanList();
1788 } 1788 }
1789 1789
1790 public void llResetLandPassList() 1790 public void llResetLandPassList()
1791 { 1791 {
1792 m_LSL_Functions.llResetLandPassList(); 1792 m_LSL_Functions.llResetLandPassList();
1793 } 1793 }
1794 1794
1795 public int llGetParcelPrimCount(vector pos, int category, int sim_wide) 1795 public int llGetParcelPrimCount(vector pos, int category, int sim_wide)
1796 { 1796 {
1797 return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide); 1797 return m_LSL_Functions.llGetParcelPrimCount(pos, category, sim_wide);
1798 } 1798 }
1799 1799
1800 public LSL_Types.list llGetParcelPrimOwners(vector pos) 1800 public LSL_Types.list llGetParcelPrimOwners(vector pos)
1801 { 1801 {
1802 return m_LSL_Functions.llGetParcelPrimOwners(pos); 1802 return m_LSL_Functions.llGetParcelPrimOwners(pos);
1803 } 1803 }
1804 1804
1805 public int llGetObjectPrimCount(string object_id) 1805 public int llGetObjectPrimCount(string object_id)
1806 { 1806 {
1807 return m_LSL_Functions.llGetObjectPrimCount(object_id); 1807 return m_LSL_Functions.llGetObjectPrimCount(object_id);
1808 } 1808 }
1809 1809
1810 // 1810 //
1811 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs 1811 // DO NOT MODIFY HERE: MODIFY IN LSL_BuiltIn_Commands.cs
1812 // 1812 //
1813 public int llGetParcelMaxPrims(vector pos, int sim_wide) 1813 public int llGetParcelMaxPrims(vector pos, int sim_wide)
1814 { 1814 {
1815 return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide); 1815 return m_LSL_Functions.llGetParcelMaxPrims(pos, sim_wide);
1816 } 1816 }
1817 1817
1818 public LSL_Types.list llGetParcelDetails(vector pos, LSL_Types.list param) 1818 public LSL_Types.list llGetParcelDetails(vector pos, LSL_Types.list param)
1819 { 1819 {
1820 return m_LSL_Functions.llGetParcelDetails(pos, param); 1820 return m_LSL_Functions.llGetParcelDetails(pos, param);
1821 } 1821 }
1822 1822
1823 // 1823 //
1824 // OpenSim Functions 1824 // OpenSim Functions
1825 // 1825 //
1826 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, 1826 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
1827 int timer) 1827 int timer)
1828 { 1828 {
1829 return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer); 1829 return m_LSL_Functions.osSetDynamicTextureURL(dynamicID, contentType, url, extraParams, timer);
1830 } 1830 }
1831 1831
1832 public double osTerrainGetHeight(int x, int y) 1832 public double osTerrainGetHeight(int x, int y)
1833 { 1833 {
1834 return m_LSL_Functions.osTerrainGetHeight(x, y); 1834 return m_LSL_Functions.osTerrainGetHeight(x, y);
1835 } 1835 }
1836 1836
1837 public int osTerrainSetHeight(int x, int y, double val) 1837 public int osTerrainSetHeight(int x, int y, double val)
1838 { 1838 {
1839 return m_LSL_Functions.osTerrainSetHeight(x, y, val); 1839 return m_LSL_Functions.osTerrainSetHeight(x, y, val);
1840 } 1840 }
1841 1841
1842 public int osRegionRestart(double seconds) 1842 public int osRegionRestart(double seconds)
1843 { 1843 {
1844 return m_LSL_Functions.osRegionRestart(seconds); 1844 return m_LSL_Functions.osRegionRestart(seconds);
1845 } 1845 }
1846 1846
1847 // LSL CONSTANTS 1847 // LSL CONSTANTS
1848 public const int TRUE = 1; 1848 public const int TRUE = 1;
1849 public const int FALSE = 0; 1849 public const int FALSE = 0;
1850 public const int STATUS_PHYSICS = 1; 1850 public const int STATUS_PHYSICS = 1;
1851 public const int STATUS_ROTATE_X = 2; 1851 public const int STATUS_ROTATE_X = 2;
1852 public const int STATUS_ROTATE_Y = 4; 1852 public const int STATUS_ROTATE_Y = 4;
1853 public const int STATUS_ROTATE_Z = 8; 1853 public const int STATUS_ROTATE_Z = 8;
1854 public const int STATUS_PHANTOM = 16; 1854 public const int STATUS_PHANTOM = 16;
1855 public const int STATUS_SANDBOX = 32; 1855 public const int STATUS_SANDBOX = 32;
1856 public const int STATUS_BLOCK_GRAB = 64; 1856 public const int STATUS_BLOCK_GRAB = 64;
1857 public const int STATUS_DIE_AT_EDGE = 128; 1857 public const int STATUS_DIE_AT_EDGE = 128;
1858 public const int STATUS_RETURN_AT_EDGE = 256; 1858 public const int STATUS_RETURN_AT_EDGE = 256;
1859 public const int AGENT = 1; 1859 public const int AGENT = 1;
1860 public const int ACTIVE = 2; 1860 public const int ACTIVE = 2;
1861 public const int PASSIVE = 4; 1861 public const int PASSIVE = 4;
1862 public const int SCRIPTED = 8; 1862 public const int SCRIPTED = 8;
1863 public const int CONTROL_FWD = 1; 1863 public const int CONTROL_FWD = 1;
1864 public const int CONTROL_BACK = 2; 1864 public const int CONTROL_BACK = 2;
1865 public const int CONTROL_LEFT = 4; 1865 public const int CONTROL_LEFT = 4;
1866 public const int CONTROL_RIGHT = 8; 1866 public const int CONTROL_RIGHT = 8;
1867 public const int CONTROL_UP = 16; 1867 public const int CONTROL_UP = 16;
1868 public const int CONTROL_DOWN = 32; 1868 public const int CONTROL_DOWN = 32;
1869 public const int CONTROL_ROT_LEFT = 256; 1869 public const int CONTROL_ROT_LEFT = 256;
1870 public const int CONTROL_ROT_RIGHT = 512; 1870 public const int CONTROL_ROT_RIGHT = 512;
1871 public const int CONTROL_LBUTTON = 268435456; 1871 public const int CONTROL_LBUTTON = 268435456;
1872 public const int CONTROL_ML_LBUTTON = 1073741824; 1872 public const int CONTROL_ML_LBUTTON = 1073741824;
1873 public const int PERMISSION_DEBIT = 2; 1873 public const int PERMISSION_DEBIT = 2;
1874 public const int PERMISSION_TAKE_CONTROLS = 4; 1874 public const int PERMISSION_TAKE_CONTROLS = 4;
1875 public const int PERMISSION_REMAP_CONTROLS = 8; 1875 public const int PERMISSION_REMAP_CONTROLS = 8;
1876 public const int PERMISSION_TRIGGER_ANIMATION = 16; 1876 public const int PERMISSION_TRIGGER_ANIMATION = 16;
1877 public const int PERMISSION_ATTACH = 32; 1877 public const int PERMISSION_ATTACH = 32;
1878 public const int PERMISSION_RELEASE_OWNERSHIP = 64; 1878 public const int PERMISSION_RELEASE_OWNERSHIP = 64;
1879 public const int PERMISSION_CHANGE_LINKS = 128; 1879 public const int PERMISSION_CHANGE_LINKS = 128;
1880 public const int PERMISSION_CHANGE_JOINTS = 256; 1880 public const int PERMISSION_CHANGE_JOINTS = 256;
1881 public const int PERMISSION_CHANGE_PERMISSIONS = 512; 1881 public const int PERMISSION_CHANGE_PERMISSIONS = 512;
1882 public const int PERMISSION_TRACK_CAMERA = 1024; 1882 public const int PERMISSION_TRACK_CAMERA = 1024;
1883 public const int AGENT_FLYING = 1; 1883 public const int AGENT_FLYING = 1;
1884 public const int AGENT_ATTACHMENTS = 2; 1884 public const int AGENT_ATTACHMENTS = 2;
1885 public const int AGENT_SCRIPTED = 4; 1885 public const int AGENT_SCRIPTED = 4;
1886 public const int AGENT_MOUSELOOK = 8; 1886 public const int AGENT_MOUSELOOK = 8;
1887 public const int AGENT_SITTING = 16; 1887 public const int AGENT_SITTING = 16;
1888 public const int AGENT_ON_OBJECT = 32; 1888 public const int AGENT_ON_OBJECT = 32;
1889 public const int AGENT_AWAY = 64; 1889 public const int AGENT_AWAY = 64;
1890 public const int AGENT_WALKING = 128; 1890 public const int AGENT_WALKING = 128;
1891 public const int AGENT_IN_AIR = 256; 1891 public const int AGENT_IN_AIR = 256;
1892 public const int AGENT_TYPING = 512; 1892 public const int AGENT_TYPING = 512;
1893 public const int AGENT_CROUCHING = 1024; 1893 public const int AGENT_CROUCHING = 1024;
1894 public const int AGENT_BUSY = 2048; 1894 public const int AGENT_BUSY = 2048;
1895 public const int AGENT_ALWAYS_RUN = 4096; 1895 public const int AGENT_ALWAYS_RUN = 4096;
1896 public const int PSYS_PART_INTERP_COLOR_MASK = 1; 1896 public const int PSYS_PART_INTERP_COLOR_MASK = 1;
1897 public const int PSYS_PART_INTERP_SCALE_MASK = 2; 1897 public const int PSYS_PART_INTERP_SCALE_MASK = 2;
1898 public const int PSYS_PART_BOUNCE_MASK = 4; 1898 public const int PSYS_PART_BOUNCE_MASK = 4;
1899 public const int PSYS_PART_WIND_MASK = 8; 1899 public const int PSYS_PART_WIND_MASK = 8;
1900 public const int PSYS_PART_FOLLOW_SRC_MASK = 16; 1900 public const int PSYS_PART_FOLLOW_SRC_MASK = 16;
1901 public const int PSYS_PART_FOLLOW_VELOCITY_MASK = 32; 1901 public const int PSYS_PART_FOLLOW_VELOCITY_MASK = 32;
1902 public const int PSYS_PART_TARGET_POS_MASK = 64; 1902 public const int PSYS_PART_TARGET_POS_MASK = 64;
1903 public const int PSYS_PART_TARGET_LINEAR_MASK = 128; 1903 public const int PSYS_PART_TARGET_LINEAR_MASK = 128;
1904 public const int PSYS_PART_EMISSIVE_MASK = 256; 1904 public const int PSYS_PART_EMISSIVE_MASK = 256;
1905 public const int PSYS_PART_FLAGS = 0; 1905 public const int PSYS_PART_FLAGS = 0;
1906 public const int PSYS_PART_START_COLOR = 1; 1906 public const int PSYS_PART_START_COLOR = 1;
1907 public const int PSYS_PART_START_ALPHA = 2; 1907 public const int PSYS_PART_START_ALPHA = 2;
1908 public const int PSYS_PART_END_COLOR = 3; 1908 public const int PSYS_PART_END_COLOR = 3;
1909 public const int PSYS_PART_END_ALPHA = 4; 1909 public const int PSYS_PART_END_ALPHA = 4;
1910 public const int PSYS_PART_START_SCALE = 5; 1910 public const int PSYS_PART_START_SCALE = 5;
1911 public const int PSYS_PART_END_SCALE = 6; 1911 public const int PSYS_PART_END_SCALE = 6;
1912 public const int PSYS_PART_MAX_AGE = 7; 1912 public const int PSYS_PART_MAX_AGE = 7;
1913 public const int PSYS_SRC_ACCEL = 8; 1913 public const int PSYS_SRC_ACCEL = 8;
1914 public const int PSYS_SRC_PATTERN = 9; 1914 public const int PSYS_SRC_PATTERN = 9;
1915 public const int PSYS_SRC_INNERANGLE = 10; 1915 public const int PSYS_SRC_INNERANGLE = 10;
1916 public const int PSYS_SRC_OUTERANGLE = 11; 1916 public const int PSYS_SRC_OUTERANGLE = 11;
1917 public const int PSYS_SRC_TEXTURE = 12; 1917 public const int PSYS_SRC_TEXTURE = 12;
1918 public const int PSYS_SRC_BURST_RATE = 13; 1918 public const int PSYS_SRC_BURST_RATE = 13;
1919 public const int PSYS_SRC_BURST_PART_COUNT = 15; 1919 public const int PSYS_SRC_BURST_PART_COUNT = 15;
1920 public const int PSYS_SRC_BURST_RADIUS = 16; 1920 public const int PSYS_SRC_BURST_RADIUS = 16;
1921 public const int PSYS_SRC_BURST_SPEED_MIN = 17; 1921 public const int PSYS_SRC_BURST_SPEED_MIN = 17;
1922 public const int PSYS_SRC_BURST_SPEED_MAX = 18; 1922 public const int PSYS_SRC_BURST_SPEED_MAX = 18;
1923 public const int PSYS_SRC_MAX_AGE = 19; 1923 public const int PSYS_SRC_MAX_AGE = 19;
1924 public const int PSYS_SRC_TARGET_KEY = 20; 1924 public const int PSYS_SRC_TARGET_KEY = 20;
1925 public const int PSYS_SRC_OMEGA = 21; 1925 public const int PSYS_SRC_OMEGA = 21;
1926 public const int PSYS_SRC_ANGLE_BEGIN = 22; 1926 public const int PSYS_SRC_ANGLE_BEGIN = 22;
1927 public const int PSYS_SRC_ANGLE_END = 23; 1927 public const int PSYS_SRC_ANGLE_END = 23;
1928 public const int PSYS_SRC_PATTERN_DROP = 1; 1928 public const int PSYS_SRC_PATTERN_DROP = 1;
1929 public const int PSYS_SRC_PATTERN_EXPLODE = 2; 1929 public const int PSYS_SRC_PATTERN_EXPLODE = 2;
1930 public const int PSYS_SRC_PATTERN_ANGLE = 4; 1930 public const int PSYS_SRC_PATTERN_ANGLE = 4;
1931 public const int PSYS_SRC_PATTERN_ANGLE_CONE = 8; 1931 public const int PSYS_SRC_PATTERN_ANGLE_CONE = 8;
1932 public const int PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY = 16; 1932 public const int PSYS_SRC_PATTERN_ANGLE_CONE_EMPTY = 16;
1933 public const int VEHICLE_TYPE_NONE = 0; 1933 public const int VEHICLE_TYPE_NONE = 0;
1934 public const int VEHICLE_TYPE_SLED = 1; 1934 public const int VEHICLE_TYPE_SLED = 1;
1935 public const int VEHICLE_TYPE_CAR = 2; 1935 public const int VEHICLE_TYPE_CAR = 2;
1936 public const int VEHICLE_TYPE_BOAT = 3; 1936 public const int VEHICLE_TYPE_BOAT = 3;
1937 public const int VEHICLE_TYPE_AIRPLANE = 4; 1937 public const int VEHICLE_TYPE_AIRPLANE = 4;
1938 public const int VEHICLE_TYPE_BALLOON = 5; 1938 public const int VEHICLE_TYPE_BALLOON = 5;
1939 public const int VEHICLE_LINEAR_FRICTION_TIMESCALE = 16; 1939 public const int VEHICLE_LINEAR_FRICTION_TIMESCALE = 16;
1940 public const int VEHICLE_ANGULAR_FRICTION_TIMESCALE = 17; 1940 public const int VEHICLE_ANGULAR_FRICTION_TIMESCALE = 17;
1941 public const int VEHICLE_LINEAR_MOTOR_DIRECTION = 18; 1941 public const int VEHICLE_LINEAR_MOTOR_DIRECTION = 18;
1942 public const int VEHICLE_LINEAR_MOTOR_OFFSET = 20; 1942 public const int VEHICLE_LINEAR_MOTOR_OFFSET = 20;
1943 public const int VEHICLE_ANGULAR_MOTOR_DIRECTION = 19; 1943 public const int VEHICLE_ANGULAR_MOTOR_DIRECTION = 19;
1944 public const int VEHICLE_HOVER_HEIGHT = 24; 1944 public const int VEHICLE_HOVER_HEIGHT = 24;
1945 public const int VEHICLE_HOVER_EFFICIENCY = 25; 1945 public const int VEHICLE_HOVER_EFFICIENCY = 25;
1946 public const int VEHICLE_HOVER_TIMESCALE = 26; 1946 public const int VEHICLE_HOVER_TIMESCALE = 26;
1947 public const int VEHICLE_BUOYANCY = 27; 1947 public const int VEHICLE_BUOYANCY = 27;
1948 public const int VEHICLE_LINEAR_DEFLECTION_EFFICIENCY = 28; 1948 public const int VEHICLE_LINEAR_DEFLECTION_EFFICIENCY = 28;
1949 public const int VEHICLE_LINEAR_DEFLECTION_TIMESCALE = 29; 1949 public const int VEHICLE_LINEAR_DEFLECTION_TIMESCALE = 29;
1950 public const int VEHICLE_LINEAR_MOTOR_TIMESCALE = 30; 1950 public const int VEHICLE_LINEAR_MOTOR_TIMESCALE = 30;
1951 public const int VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE = 31; 1951 public const int VEHICLE_LINEAR_MOTOR_DECAY_TIMESCALE = 31;
1952 public const int VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY = 32; 1952 public const int VEHICLE_ANGULAR_DEFLECTION_EFFICIENCY = 32;
1953 public const int VEHICLE_ANGULAR_DEFLECTION_TIMESCALE = 33; 1953 public const int VEHICLE_ANGULAR_DEFLECTION_TIMESCALE = 33;
1954 public const int VEHICLE_ANGULAR_MOTOR_TIMESCALE = 34; 1954 public const int VEHICLE_ANGULAR_MOTOR_TIMESCALE = 34;
1955 public const int VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE = 35; 1955 public const int VEHICLE_ANGULAR_MOTOR_DECAY_TIMESCALE = 35;
1956 public const int VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY = 36; 1956 public const int VEHICLE_VERTICAL_ATTRACTION_EFFICIENCY = 36;
1957 public const int VEHICLE_VERTICAL_ATTRACTION_TIMESCALE = 37; 1957 public const int VEHICLE_VERTICAL_ATTRACTION_TIMESCALE = 37;
1958 public const int VEHICLE_BANKING_EFFICIENCY = 38; 1958 public const int VEHICLE_BANKING_EFFICIENCY = 38;
1959 public const int VEHICLE_BANKING_MIX = 39; 1959 public const int VEHICLE_BANKING_MIX = 39;
1960 public const int VEHICLE_BANKING_TIMESCALE = 40; 1960 public const int VEHICLE_BANKING_TIMESCALE = 40;
1961 public const int VEHICLE_REFERENCE_FRAME = 44; 1961 public const int VEHICLE_REFERENCE_FRAME = 44;
1962 public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1; 1962 public const int VEHICLE_FLAG_NO_DEFLECTION_UP = 1;
1963 public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2; 1963 public const int VEHICLE_FLAG_LIMIT_ROLL_ONLY = 2;
1964 public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4; 1964 public const int VEHICLE_FLAG_HOVER_WATER_ONLY = 4;
1965 public const int VEHICLE_FLAG_HOVER_TERRAIN_ONLY = 8; 1965 public const int VEHICLE_FLAG_HOVER_TERRAIN_ONLY = 8;
1966 public const int VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT = 16; 1966 public const int VEHICLE_FLAG_HOVER_GLOBAL_HEIGHT = 16;
1967 public const int VEHICLE_FLAG_HOVER_UP_ONLY = 32; 1967 public const int VEHICLE_FLAG_HOVER_UP_ONLY = 32;
1968 public const int VEHICLE_FLAG_LIMIT_MOTOR_UP = 64; 1968 public const int VEHICLE_FLAG_LIMIT_MOTOR_UP = 64;
1969 public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128; 1969 public const int VEHICLE_FLAG_MOUSELOOK_STEER = 128;
1970 public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256; 1970 public const int VEHICLE_FLAG_MOUSELOOK_BANK = 256;
1971 public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512; 1971 public const int VEHICLE_FLAG_CAMERA_DECOUPLED = 512;
1972 public const int INVENTORY_ALL = -1; 1972 public const int INVENTORY_ALL = -1;
1973 public const int INVENTORY_NONE = -1; 1973 public const int INVENTORY_NONE = -1;
1974 public const int INVENTORY_TEXTURE = 0; 1974 public const int INVENTORY_TEXTURE = 0;
1975 public const int INVENTORY_SOUND = 1; 1975 public const int INVENTORY_SOUND = 1;
1976 public const int INVENTORY_LANDMARK = 3; 1976 public const int INVENTORY_LANDMARK = 3;
1977 public const int INVENTORY_CLOTHING = 5; 1977 public const int INVENTORY_CLOTHING = 5;
1978 public const int INVENTORY_OBJECT = 6; 1978 public const int INVENTORY_OBJECT = 6;
1979 public const int INVENTORY_NOTECARD = 7; 1979 public const int INVENTORY_NOTECARD = 7;
1980 public const int INVENTORY_SCRIPT = 10; 1980 public const int INVENTORY_SCRIPT = 10;
1981 public const int INVENTORY_BODYPART = 13; 1981 public const int INVENTORY_BODYPART = 13;
1982 public const int INVENTORY_ANIMATION = 20; 1982 public const int INVENTORY_ANIMATION = 20;
1983 public const int INVENTORY_GESTURE = 21; 1983 public const int INVENTORY_GESTURE = 21;
1984 public const int ATTACH_CHEST = 1; 1984 public const int ATTACH_CHEST = 1;
1985 public const int ATTACH_HEAD = 2; 1985 public const int ATTACH_HEAD = 2;
1986 public const int ATTACH_LSHOULDER = 3; 1986 public const int ATTACH_LSHOULDER = 3;
1987 public const int ATTACH_RSHOULDER = 4; 1987 public const int ATTACH_RSHOULDER = 4;
1988 public const int ATTACH_LHAND = 5; 1988 public const int ATTACH_LHAND = 5;
1989 public const int ATTACH_RHAND = 6; 1989 public const int ATTACH_RHAND = 6;
1990 public const int ATTACH_LFOOT = 7; 1990 public const int ATTACH_LFOOT = 7;
1991 public const int ATTACH_RFOOT = 8; 1991 public const int ATTACH_RFOOT = 8;
1992 public const int ATTACH_BACK = 9; 1992 public const int ATTACH_BACK = 9;
1993 public const int ATTACH_PELVIS = 10; 1993 public const int ATTACH_PELVIS = 10;
1994 public const int ATTACH_MOUTH = 11; 1994 public const int ATTACH_MOUTH = 11;
1995 public const int ATTACH_CHIN = 12; 1995 public const int ATTACH_CHIN = 12;
1996 public const int ATTACH_LEAR = 13; 1996 public const int ATTACH_LEAR = 13;
1997 public const int ATTACH_REAR = 14; 1997 public const int ATTACH_REAR = 14;
1998 public const int ATTACH_LEYE = 15; 1998 public const int ATTACH_LEYE = 15;
1999 public const int ATTACH_REYE = 16; 1999 public const int ATTACH_REYE = 16;
2000 public const int ATTACH_NOSE = 17; 2000 public const int ATTACH_NOSE = 17;
2001 public const int ATTACH_RUARM = 18; 2001 public const int ATTACH_RUARM = 18;
2002 public const int ATTACH_RLARM = 19; 2002 public const int ATTACH_RLARM = 19;
2003 public const int ATTACH_LUARM = 20; 2003 public const int ATTACH_LUARM = 20;
2004 public const int ATTACH_LLARM = 21; 2004 public const int ATTACH_LLARM = 21;
2005 public const int ATTACH_RHIP = 22; 2005 public const int ATTACH_RHIP = 22;
2006 public const int ATTACH_RULEG = 23; 2006 public const int ATTACH_RULEG = 23;
2007 public const int ATTACH_RLLEG = 24; 2007 public const int ATTACH_RLLEG = 24;
2008 public const int ATTACH_LHIP = 25; 2008 public const int ATTACH_LHIP = 25;
2009 public const int ATTACH_LULEG = 26; 2009 public const int ATTACH_LULEG = 26;
2010 public const int ATTACH_LLLEG = 27; 2010 public const int ATTACH_LLLEG = 27;
2011 public const int ATTACH_BELLY = 28; 2011 public const int ATTACH_BELLY = 28;
2012 public const int ATTACH_RPEC = 29; 2012 public const int ATTACH_RPEC = 29;
2013 public const int ATTACH_LPEC = 30; 2013 public const int ATTACH_LPEC = 30;
2014 public const int LAND_LEVEL = 0; 2014 public const int LAND_LEVEL = 0;
2015 public const int LAND_RAISE = 1; 2015 public const int LAND_RAISE = 1;
2016 public const int LAND_LOWER = 2; 2016 public const int LAND_LOWER = 2;
2017 public const int LAND_SMOOTH = 3; 2017 public const int LAND_SMOOTH = 3;
2018 public const int LAND_NOISE = 4; 2018 public const int LAND_NOISE = 4;
2019 public const int LAND_REVERT = 5; 2019 public const int LAND_REVERT = 5;
2020 public const int LAND_SMALL_BRUSH = 1; 2020 public const int LAND_SMALL_BRUSH = 1;
2021 public const int LAND_MEDIUM_BRUSH = 2; 2021 public const int LAND_MEDIUM_BRUSH = 2;
2022 public const int LAND_LARGE_BRUSH = 3; 2022 public const int LAND_LARGE_BRUSH = 3;
2023 public const int DATA_ONLINE = 1; 2023 public const int DATA_ONLINE = 1;
2024 public const int DATA_NAME = 2; 2024 public const int DATA_NAME = 2;
2025 public const int DATA_BORN = 3; 2025 public const int DATA_BORN = 3;
2026 public const int DATA_RATING = 4; 2026 public const int DATA_RATING = 4;
2027 public const int DATA_SIM_POS = 5; 2027 public const int DATA_SIM_POS = 5;
2028 public const int DATA_SIM_STATUS = 6; 2028 public const int DATA_SIM_STATUS = 6;
2029 public const int DATA_SIM_RATING = 7; 2029 public const int DATA_SIM_RATING = 7;
2030 public const int ANIM_ON = 1; 2030 public const int ANIM_ON = 1;
2031 public const int LOOP = 2; 2031 public const int LOOP = 2;
2032 public const int REVERSE = 4; 2032 public const int REVERSE = 4;
2033 public const int PING_PONG = 8; 2033 public const int PING_PONG = 8;
2034 public const int SMOOTH = 16; 2034 public const int SMOOTH = 16;
2035 public const int ROTATE = 32; 2035 public const int ROTATE = 32;
2036 public const int SCALE = 64; 2036 public const int SCALE = 64;
2037 public const int ALL_SIDES = -1; 2037 public const int ALL_SIDES = -1;
2038 public const int LINK_SET = -1; 2038 public const int LINK_SET = -1;
2039 public const int LINK_ROOT = 1; 2039 public const int LINK_ROOT = 1;
2040 public const int LINK_ALL_OTHERS = -2; 2040 public const int LINK_ALL_OTHERS = -2;
2041 public const int LINK_ALL_CHILDREN = -3; 2041 public const int LINK_ALL_CHILDREN = -3;
2042 public const int LINK_THIS = -4; 2042 public const int LINK_THIS = -4;
2043 public const int CHANGED_INVENTORY = 1; 2043 public const int CHANGED_INVENTORY = 1;
2044 public const int CHANGED_COLOR = 2; 2044 public const int CHANGED_COLOR = 2;
2045 public const int CHANGED_SHAPE = 4; 2045 public const int CHANGED_SHAPE = 4;
2046 public const int CHANGED_SCALE = 8; 2046 public const int CHANGED_SCALE = 8;
2047 public const int CHANGED_TEXTURE = 16; 2047 public const int CHANGED_TEXTURE = 16;
2048 public const int CHANGED_LINK = 32; 2048 public const int CHANGED_LINK = 32;
2049 public const int CHANGED_ALLOWED_DROP = 64; 2049 public const int CHANGED_ALLOWED_DROP = 64;
2050 public const int CHANGED_OWNER = 128; 2050 public const int CHANGED_OWNER = 128;
2051 public const int TYPE_INVALID = 0; 2051 public const int TYPE_INVALID = 0;
2052 public const int TYPE_INTEGER = 1; 2052 public const int TYPE_INTEGER = 1;
2053 public const int TYPE_double = 2; 2053 public const int TYPE_double = 2;
2054 public const int TYPE_STRING = 3; 2054 public const int TYPE_STRING = 3;
2055 public const int TYPE_KEY = 4; 2055 public const int TYPE_KEY = 4;
2056 public const int TYPE_VECTOR = 5; 2056 public const int TYPE_VECTOR = 5;
2057 public const int TYPE_ROTATION = 6; 2057 public const int TYPE_ROTATION = 6;
2058 public const int REMOTE_DATA_CHANNEL = 1; 2058 public const int REMOTE_DATA_CHANNEL = 1;
2059 public const int REMOTE_DATA_REQUEST = 2; 2059 public const int REMOTE_DATA_REQUEST = 2;
2060 public const int REMOTE_DATA_REPLY = 3; 2060 public const int REMOTE_DATA_REPLY = 3;
2061 2061
2062 public const int PRIM_MATERIAL = 2; 2062 public const int PRIM_MATERIAL = 2;
2063 public const int PRIM_PHYSICS = 3; 2063 public const int PRIM_PHYSICS = 3;
2064 public const int PRIM_TEMP_ON_REZ = 4; 2064 public const int PRIM_TEMP_ON_REZ = 4;
2065 public const int PRIM_PHANTOM = 5; 2065 public const int PRIM_PHANTOM = 5;
2066 public const int PRIM_POSITION = 6; 2066 public const int PRIM_POSITION = 6;
2067 public const int PRIM_SIZE = 7; 2067 public const int PRIM_SIZE = 7;
2068 public const int PRIM_ROTATION = 8; 2068 public const int PRIM_ROTATION = 8;
2069 public const int PRIM_TYPE = 9; 2069 public const int PRIM_TYPE = 9;
2070 public const int PRIM_TEXTURE = 17; 2070 public const int PRIM_TEXTURE = 17;
2071 public const int PRIM_COLOR = 18; 2071 public const int PRIM_COLOR = 18;
2072 public const int PRIM_BUMP_SHINY = 19; 2072 public const int PRIM_BUMP_SHINY = 19;
2073 public const int PRIM_FULLBRIGHT = 20; 2073 public const int PRIM_FULLBRIGHT = 20;
2074 public const int PRIM_FLEXIBLE = 21; 2074 public const int PRIM_FLEXIBLE = 21;
2075 public const int PRIM_TEXGEN = 22; 2075 public const int PRIM_TEXGEN = 22;
2076 public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake 2076 public const int PRIM_CAST_SHADOWS = 24; // Not implemented, here for completeness sake
2077 public const int PRIM_POINT_LIGHT = 23; // Huh? 2077 public const int PRIM_POINT_LIGHT = 23; // Huh?
2078 public const int PRIM_TEXGEN_DEFAULT = 0; 2078 public const int PRIM_TEXGEN_DEFAULT = 0;
2079 public const int PRIM_TEXGEN_PLANAR = 1; 2079 public const int PRIM_TEXGEN_PLANAR = 1;
2080 public const int PRIM_TYPE_BOX = 0; 2080 public const int PRIM_TYPE_BOX = 0;
2081 public const int PRIM_TYPE_CYLINDER = 1; 2081 public const int PRIM_TYPE_CYLINDER = 1;
2082 public const int PRIM_TYPE_PRISM = 2; 2082 public const int PRIM_TYPE_PRISM = 2;
2083 public const int PRIM_TYPE_SPHERE = 3; 2083 public const int PRIM_TYPE_SPHERE = 3;
2084 public const int PRIM_TYPE_TORUS = 4; 2084 public const int PRIM_TYPE_TORUS = 4;
2085 public const int PRIM_TYPE_TUBE = 5; 2085 public const int PRIM_TYPE_TUBE = 5;
2086 public const int PRIM_TYPE_RING = 6; 2086 public const int PRIM_TYPE_RING = 6;
2087 public const int PRIM_TYPE_SCULPT = 7; 2087 public const int PRIM_TYPE_SCULPT = 7;
2088 public const int PRIM_HOLE_DEFAULT = 0; 2088 public const int PRIM_HOLE_DEFAULT = 0;
2089 public const int PRIM_HOLE_CIRCLE = 16; 2089 public const int PRIM_HOLE_CIRCLE = 16;
2090 public const int PRIM_HOLE_SQUARE = 32; 2090 public const int PRIM_HOLE_SQUARE = 32;
2091 public const int PRIM_HOLE_TRIANGLE = 48; 2091 public const int PRIM_HOLE_TRIANGLE = 48;
2092 public const int PRIM_MATERIAL_STONE = 0; 2092 public const int PRIM_MATERIAL_STONE = 0;
2093 public const int PRIM_MATERIAL_METAL = 1; 2093 public const int PRIM_MATERIAL_METAL = 1;
2094 public const int PRIM_MATERIAL_GLASS = 2; 2094 public const int PRIM_MATERIAL_GLASS = 2;
2095 public const int PRIM_MATERIAL_WOOD = 3; 2095 public const int PRIM_MATERIAL_WOOD = 3;
2096 public const int PRIM_MATERIAL_FLESH = 4; 2096 public const int PRIM_MATERIAL_FLESH = 4;
2097 public const int PRIM_MATERIAL_PLASTIC = 5; 2097 public const int PRIM_MATERIAL_PLASTIC = 5;
2098 public const int PRIM_MATERIAL_RUBBER = 6; 2098 public const int PRIM_MATERIAL_RUBBER = 6;
2099 public const int PRIM_MATERIAL_LIGHT = 7; 2099 public const int PRIM_MATERIAL_LIGHT = 7;
2100 public const int PRIM_SHINY_NONE = 0; 2100 public const int PRIM_SHINY_NONE = 0;
2101 public const int PRIM_SHINY_LOW = 1; 2101 public const int PRIM_SHINY_LOW = 1;
2102 public const int PRIM_SHINY_MEDIUM = 2; 2102 public const int PRIM_SHINY_MEDIUM = 2;
2103 public const int PRIM_SHINY_HIGH = 3; 2103 public const int PRIM_SHINY_HIGH = 3;
2104 public const int PRIM_BUMP_NONE = 0; 2104 public const int PRIM_BUMP_NONE = 0;
2105 public const int PRIM_BUMP_BRIGHT = 1; 2105 public const int PRIM_BUMP_BRIGHT = 1;
2106 public const int PRIM_BUMP_DARK = 2; 2106 public const int PRIM_BUMP_DARK = 2;
2107 public const int PRIM_BUMP_WOOD = 3; 2107 public const int PRIM_BUMP_WOOD = 3;
2108 public const int PRIM_BUMP_BARK = 4; 2108 public const int PRIM_BUMP_BARK = 4;
2109 public const int PRIM_BUMP_BRICKS = 5; 2109 public const int PRIM_BUMP_BRICKS = 5;
2110 public const int PRIM_BUMP_CHECKER = 6; 2110 public const int PRIM_BUMP_CHECKER = 6;
2111 public const int PRIM_BUMP_CONCRETE = 7; 2111 public const int PRIM_BUMP_CONCRETE = 7;
2112 public const int PRIM_BUMP_TILE = 8; 2112 public const int PRIM_BUMP_TILE = 8;
2113 public const int PRIM_BUMP_STONE = 9; 2113 public const int PRIM_BUMP_STONE = 9;
2114 public const int PRIM_BUMP_DISKS = 10; 2114 public const int PRIM_BUMP_DISKS = 10;
2115 public const int PRIM_BUMP_GRAVEL = 11; 2115 public const int PRIM_BUMP_GRAVEL = 11;
2116 public const int PRIM_BUMP_BLOBS = 12; 2116 public const int PRIM_BUMP_BLOBS = 12;
2117 public const int PRIM_BUMP_SIDING = 13; 2117 public const int PRIM_BUMP_SIDING = 13;
2118 public const int PRIM_BUMP_LARGETILE = 14; 2118 public const int PRIM_BUMP_LARGETILE = 14;
2119 public const int PRIM_BUMP_STUCCO = 15; 2119 public const int PRIM_BUMP_STUCCO = 15;
2120 public const int PRIM_BUMP_SUCTION = 16; 2120 public const int PRIM_BUMP_SUCTION = 16;
2121 public const int PRIM_BUMP_WEAVE = 17; 2121 public const int PRIM_BUMP_WEAVE = 17;
2122 2122
2123 public const int PRIM_SCULPT_TYPE_SPHERE = 1; 2123 public const int PRIM_SCULPT_TYPE_SPHERE = 1;
2124 public const int PRIM_SCULPT_TYPE_TORUS = 2; 2124 public const int PRIM_SCULPT_TYPE_TORUS = 2;
2125 public const int PRIM_SCULPT_TYPE_PLANE = 3; 2125 public const int PRIM_SCULPT_TYPE_PLANE = 3;
2126 public const int PRIM_SCULPT_TYPE_CYLINDER = 4; 2126 public const int PRIM_SCULPT_TYPE_CYLINDER = 4;
2127 2127
2128 2128
2129 public const int MASK_BASE = 0; 2129 public const int MASK_BASE = 0;
2130 public const int MASK_OWNER = 1; 2130 public const int MASK_OWNER = 1;
2131 public const int MASK_GROUP = 2; 2131 public const int MASK_GROUP = 2;
2132 public const int MASK_EVERYONE = 3; 2132 public const int MASK_EVERYONE = 3;
2133 public const int MASK_NEXT = 4; 2133 public const int MASK_NEXT = 4;
2134 public const int PERM_TRANSFER = 8192; 2134 public const int PERM_TRANSFER = 8192;
2135 public const int PERM_MODIFY = 16384; 2135 public const int PERM_MODIFY = 16384;
2136 public const int PERM_COPY = 32768; 2136 public const int PERM_COPY = 32768;
2137 public const int PERM_MOVE = 524288; 2137 public const int PERM_MOVE = 524288;
2138 public const int PERM_ALL = 2147483647; 2138 public const int PERM_ALL = 2147483647;
2139 public const int PARCEL_MEDIA_COMMAND_STOP = 0; 2139 public const int PARCEL_MEDIA_COMMAND_STOP = 0;
2140 public const int PARCEL_MEDIA_COMMAND_PAUSE = 1; 2140 public const int PARCEL_MEDIA_COMMAND_PAUSE = 1;
2141 public const int PARCEL_MEDIA_COMMAND_PLAY = 2; 2141 public const int PARCEL_MEDIA_COMMAND_PLAY = 2;
2142 public const int PARCEL_MEDIA_COMMAND_LOOP = 3; 2142 public const int PARCEL_MEDIA_COMMAND_LOOP = 3;
2143 public const int PARCEL_MEDIA_COMMAND_TEXTURE = 4; 2143 public const int PARCEL_MEDIA_COMMAND_TEXTURE = 4;
2144 public const int PARCEL_MEDIA_COMMAND_URL = 5; 2144 public const int PARCEL_MEDIA_COMMAND_URL = 5;
2145 public const int PARCEL_MEDIA_COMMAND_TIME = 6; 2145 public const int PARCEL_MEDIA_COMMAND_TIME = 6;
2146 public const int PARCEL_MEDIA_COMMAND_AGENT = 7; 2146 public const int PARCEL_MEDIA_COMMAND_AGENT = 7;
2147 public const int PARCEL_MEDIA_COMMAND_UNLOAD = 8; 2147 public const int PARCEL_MEDIA_COMMAND_UNLOAD = 8;
2148 public const int PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9; 2148 public const int PARCEL_MEDIA_COMMAND_AUTO_ALIGN = 9;
2149 public const int PAY_HIDE = -1; 2149 public const int PAY_HIDE = -1;
2150 public const int PAY_DEFAULT = -2; 2150 public const int PAY_DEFAULT = -2;
2151 public const string NULL_KEY = "00000000-0000-0000-0000-000000000000"; 2151 public const string NULL_KEY = "00000000-0000-0000-0000-000000000000";
2152 public const string EOF = "\n\n\n"; 2152 public const string EOF = "\n\n\n";
2153 public const double PI = 3.14159274f; 2153 public const double PI = 3.14159274f;
2154 public const double TWO_PI = 6.28318548f; 2154 public const double TWO_PI = 6.28318548f;
2155 public const double PI_BY_TWO = 1.57079637f; 2155 public const double PI_BY_TWO = 1.57079637f;
2156 public const double DEG_TO_RAD = 0.01745329238f; 2156 public const double DEG_TO_RAD = 0.01745329238f;
2157 public const double RAD_TO_DEG = 57.29578f; 2157 public const double RAD_TO_DEG = 57.29578f;
2158 public const double SQRT2 = 1.414213538f; 2158 public const double SQRT2 = 1.414213538f;
2159 2159
2160 // Can not be public const? 2160 // Can not be public const?
2161 public vector ZERO_VECTOR = new vector(0, 0, 0); 2161 public vector ZERO_VECTOR = new vector(0, 0, 0);
2162 public rotation ZERO_ROTATION = new rotation(0, 0, 0, 0); 2162 public rotation ZERO_ROTATION = new rotation(0, 0, 0, 0);
2163 2163
2164 } 2164 }
2165} \ No newline at end of file 2165} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
index f4a1a00..f5354c5 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_BuiltIn_Commands.cs
@@ -1,3003 +1,3003 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Runtime.Remoting.Lifetime; 31using System.Runtime.Remoting.Lifetime;
32using System.Text; 32using System.Text;
33using System.Threading; 33using System.Threading;
34using Axiom.Math; 34using Axiom.Math;
35using libsecondlife; 35using libsecondlife;
36using OpenSim.Framework; 36using OpenSim.Framework;
37using OpenSim.Region.Environment.Interfaces; 37using OpenSim.Region.Environment.Interfaces;
38using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
39using OpenSim.Region.ScriptEngine.Common; 39using OpenSim.Region.ScriptEngine.Common;
40//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL; 40//using OpenSim.Region.ScriptEngine.DotNetEngine.Compiler.LSL;
41 41
42namespace OpenSim.Region.ScriptEngine.Common 42namespace OpenSim.Region.ScriptEngine.Common
43{ 43{
44 /// <summary> 44 /// <summary>
45 /// Contains all LSL ll-functions. This class will be in Default AppDomain. 45 /// Contains all LSL ll-functions. This class will be in Default AppDomain.
46 /// </summary> 46 /// </summary>
47 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface 47 public class LSL_BuiltIn_Commands : MarshalByRefObject, LSL_BuiltIn_Commands_Interface
48 { 48 {
49 private ASCIIEncoding enc = new ASCIIEncoding(); 49 private ASCIIEncoding enc = new ASCIIEncoding();
50 private ScriptEngineBase.ScriptEngine m_ScriptEngine; 50 private ScriptEngineBase.ScriptEngine m_ScriptEngine;
51 private SceneObjectPart m_host; 51 private SceneObjectPart m_host;
52 private uint m_localID; 52 private uint m_localID;
53 private LLUUID m_itemID; 53 private LLUUID m_itemID;
54 private bool throwErrorOnNotImplemented = true; 54 private bool throwErrorOnNotImplemented = true;
55 55
56 public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID) 56 public LSL_BuiltIn_Commands(ScriptEngineBase.ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, LLUUID itemID)
57 { 57 {
58 m_ScriptEngine = ScriptEngine; 58 m_ScriptEngine = ScriptEngine;
59 m_host = host; 59 m_host = host;
60 m_localID = localID; 60 m_localID = localID;
61 m_itemID = itemID; 61 m_itemID = itemID;
62 62
63 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]"); 63 //MainLog.Instance.Notice("ScriptEngine", "LSL_BaseClass.Start() called. Hosted by [" + m_host.Name + ":" + m_host.UUID + "@" + m_host.AbsolutePosition + "]");
64 } 64 }
65 65
66 private DateTime m_timer = DateTime.Now; 66 private DateTime m_timer = DateTime.Now;
67 private string m_state = "default"; 67 private string m_state = "default";
68 68
69 public string State() 69 public string State()
70 { 70 {
71 return m_state; 71 return m_state;
72 } 72 }
73 73
74 // Object never expires 74 // Object never expires
75 public override Object InitializeLifetimeService() 75 public override Object InitializeLifetimeService()
76 { 76 {
77 //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()"); 77 //Console.WriteLine("LSL_BuiltIn_Commands: InitializeLifetimeService()");
78 // return null; 78 // return null;
79 ILease lease = (ILease)base.InitializeLifetimeService(); 79 ILease lease = (ILease)base.InitializeLifetimeService();
80 80
81 if (lease.CurrentState == LeaseState.Initial) 81 if (lease.CurrentState == LeaseState.Initial)
82 { 82 {
83 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1); 83 lease.InitialLeaseTime = TimeSpan.Zero; // TimeSpan.FromMinutes(1);
84 // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2); 84 // lease.SponsorshipTimeout = TimeSpan.FromMinutes(2);
85 // lease.RenewOnCallTime = TimeSpan.FromSeconds(2); 85 // lease.RenewOnCallTime = TimeSpan.FromSeconds(2);
86 } 86 }
87 return lease; 87 return lease;
88 } 88 }
89 89
90 public Scene World 90 public Scene World
91 { 91 {
92 get { return m_ScriptEngine.World; } 92 get { return m_ScriptEngine.World; }
93 } 93 }
94 94
95 //These are the implementations of the various ll-functions used by the LSL scripts. 95 //These are the implementations of the various ll-functions used by the LSL scripts.
96 //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07 96 //starting out, we use the System.Math library for trig functions. - ckrinke 8-14-07
97 public double llSin(double f) 97 public double llSin(double f)
98 { 98 {
99 99
100 return (double)Math.Sin(f); 100 return (double)Math.Sin(f);
101 } 101 }
102 102
103 public double llCos(double f) 103 public double llCos(double f)
104 { 104 {
105 return (double)Math.Cos(f); 105 return (double)Math.Cos(f);
106 } 106 }
107 107
108 public double llTan(double f) 108 public double llTan(double f)
109 { 109 {
110 return (double)Math.Tan(f); 110 return (double)Math.Tan(f);
111 } 111 }
112 112
113 public double llAtan2(double x, double y) 113 public double llAtan2(double x, double y)
114 { 114 {
115 return (double)Math.Atan2(y, x); 115 return (double)Math.Atan2(y, x);
116 } 116 }
117 117
118 public double llSqrt(double f) 118 public double llSqrt(double f)
119 { 119 {
120 return (double)Math.Sqrt(f); 120 return (double)Math.Sqrt(f);
121 } 121 }
122 122
123 public double llPow(double fbase, double fexponent) 123 public double llPow(double fbase, double fexponent)
124 { 124 {
125 return (double)Math.Pow(fbase, fexponent); 125 return (double)Math.Pow(fbase, fexponent);
126 } 126 }
127 127
128 public int llAbs(int i) 128 public int llAbs(int i)
129 { 129 {
130 return (int)Math.Abs(i); 130 return (int)Math.Abs(i);
131 } 131 }
132 132
133 public double llFabs(double f) 133 public double llFabs(double f)
134 { 134 {
135 return (double)Math.Abs(f); 135 return (double)Math.Abs(f);
136 } 136 }
137 137
138 public double llFrand(double mag) 138 public double llFrand(double mag)
139 { 139 {
140 lock (Util.RandomClass) 140 lock (Util.RandomClass)
141 { 141 {
142 return Util.RandomClass.NextDouble() * mag; 142 return Util.RandomClass.NextDouble() * mag;
143 } 143 }
144 } 144 }
145 145
146 public int llFloor(double f) 146 public int llFloor(double f)
147 { 147 {
148 return (int)Math.Floor(f); 148 return (int)Math.Floor(f);
149 } 149 }
150 150
151 public int llCeil(double f) 151 public int llCeil(double f)
152 { 152 {
153 return (int)Math.Ceiling(f); 153 return (int)Math.Ceiling(f);
154 } 154 }
155 155
156 public int llRound(double f) 156 public int llRound(double f)
157 { 157 {
158 return (int)Math.Round(f, 0); 158 return (int)Math.Round(f, 0);
159 } 159 }
160 160
161 //This next group are vector operations involving squaring and square root. ckrinke 161 //This next group are vector operations involving squaring and square root. ckrinke
162 public double llVecMag(LSL_Types.Vector3 v) 162 public double llVecMag(LSL_Types.Vector3 v)
163 { 163 {
164 return (v.x * v.x + v.y * v.y + v.z * v.z); 164 return (v.x * v.x + v.y * v.y + v.z * v.z);
165 } 165 }
166 166
167 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) 167 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v)
168 { 168 {
169 double mag = v.x * v.x + v.y * v.y + v.z * v.z; 169 double mag = v.x * v.x + v.y * v.y + v.z * v.z;
170 LSL_Types.Vector3 nor = new LSL_Types.Vector3(); 170 LSL_Types.Vector3 nor = new LSL_Types.Vector3();
171 nor.x = v.x / mag; 171 nor.x = v.x / mag;
172 nor.y = v.y / mag; 172 nor.y = v.y / mag;
173 nor.z = v.z / mag; 173 nor.z = v.z / mag;
174 return nor; 174 return nor;
175 } 175 }
176 176
177 public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b) 177 public double llVecDist(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
178 { 178 {
179 double dx = a.x - b.x; 179 double dx = a.x - b.x;
180 double dy = a.y - b.y; 180 double dy = a.y - b.y;
181 double dz = a.z - b.z; 181 double dz = a.z - b.z;
182 return Math.Sqrt(dx * dx + dy * dy + dz * dz); 182 return Math.Sqrt(dx * dx + dy * dy + dz * dz);
183 } 183 }
184 184
185 //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke 185 //Now we start getting into quaternions which means sin/cos, matrices and vectors. ckrinke
186 public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r) 186 public LSL_Types.Vector3 llRot2Euler(LSL_Types.Quaternion r)
187 { 187 {
188 //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke 188 //This implementation is from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions. ckrinke
189 LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s); 189 LSL_Types.Quaternion t = new LSL_Types.Quaternion(r.x * r.x, r.y * r.y, r.z * r.z, r.s * r.s);
190 double m = (t.x + t.y + t.z + t.s); 190 double m = (t.x + t.y + t.z + t.s);
191 if (m == 0) return new LSL_Types.Vector3(); 191 if (m == 0) return new LSL_Types.Vector3();
192 double n = 2 * (r.y * r.s + r.x * r.z); 192 double n = 2 * (r.y * r.s + r.x * r.z);
193 double p = m * m - n * n; 193 double p = m * m - n * n;
194 if (p > 0) 194 if (p > 0)
195 return new LSL_Types.Vector3(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)), 195 return new LSL_Types.Vector3(Math.Atan2(2.0 * (r.x * r.s - r.y * r.z), (-t.x - t.y + t.z + t.s)),
196 Math.Atan2(n, Math.Sqrt(p)), 196 Math.Atan2(n, Math.Sqrt(p)),
197 Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s))); 197 Math.Atan2(2.0 * (r.z * r.s - r.x * r.y), (t.x - t.y - t.z + t.s)));
198 else if (n > 0) 198 else if (n > 0)
199 return new LSL_Types.Vector3(0.0, Math.PI / 2, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); 199 return new LSL_Types.Vector3(0.0, Math.PI / 2, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z));
200 else 200 else
201 return new LSL_Types.Vector3(0.0, -Math.PI / 2, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z)); 201 return new LSL_Types.Vector3(0.0, -Math.PI / 2, Math.Atan2((r.z * r.s + r.x * r.y), 0.5 - t.x - t.z));
202 } 202 }
203 203
204 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) 204 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v)
205 { 205 {
206 //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 206 //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07
207 float err = 0.00001f; 207 float err = 0.00001f;
208 double ax = Math.Sin(v.x / 2); 208 double ax = Math.Sin(v.x / 2);
209 double aw = Math.Cos(v.x / 2); 209 double aw = Math.Cos(v.x / 2);
210 double by = Math.Sin(v.y / 2); 210 double by = Math.Sin(v.y / 2);
211 double bw = Math.Cos(v.y / 2); 211 double bw = Math.Cos(v.y / 2);
212 double cz = Math.Sin(v.z / 2); 212 double cz = Math.Sin(v.z / 2);
213 double cw = Math.Cos(v.z / 2); 213 double cw = Math.Cos(v.z / 2);
214 LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw); 214 LSL_Types.Quaternion a1 = new LSL_Types.Quaternion(0.0, 0.0, cz, cw);
215 LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw); 215 LSL_Types.Quaternion a2 = new LSL_Types.Quaternion(0.0, by, 0.0, bw);
216 LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw); 216 LSL_Types.Quaternion a3 = new LSL_Types.Quaternion(ax, 0.0, 0.0, aw);
217 LSL_Types.Quaternion a = (a1 * a2) * a3; 217 LSL_Types.Quaternion a = (a1 * a2) * a3;
218 //This multiplication doesnt compile, yet. a = a1 * a2 * a3; 218 //This multiplication doesnt compile, yet. a = a1 * a2 * a3;
219 LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz, 219 LSL_Types.Quaternion b = new LSL_Types.Quaternion(ax * bw * cw + aw * by * cz,
220 aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw, 220 aw * by * cw - ax * bw * cz, aw * bw * cz + ax * by * cw,
221 aw * bw * cw - ax * by * cz); 221 aw * bw * cw - ax * by * cz);
222 LSL_Types.Quaternion c = new LSL_Types.Quaternion(); 222 LSL_Types.Quaternion c = new LSL_Types.Quaternion();
223 //This addition doesnt compile yet c = a + b; 223 //This addition doesnt compile yet c = a + b;
224 LSL_Types.Quaternion d = new LSL_Types.Quaternion(); 224 LSL_Types.Quaternion d = new LSL_Types.Quaternion();
225 //This addition doesnt compile yet d = a - b; 225 //This addition doesnt compile yet d = a - b;
226 if ((Math.Abs(c.x) > err && Math.Abs(d.x) > err) || 226 if ((Math.Abs(c.x) > err && Math.Abs(d.x) > err) ||
227 (Math.Abs(c.y) > err && Math.Abs(d.y) > err) || 227 (Math.Abs(c.y) > err && Math.Abs(d.y) > err) ||
228 (Math.Abs(c.z) > err && Math.Abs(d.z) > err) || 228 (Math.Abs(c.z) > err && Math.Abs(d.z) > err) ||
229 (Math.Abs(c.s) > err && Math.Abs(d.s) > err)) 229 (Math.Abs(c.s) > err && Math.Abs(d.s) > err))
230 { 230 {
231 return b; 231 return b;
232 //return a new Quaternion that is null until I figure this out 232 //return a new Quaternion that is null until I figure this out
233 // return b; 233 // return b;
234 // return a; 234 // return a;
235 } 235 }
236 return a; 236 return a;
237 } 237 }
238 238
239 public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up) 239 public LSL_Types.Quaternion llAxes2Rot(LSL_Types.Vector3 fwd, LSL_Types.Vector3 left, LSL_Types.Vector3 up)
240 { 240 {
241 return new LSL_Types.Quaternion(); 241 return new LSL_Types.Quaternion();
242 } 242 }
243 243
244 public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r) 244 public LSL_Types.Vector3 llRot2Fwd(LSL_Types.Quaternion r)
245 { 245 {
246 return new LSL_Types.Vector3(); 246 return new LSL_Types.Vector3();
247 } 247 }
248 248
249 public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r) 249 public LSL_Types.Vector3 llRot2Left(LSL_Types.Quaternion r)
250 { 250 {
251 return new LSL_Types.Vector3(); 251 return new LSL_Types.Vector3();
252 } 252 }
253 253
254 public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r) 254 public LSL_Types.Vector3 llRot2Up(LSL_Types.Quaternion r)
255 { 255 {
256 return new LSL_Types.Vector3(); 256 return new LSL_Types.Vector3();
257 } 257 }
258 public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b) 258 public LSL_Types.Quaternion llRotBetween(LSL_Types.Vector3 a, LSL_Types.Vector3 b)
259 { 259 {
260 //A and B should both be normalized 260 //A and B should both be normalized
261 261
262 double dotProduct = LSL_Types.Vector3.Dot(a, b); 262 double dotProduct = LSL_Types.Vector3.Dot(a, b);
263 LSL_Types.Vector3 crossProduct = LSL_Types.Vector3.Cross(a, b); 263 LSL_Types.Vector3 crossProduct = LSL_Types.Vector3.Cross(a, b);
264 double magProduct = LSL_Types.Vector3.Mag(a) * LSL_Types.Vector3.Mag(b); 264 double magProduct = LSL_Types.Vector3.Mag(a) * LSL_Types.Vector3.Mag(b);
265 double angle = Math.Acos(dotProduct / magProduct); 265 double angle = Math.Acos(dotProduct / magProduct);
266 LSL_Types.Vector3 axis = LSL_Types.Vector3.Norm(crossProduct); 266 LSL_Types.Vector3 axis = LSL_Types.Vector3.Norm(crossProduct);
267 double s = Math.Sin(angle / 2); 267 double s = Math.Sin(angle / 2);
268 268
269 return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2)); 269 return new LSL_Types.Quaternion(axis.x * s, axis.y * s, axis.z * s, (float)Math.Cos(angle / 2));
270 } 270 }
271 public void llWhisper(int channelID, string text) 271 public void llWhisper(int channelID, string text)
272 { 272 {
273 World.SimChat(Helpers.StringToField(text), 273 World.SimChat(Helpers.StringToField(text),
274 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 274 ChatTypeEnum.Whisper, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
275 275
276 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 276 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
277 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text); 277 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Whisper, channelID, m_host.Name, text);
278 } 278 }
279 279
280 public void llSay(int channelID, string text) 280 public void llSay(int channelID, string text)
281 { 281 {
282 World.SimChat(Helpers.StringToField(text), 282 World.SimChat(Helpers.StringToField(text),
283 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 283 ChatTypeEnum.Say, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
284 284
285 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 285 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
286 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text); 286 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, channelID, m_host.Name, text);
287 } 287 }
288 288
289 public void llShout(int channelID, string text) 289 public void llShout(int channelID, string text)
290 { 290 {
291 World.SimChat(Helpers.StringToField(text), 291 World.SimChat(Helpers.StringToField(text),
292 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 292 ChatTypeEnum.Shout, channelID, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
293 293
294 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 294 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
295 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text); 295 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Shout, channelID, m_host.Name, text);
296 } 296 }
297 297
298 public int llListen(int channelID, string name, string ID, string msg) 298 public int llListen(int channelID, string name, string ID, string msg)
299 { 299 {
300 if (ID == "") 300 if (ID == "")
301 { 301 {
302 ID = LLUUID.Zero.ToString(); 302 ID = LLUUID.Zero.ToString();
303 } 303 }
304 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 304 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
305 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg); 305 return wComm.Listen(m_localID, m_itemID, m_host.UUID, channelID, name, ID, msg);
306 } 306 }
307 307
308 public void llListenControl(int number, int active) 308 public void llListenControl(int number, int active)
309 { 309 {
310 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 310 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
311 wComm.ListenControl(number, active); 311 wComm.ListenControl(number, active);
312 } 312 }
313 313
314 public void llListenRemove(int number) 314 public void llListenRemove(int number)
315 { 315 {
316 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 316 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
317 wComm.ListenRemove(number); 317 wComm.ListenRemove(number);
318 } 318 }
319 319
320 public void llSensor(string name, string id, int type, double range, double arc) 320 public void llSensor(string name, string id, int type, double range, double arc)
321 { 321 {
322 NotImplemented("llSensor"); 322 NotImplemented("llSensor");
323 return; 323 return;
324 } 324 }
325 325
326 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate) 326 public void llSensorRepeat(string name, string id, int type, double range, double arc, double rate)
327 { 327 {
328 NotImplemented("llSensorRepeat"); 328 NotImplemented("llSensorRepeat");
329 return; 329 return;
330 } 330 }
331 331
332 public void llSensorRemove() 332 public void llSensorRemove()
333 { 333 {
334 NotImplemented("llSensorRemove"); 334 NotImplemented("llSensorRemove");
335 return; 335 return;
336 } 336 }
337 337
338 public string llDetectedName(int number) 338 public string llDetectedName(int number)
339 { 339 {
340 NotImplemented("llDetectedName"); 340 NotImplemented("llDetectedName");
341 return ""; 341 return "";
342 } 342 }
343 343
344 public string llDetectedKey(int number) 344 public string llDetectedKey(int number)
345 { 345 {
346 NotImplemented("llDetectedKey"); 346 NotImplemented("llDetectedKey");
347 return ""; 347 return "";
348 } 348 }
349 349
350 public string llDetectedOwner(int number) 350 public string llDetectedOwner(int number)
351 { 351 {
352 NotImplemented("llDetectedOwner"); 352 NotImplemented("llDetectedOwner");
353 return ""; 353 return "";
354 } 354 }
355 355
356 public int llDetectedType(int number) 356 public int llDetectedType(int number)
357 { 357 {
358 NotImplemented("llDetectedType"); 358 NotImplemented("llDetectedType");
359 return 0; 359 return 0;
360 } 360 }
361 361
362 public LSL_Types.Vector3 llDetectedPos(int number) 362 public LSL_Types.Vector3 llDetectedPos(int number)
363 { 363 {
364 NotImplemented("llDetectedPos"); 364 NotImplemented("llDetectedPos");
365 return new LSL_Types.Vector3(); 365 return new LSL_Types.Vector3();
366 } 366 }
367 367
368 public LSL_Types.Vector3 llDetectedVel(int number) 368 public LSL_Types.Vector3 llDetectedVel(int number)
369 { 369 {
370 NotImplemented("llDetectedVel"); 370 NotImplemented("llDetectedVel");
371 return new LSL_Types.Vector3(); 371 return new LSL_Types.Vector3();
372 } 372 }
373 373
374 public LSL_Types.Vector3 llDetectedGrab(int number) 374 public LSL_Types.Vector3 llDetectedGrab(int number)
375 { 375 {
376 NotImplemented("llDetectedGrab"); 376 NotImplemented("llDetectedGrab");
377 return new LSL_Types.Vector3(); 377 return new LSL_Types.Vector3();
378 } 378 }
379 379
380 public LSL_Types.Quaternion llDetectedRot(int number) 380 public LSL_Types.Quaternion llDetectedRot(int number)
381 { 381 {
382 NotImplemented("llDetectedRot"); 382 NotImplemented("llDetectedRot");
383 return new LSL_Types.Quaternion(); 383 return new LSL_Types.Quaternion();
384 } 384 }
385 385
386 public int llDetectedGroup(int number) 386 public int llDetectedGroup(int number)
387 { 387 {
388 NotImplemented("llDetectedGroup"); 388 NotImplemented("llDetectedGroup");
389 return 0; 389 return 0;
390 } 390 }
391 391
392 public int llDetectedLinkNumber(int number) 392 public int llDetectedLinkNumber(int number)
393 { 393 {
394 NotImplemented("llDetectedLinkNumber"); 394 NotImplemented("llDetectedLinkNumber");
395 return 0; 395 return 0;
396 } 396 }
397 397
398 public void llDie() 398 public void llDie()
399 { 399 {
400 World.DeleteSceneObjectGroup(m_host.ParentGroup); 400 World.DeleteSceneObjectGroup(m_host.ParentGroup);
401 return; 401 return;
402 } 402 }
403 403
404 public double llGround(LSL_Types.Vector3 offset) 404 public double llGround(LSL_Types.Vector3 offset)
405 { 405 {
406 int x = (int)(m_host.AbsolutePosition.X + offset.x); 406 int x = (int)(m_host.AbsolutePosition.X + offset.x);
407 int y = (int)(m_host.AbsolutePosition.Y + offset.y); 407 int y = (int)(m_host.AbsolutePosition.Y + offset.y);
408 return World.GetLandHeight(x, y); 408 return World.GetLandHeight(x, y);
409 } 409 }
410 410
411 public double llCloud(LSL_Types.Vector3 offset) 411 public double llCloud(LSL_Types.Vector3 offset)
412 { 412 {
413 NotImplemented("llCloud"); 413 NotImplemented("llCloud");
414 return 0; 414 return 0;
415 } 415 }
416 416
417 public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset) 417 public LSL_Types.Vector3 llWind(LSL_Types.Vector3 offset)
418 { 418 {
419 NotImplemented("llWind"); 419 NotImplemented("llWind");
420 return new LSL_Types.Vector3(); 420 return new LSL_Types.Vector3();
421 } 421 }
422 422
423 public void llSetStatus(int status, int value) 423 public void llSetStatus(int status, int value)
424 { 424 {
425 NotImplemented("llSetStatus"); 425 NotImplemented("llSetStatus");
426 return; 426 return;
427 } 427 }
428 428
429 public int llGetStatus(int status) 429 public int llGetStatus(int status)
430 { 430 {
431 NotImplemented("llGetStatus"); 431 NotImplemented("llGetStatus");
432 return 0; 432 return 0;
433 } 433 }
434 434
435 public void llSetScale(LSL_Types.Vector3 scale) 435 public void llSetScale(LSL_Types.Vector3 scale)
436 { 436 {
437 // TODO: this needs to trigger a persistance save as well 437 // TODO: this needs to trigger a persistance save as well
438 LLVector3 tmp = m_host.Scale; 438 LLVector3 tmp = m_host.Scale;
439 tmp.X = (float)scale.x; 439 tmp.X = (float)scale.x;
440 tmp.Y = (float)scale.y; 440 tmp.Y = (float)scale.y;
441 tmp.Z = (float)scale.z; 441 tmp.Z = (float)scale.z;
442 m_host.Scale = tmp; 442 m_host.Scale = tmp;
443 m_host.SendFullUpdateToAllClients(); 443 m_host.SendFullUpdateToAllClients();
444 return; 444 return;
445 } 445 }
446 446
447 public LSL_Types.Vector3 llGetScale() 447 public LSL_Types.Vector3 llGetScale()
448 { 448 {
449 return new LSL_Types.Vector3(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z); 449 return new LSL_Types.Vector3(m_host.Scale.X, m_host.Scale.Y, m_host.Scale.Z);
450 } 450 }
451 451
452 public void llSetColor(LSL_Types.Vector3 color, int face) 452 public void llSetColor(LSL_Types.Vector3 color, int face)
453 { 453 {
454 LLObject.TextureEntry tex = m_host.Shape.Textures; 454 LLObject.TextureEntry tex = m_host.Shape.Textures;
455 LLColor texcolor; 455 LLColor texcolor;
456 if (face > -1) 456 if (face > -1)
457 { 457 {
458 texcolor = tex.CreateFace((uint)face).RGBA; 458 texcolor = tex.CreateFace((uint)face).RGBA;
459 texcolor.R = (float)Math.Abs(color.x - 1); 459 texcolor.R = (float)Math.Abs(color.x - 1);
460 texcolor.G = (float)Math.Abs(color.y - 1); 460 texcolor.G = (float)Math.Abs(color.y - 1);
461 texcolor.B = (float)Math.Abs(color.z - 1); 461 texcolor.B = (float)Math.Abs(color.z - 1);
462 tex.FaceTextures[face].RGBA = texcolor; 462 tex.FaceTextures[face].RGBA = texcolor;
463 m_host.UpdateTexture(tex); 463 m_host.UpdateTexture(tex);
464 return; 464 return;
465 } 465 }
466 else if (face == -1) 466 else if (face == -1)
467 { 467 {
468 for (uint i = 0; i < 32; i++) 468 for (uint i = 0; i < 32; i++)
469 { 469 {
470 if (tex.FaceTextures[i] != null) 470 if (tex.FaceTextures[i] != null)
471 { 471 {
472 texcolor = tex.FaceTextures[i].RGBA; 472 texcolor = tex.FaceTextures[i].RGBA;
473 texcolor.R = (float)Math.Abs(color.x - 1); 473 texcolor.R = (float)Math.Abs(color.x - 1);
474 texcolor.G = (float)Math.Abs(color.y - 1); 474 texcolor.G = (float)Math.Abs(color.y - 1);
475 texcolor.B = (float)Math.Abs(color.z - 1); 475 texcolor.B = (float)Math.Abs(color.z - 1);
476 tex.FaceTextures[i].RGBA = texcolor; 476 tex.FaceTextures[i].RGBA = texcolor;
477 } 477 }
478 texcolor = tex.DefaultTexture.RGBA; 478 texcolor = tex.DefaultTexture.RGBA;
479 texcolor.R = (float)Math.Abs(color.x - 1); 479 texcolor.R = (float)Math.Abs(color.x - 1);
480 texcolor.G = (float)Math.Abs(color.y - 1); 480 texcolor.G = (float)Math.Abs(color.y - 1);
481 texcolor.B = (float)Math.Abs(color.z - 1); 481 texcolor.B = (float)Math.Abs(color.z - 1);
482 tex.DefaultTexture.RGBA = texcolor; 482 tex.DefaultTexture.RGBA = texcolor;
483 } 483 }
484 m_host.UpdateTexture(tex); 484 m_host.UpdateTexture(tex);
485 return; 485 return;
486 } 486 }
487 NotImplemented("llSetColor"); 487 NotImplemented("llSetColor");
488 return; 488 return;
489 } 489 }
490 490
491 public double llGetAlpha(int face) 491 public double llGetAlpha(int face)
492 { 492 {
493 LLObject.TextureEntry tex = m_host.Shape.Textures; 493 LLObject.TextureEntry tex = m_host.Shape.Textures;
494 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 494 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
495 { 495 {
496 return (double)((tex.DefaultTexture.RGBA.A * 255) / 255); 496 return (double)((tex.DefaultTexture.RGBA.A * 255) / 255);
497 } 497 }
498 if (face > -1) 498 if (face > -1)
499 { 499 {
500 return (double)((tex.GetFace((uint)face).RGBA.A * 255) / 255); 500 return (double)((tex.GetFace((uint)face).RGBA.A * 255) / 255);
501 } 501 }
502 return 0; 502 return 0;
503 } 503 }
504 504
505 public void llSetAlpha(double alpha, int face) 505 public void llSetAlpha(double alpha, int face)
506 { 506 {
507 LLObject.TextureEntry tex = m_host.Shape.Textures; 507 LLObject.TextureEntry tex = m_host.Shape.Textures;
508 LLColor texcolor; 508 LLColor texcolor;
509 if (face > -1) 509 if (face > -1)
510 { 510 {
511 texcolor = tex.CreateFace((uint)face).RGBA; 511 texcolor = tex.CreateFace((uint)face).RGBA;
512 texcolor.A = (float)Math.Abs(alpha - 1); 512 texcolor.A = (float)Math.Abs(alpha - 1);
513 tex.FaceTextures[face].RGBA = texcolor; 513 tex.FaceTextures[face].RGBA = texcolor;
514 m_host.UpdateTexture(tex); 514 m_host.UpdateTexture(tex);
515 return; 515 return;
516 } 516 }
517 else if (face == -1) 517 else if (face == -1)
518 { 518 {
519 for (int i = 0; i < 32; i++) 519 for (int i = 0; i < 32; i++)
520 { 520 {
521 if (tex.FaceTextures[i] != null) 521 if (tex.FaceTextures[i] != null)
522 { 522 {
523 texcolor = tex.FaceTextures[i].RGBA; 523 texcolor = tex.FaceTextures[i].RGBA;
524 texcolor.A = (float)Math.Abs(alpha - 1); 524 texcolor.A = (float)Math.Abs(alpha - 1);
525 tex.FaceTextures[i].RGBA = texcolor; 525 tex.FaceTextures[i].RGBA = texcolor;
526 } 526 }
527 } 527 }
528 texcolor = tex.DefaultTexture.RGBA; 528 texcolor = tex.DefaultTexture.RGBA;
529 texcolor.A = (float)Math.Abs(alpha - 1); 529 texcolor.A = (float)Math.Abs(alpha - 1);
530 tex.DefaultTexture.RGBA = texcolor; 530 tex.DefaultTexture.RGBA = texcolor;
531 m_host.UpdateTexture(tex); 531 m_host.UpdateTexture(tex);
532 return; 532 return;
533 } 533 }
534 NotImplemented("llSetAlpha"); 534 NotImplemented("llSetAlpha");
535 return; 535 return;
536 } 536 }
537 537
538 public LSL_Types.Vector3 llGetColor(int face) 538 public LSL_Types.Vector3 llGetColor(int face)
539 { 539 {
540 LLObject.TextureEntry tex = m_host.Shape.Textures; 540 LLObject.TextureEntry tex = m_host.Shape.Textures;
541 LLColor texcolor; 541 LLColor texcolor;
542 LSL_Types.Vector3 rgb; 542 LSL_Types.Vector3 rgb;
543 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color 543 if (face == -1) // TMP: Until we can determine number of sides, ALL_SIDES (-1) will return default color
544 { 544 {
545 texcolor = tex.DefaultTexture.RGBA; 545 texcolor = tex.DefaultTexture.RGBA;
546 rgb.x = (255 - (texcolor.R * 255)) / 255; 546 rgb.x = (255 - (texcolor.R * 255)) / 255;
547 rgb.y = (255 - (texcolor.G * 255)) / 255; 547 rgb.y = (255 - (texcolor.G * 255)) / 255;
548 rgb.z = (255 - (texcolor.B * 255)) / 255; 548 rgb.z = (255 - (texcolor.B * 255)) / 255;
549 return rgb; 549 return rgb;
550 } 550 }
551 if (face > -1) 551 if (face > -1)
552 { 552 {
553 texcolor = tex.GetFace((uint)face).RGBA; 553 texcolor = tex.GetFace((uint)face).RGBA;
554 rgb.x = (255 - (texcolor.R * 255)) / 255; 554 rgb.x = (255 - (texcolor.R * 255)) / 255;
555 rgb.y = (255 - (texcolor.G * 255)) / 255; 555 rgb.y = (255 - (texcolor.G * 255)) / 255;
556 rgb.z = (255 - (texcolor.B * 255)) / 255; 556 rgb.z = (255 - (texcolor.B * 255)) / 255;
557 return rgb; 557 return rgb;
558 } 558 }
559 NotImplemented("llGetColor"); 559 NotImplemented("llGetColor");
560 return new LSL_Types.Vector3(); 560 return new LSL_Types.Vector3();
561 } 561 }
562 562
563 public void llSetTexture(string texture, int face) 563 public void llSetTexture(string texture, int face)
564 { 564 {
565 LLObject.TextureEntry tex = m_host.Shape.Textures; 565 LLObject.TextureEntry tex = m_host.Shape.Textures;
566 566
567 if (face > -1) 567 if (face > -1)
568 { 568 {
569 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 569 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
570 texface.TextureID = new LLUUID(texture); 570 texface.TextureID = new LLUUID(texture);
571 tex.FaceTextures[face] = texface; 571 tex.FaceTextures[face] = texface;
572 m_host.UpdateTexture(tex); 572 m_host.UpdateTexture(tex);
573 return; 573 return;
574 } 574 }
575 else if (face == -1) 575 else if (face == -1)
576 { 576 {
577 for (uint i = 0; i < 32; i++) 577 for (uint i = 0; i < 32; i++)
578 { 578 {
579 if (tex.FaceTextures[i] != null) 579 if (tex.FaceTextures[i] != null)
580 { 580 {
581 tex.FaceTextures[i].TextureID = new LLUUID(texture); 581 tex.FaceTextures[i].TextureID = new LLUUID(texture);
582 } 582 }
583 } 583 }
584 tex.DefaultTexture.TextureID = new LLUUID(texture); 584 tex.DefaultTexture.TextureID = new LLUUID(texture);
585 m_host.UpdateTexture(tex); 585 m_host.UpdateTexture(tex);
586 return; 586 return;
587 } 587 }
588 NotImplemented("llSetTexture"); 588 NotImplemented("llSetTexture");
589 return; 589 return;
590 } 590 }
591 591
592 public void llScaleTexture(double u, double v, int face) 592 public void llScaleTexture(double u, double v, int face)
593 { 593 {
594 LLObject.TextureEntry tex = m_host.Shape.Textures; 594 LLObject.TextureEntry tex = m_host.Shape.Textures;
595 if (face > -1) 595 if (face > -1)
596 { 596 {
597 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 597 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
598 texface.RepeatU = (float)u; 598 texface.RepeatU = (float)u;
599 texface.RepeatV = (float)v; 599 texface.RepeatV = (float)v;
600 tex.FaceTextures[face] = texface; 600 tex.FaceTextures[face] = texface;
601 m_host.UpdateTexture(tex); 601 m_host.UpdateTexture(tex);
602 return; 602 return;
603 } 603 }
604 if (face == -1) 604 if (face == -1)
605 { 605 {
606 for (int i = 0; i < 32; i++) 606 for (int i = 0; i < 32; i++)
607 { 607 {
608 if (tex.FaceTextures[i] != null) 608 if (tex.FaceTextures[i] != null)
609 { 609 {
610 tex.FaceTextures[i].RepeatU = (float)u; 610 tex.FaceTextures[i].RepeatU = (float)u;
611 tex.FaceTextures[i].RepeatV = (float)v; 611 tex.FaceTextures[i].RepeatV = (float)v;
612 } 612 }
613 } 613 }
614 tex.DefaultTexture.RepeatU = (float)u; 614 tex.DefaultTexture.RepeatU = (float)u;
615 tex.DefaultTexture.RepeatV = (float)v; 615 tex.DefaultTexture.RepeatV = (float)v;
616 m_host.UpdateTexture(tex); 616 m_host.UpdateTexture(tex);
617 return; 617 return;
618 } 618 }
619 NotImplemented("llScaleTexture"); 619 NotImplemented("llScaleTexture");
620 return; 620 return;
621 } 621 }
622 622
623 public void llOffsetTexture(double u, double v, int face) 623 public void llOffsetTexture(double u, double v, int face)
624 { 624 {
625 LLObject.TextureEntry tex = m_host.Shape.Textures; 625 LLObject.TextureEntry tex = m_host.Shape.Textures;
626 if (face > -1) 626 if (face > -1)
627 { 627 {
628 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 628 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
629 texface.OffsetU = (float)u; 629 texface.OffsetU = (float)u;
630 texface.OffsetV = (float)v; 630 texface.OffsetV = (float)v;
631 tex.FaceTextures[face] = texface; 631 tex.FaceTextures[face] = texface;
632 m_host.UpdateTexture(tex); 632 m_host.UpdateTexture(tex);
633 return; 633 return;
634 } 634 }
635 if (face == -1) 635 if (face == -1)
636 { 636 {
637 for (int i = 0; i < 32; i++) 637 for (int i = 0; i < 32; i++)
638 { 638 {
639 if (tex.FaceTextures[i] != null) 639 if (tex.FaceTextures[i] != null)
640 { 640 {
641 tex.FaceTextures[i].OffsetU = (float)u; 641 tex.FaceTextures[i].OffsetU = (float)u;
642 tex.FaceTextures[i].OffsetV = (float)v; 642 tex.FaceTextures[i].OffsetV = (float)v;
643 } 643 }
644 } 644 }
645 tex.DefaultTexture.OffsetU = (float)u; 645 tex.DefaultTexture.OffsetU = (float)u;
646 tex.DefaultTexture.OffsetV = (float)v; 646 tex.DefaultTexture.OffsetV = (float)v;
647 m_host.UpdateTexture(tex); 647 m_host.UpdateTexture(tex);
648 return; 648 return;
649 } 649 }
650 NotImplemented("llOffsetTexture"); 650 NotImplemented("llOffsetTexture");
651 return; 651 return;
652 } 652 }
653 653
654 public void llRotateTexture(double rotation, int face) 654 public void llRotateTexture(double rotation, int face)
655 { 655 {
656 LLObject.TextureEntry tex = m_host.Shape.Textures; 656 LLObject.TextureEntry tex = m_host.Shape.Textures;
657 if (face > -1) 657 if (face > -1)
658 { 658 {
659 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face); 659 LLObject.TextureEntryFace texface = tex.CreateFace((uint)face);
660 texface.Rotation = (float)rotation; 660 texface.Rotation = (float)rotation;
661 tex.FaceTextures[face] = texface; 661 tex.FaceTextures[face] = texface;
662 m_host.UpdateTexture(tex); 662 m_host.UpdateTexture(tex);
663 return; 663 return;
664 } 664 }
665 if (face == -1) 665 if (face == -1)
666 { 666 {
667 for (int i = 0; i < 32; i++) 667 for (int i = 0; i < 32; i++)
668 { 668 {
669 if (tex.FaceTextures[i] != null) 669 if (tex.FaceTextures[i] != null)
670 { 670 {
671 tex.FaceTextures[i].Rotation = (float)rotation; 671 tex.FaceTextures[i].Rotation = (float)rotation;
672 } 672 }
673 } 673 }
674 tex.DefaultTexture.Rotation = (float)rotation; 674 tex.DefaultTexture.Rotation = (float)rotation;
675 m_host.UpdateTexture(tex); 675 m_host.UpdateTexture(tex);
676 return; 676 return;
677 } 677 }
678 NotImplemented("llRotateTexture"); 678 NotImplemented("llRotateTexture");
679 return; 679 return;
680 } 680 }
681 681
682 public string llGetTexture(int face) 682 public string llGetTexture(int face)
683 { 683 {
684 LLObject.TextureEntry tex = m_host.Shape.Textures; 684 LLObject.TextureEntry tex = m_host.Shape.Textures;
685 if (face == -1) 685 if (face == -1)
686 { 686 {
687 face = 0; 687 face = 0;
688 } 688 }
689 if (face > -1) 689 if (face > -1)
690 { 690 {
691 LLObject.TextureEntryFace texface; 691 LLObject.TextureEntryFace texface;
692 texface = tex.GetFace((uint)face); 692 texface = tex.GetFace((uint)face);
693 return texface.TextureID.ToString(); 693 return texface.TextureID.ToString();
694 } 694 }
695 NotImplemented("llGetTexture"); 695 NotImplemented("llGetTexture");
696 return ""; 696 return "";
697 } 697 }
698 698
699 public void llSetPos(LSL_Types.Vector3 pos) 699 public void llSetPos(LSL_Types.Vector3 pos)
700 { 700 {
701 if (m_host.ParentID != 0) 701 if (m_host.ParentID != 0)
702 { 702 {
703 m_host.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 703 m_host.UpdateOffSet(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z));
704 } 704 }
705 else 705 else
706 { 706 {
707 m_host.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z)); 707 m_host.UpdateGroupPosition(new LLVector3((float)pos.x, (float)pos.y, (float)pos.z));
708 } 708 }
709 } 709 }
710 710
711 public LSL_Types.Vector3 llGetPos() 711 public LSL_Types.Vector3 llGetPos()
712 { 712 {
713 return new LSL_Types.Vector3(m_host.AbsolutePosition.X, 713 return new LSL_Types.Vector3(m_host.AbsolutePosition.X,
714 m_host.AbsolutePosition.Y, 714 m_host.AbsolutePosition.Y,
715 m_host.AbsolutePosition.Z); 715 m_host.AbsolutePosition.Z);
716 } 716 }
717 717
718 public LSL_Types.Vector3 llGetLocalPos() 718 public LSL_Types.Vector3 llGetLocalPos()
719 { 719 {
720 if (m_host.ParentID != 0) 720 if (m_host.ParentID != 0)
721 { 721 {
722 return new LSL_Types.Vector3(m_host.OffsetPosition.X, 722 return new LSL_Types.Vector3(m_host.OffsetPosition.X,
723 m_host.OffsetPosition.Y, 723 m_host.OffsetPosition.Y,
724 m_host.OffsetPosition.Z); 724 m_host.OffsetPosition.Z);
725 } 725 }
726 else 726 else
727 { 727 {
728 return new LSL_Types.Vector3(m_host.AbsolutePosition.X, 728 return new LSL_Types.Vector3(m_host.AbsolutePosition.X,
729 m_host.AbsolutePosition.Y, 729 m_host.AbsolutePosition.Y,
730 m_host.AbsolutePosition.Z); 730 m_host.AbsolutePosition.Z);
731 } 731 }
732 } 732 }
733 733
734 public void llSetRot(LSL_Types.Quaternion rot) 734 public void llSetRot(LSL_Types.Quaternion rot)
735 { 735 {
736 m_host.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s)); 736 m_host.UpdateRotation(new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s));
737 } 737 }
738 738
739 public LSL_Types.Quaternion llGetRot() 739 public LSL_Types.Quaternion llGetRot()
740 { 740 {
741 LLQuaternion q = m_host.RotationOffset; 741 LLQuaternion q = m_host.RotationOffset;
742 return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W); 742 return new LSL_Types.Quaternion(q.X, q.Y, q.Z, q.W);
743 } 743 }
744 744
745 public LSL_Types.Quaternion llGetLocalRot() 745 public LSL_Types.Quaternion llGetLocalRot()
746 { 746 {
747 return new LSL_Types.Quaternion(m_host.RotationOffset.X, m_host.RotationOffset.Y, m_host.RotationOffset.Z, m_host.RotationOffset.W); 747 return new LSL_Types.Quaternion(m_host.RotationOffset.X, m_host.RotationOffset.Y, m_host.RotationOffset.Z, m_host.RotationOffset.W);
748 } 748 }
749 749
750 public void llSetForce(LSL_Types.Vector3 force, int local) 750 public void llSetForce(LSL_Types.Vector3 force, int local)
751 { 751 {
752 NotImplemented("llSetForce"); 752 NotImplemented("llSetForce");
753 } 753 }
754 754
755 public LSL_Types.Vector3 llGetForce() 755 public LSL_Types.Vector3 llGetForce()
756 { 756 {
757 NotImplemented("llGetForce"); 757 NotImplemented("llGetForce");
758 return new LSL_Types.Vector3(); 758 return new LSL_Types.Vector3();
759 } 759 }
760 760
761 public int llTarget(LSL_Types.Vector3 position, double range) 761 public int llTarget(LSL_Types.Vector3 position, double range)
762 { 762 {
763 NotImplemented("llTarget"); 763 NotImplemented("llTarget");
764 return 0; 764 return 0;
765 } 765 }
766 766
767 public void llTargetRemove(int number) 767 public void llTargetRemove(int number)
768 { 768 {
769 NotImplemented("llTargetRemove"); 769 NotImplemented("llTargetRemove");
770 } 770 }
771 771
772 public int llRotTarget(LSL_Types.Quaternion rot, double error) 772 public int llRotTarget(LSL_Types.Quaternion rot, double error)
773 { 773 {
774 NotImplemented("llRotTarget"); 774 NotImplemented("llRotTarget");
775 return 0; 775 return 0;
776 } 776 }
777 777
778 public void llRotTargetRemove(int number) 778 public void llRotTargetRemove(int number)
779 { 779 {
780 NotImplemented("llRotTargetRemove"); 780 NotImplemented("llRotTargetRemove");
781 } 781 }
782 782
783 public void llMoveToTarget(LSL_Types.Vector3 target, double tau) 783 public void llMoveToTarget(LSL_Types.Vector3 target, double tau)
784 { 784 {
785 NotImplemented("llMoveToTarget"); 785 NotImplemented("llMoveToTarget");
786 } 786 }
787 787
788 public void llStopMoveToTarget() 788 public void llStopMoveToTarget()
789 { 789 {
790 NotImplemented("llStopMoveToTarget"); 790 NotImplemented("llStopMoveToTarget");
791 } 791 }
792 792
793 public void llApplyImpulse(LSL_Types.Vector3 force, int local) 793 public void llApplyImpulse(LSL_Types.Vector3 force, int local)
794 { 794 {
795 NotImplemented("llApplyImpulse"); 795 NotImplemented("llApplyImpulse");
796 } 796 }
797 797
798 public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local) 798 public void llApplyRotationalImpulse(LSL_Types.Vector3 force, int local)
799 { 799 {
800 NotImplemented("llApplyRotationalImpulse"); 800 NotImplemented("llApplyRotationalImpulse");
801 } 801 }
802 802
803 public void llSetTorque(LSL_Types.Vector3 torque, int local) 803 public void llSetTorque(LSL_Types.Vector3 torque, int local)
804 { 804 {
805 NotImplemented("llSetTorque"); 805 NotImplemented("llSetTorque");
806 } 806 }
807 807
808 public LSL_Types.Vector3 llGetTorque() 808 public LSL_Types.Vector3 llGetTorque()
809 { 809 {
810 NotImplemented("llGetTorque"); 810 NotImplemented("llGetTorque");
811 return new LSL_Types.Vector3(); 811 return new LSL_Types.Vector3();
812 } 812 }
813 813
814 public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local) 814 public void llSetForceAndTorque(LSL_Types.Vector3 force, LSL_Types.Vector3 torque, int local)
815 { 815 {
816 NotImplemented("llSetForceAndTorque"); 816 NotImplemented("llSetForceAndTorque");
817 } 817 }
818 818
819 public LSL_Types.Vector3 llGetVel() 819 public LSL_Types.Vector3 llGetVel()
820 { 820 {
821 return new LSL_Types.Vector3(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z); 821 return new LSL_Types.Vector3(m_host.Velocity.X, m_host.Velocity.Y, m_host.Velocity.Z);
822 } 822 }
823 823
824 public LSL_Types.Vector3 llGetAccel() 824 public LSL_Types.Vector3 llGetAccel()
825 { 825 {
826 return new LSL_Types.Vector3(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z); 826 return new LSL_Types.Vector3(m_host.Acceleration.X, m_host.Acceleration.Y, m_host.Acceleration.Z);
827 } 827 }
828 828
829 public LSL_Types.Vector3 llGetOmega() 829 public LSL_Types.Vector3 llGetOmega()
830 { 830 {
831 NotImplemented("llGetOmega"); 831 NotImplemented("llGetOmega");
832 return new LSL_Types.Vector3(); 832 return new LSL_Types.Vector3();
833 } 833 }
834 834
835 public double llGetTimeOfDay() 835 public double llGetTimeOfDay()
836 { 836 {
837 NotImplemented("llGetTimeOfDay"); 837 NotImplemented("llGetTimeOfDay");
838 return 0; 838 return 0;
839 } 839 }
840 840
841 public double llGetWallclock() 841 public double llGetWallclock()
842 { 842 {
843 return DateTime.Now.TimeOfDay.TotalSeconds; 843 return DateTime.Now.TimeOfDay.TotalSeconds;
844 } 844 }
845 845
846 public double llGetTime() 846 public double llGetTime()
847 { 847 {
848 TimeSpan ScriptTime = DateTime.Now - m_timer; 848 TimeSpan ScriptTime = DateTime.Now - m_timer;
849 return (double)(ScriptTime.TotalMilliseconds / 1000); 849 return (double)(ScriptTime.TotalMilliseconds / 1000);
850 } 850 }
851 851
852 public void llResetTime() 852 public void llResetTime()
853 { 853 {
854 m_timer = DateTime.Now; 854 m_timer = DateTime.Now;
855 } 855 }
856 856
857 public double llGetAndResetTime() 857 public double llGetAndResetTime()
858 { 858 {
859 TimeSpan ScriptTime = DateTime.Now - m_timer; 859 TimeSpan ScriptTime = DateTime.Now - m_timer;
860 m_timer = DateTime.Now; 860 m_timer = DateTime.Now;
861 return (double)(ScriptTime.TotalMilliseconds / 1000); 861 return (double)(ScriptTime.TotalMilliseconds / 1000);
862 } 862 }
863 863
864 public void llSound() 864 public void llSound()
865 { 865 {
866 NotImplemented("llSound"); 866 NotImplemented("llSound");
867 } 867 }
868 868
869 public void llPlaySound(string sound, double volume) 869 public void llPlaySound(string sound, double volume)
870 { 870 {
871 NotImplemented("llPlaySound"); 871 NotImplemented("llPlaySound");
872 } 872 }
873 873
874 public void llLoopSound(string sound, double volume) 874 public void llLoopSound(string sound, double volume)
875 { 875 {
876 NotImplemented("llLoopSound"); 876 NotImplemented("llLoopSound");
877 } 877 }
878 878
879 public void llLoopSoundMaster(string sound, double volume) 879 public void llLoopSoundMaster(string sound, double volume)
880 { 880 {
881 NotImplemented("llLoopSoundMaster"); 881 NotImplemented("llLoopSoundMaster");
882 } 882 }
883 883
884 public void llLoopSoundSlave(string sound, double volume) 884 public void llLoopSoundSlave(string sound, double volume)
885 { 885 {
886 NotImplemented("llLoopSoundSlave"); 886 NotImplemented("llLoopSoundSlave");
887 } 887 }
888 888
889 public void llPlaySoundSlave(string sound, double volume) 889 public void llPlaySoundSlave(string sound, double volume)
890 { 890 {
891 NotImplemented("llPlaySoundSlave"); 891 NotImplemented("llPlaySoundSlave");
892 } 892 }
893 893
894 public void llTriggerSound(string sound, double volume) 894 public void llTriggerSound(string sound, double volume)
895 { 895 {
896 NotImplemented("llTriggerSound"); 896 NotImplemented("llTriggerSound");
897 } 897 }
898 898
899 public void llStopSound() 899 public void llStopSound()
900 { 900 {
901 NotImplemented("llStopSound"); 901 NotImplemented("llStopSound");
902 } 902 }
903 903
904 public void llPreloadSound(string sound) 904 public void llPreloadSound(string sound)
905 { 905 {
906 NotImplemented("llPreloadSound"); 906 NotImplemented("llPreloadSound");
907 } 907 }
908 908
909 public string llGetSubString(string src, int start, int end) 909 public string llGetSubString(string src, int start, int end)
910 { 910 {
911 return src.Substring(start, end); 911 return src.Substring(start, end);
912 } 912 }
913 913
914 public string llDeleteSubString(string src, int start, int end) 914 public string llDeleteSubString(string src, int start, int end)
915 { 915 {
916 return src.Remove(start, end - start); 916 return src.Remove(start, end - start);
917 } 917 }
918 918
919 public string llInsertString(string dst, int position, string src) 919 public string llInsertString(string dst, int position, string src)
920 { 920 {
921 return dst.Insert(position, src); 921 return dst.Insert(position, src);
922 } 922 }
923 923
924 public string llToUpper(string src) 924 public string llToUpper(string src)
925 { 925 {
926 return src.ToUpper(); 926 return src.ToUpper();
927 } 927 }
928 928
929 public string llToLower(string src) 929 public string llToLower(string src)
930 { 930 {
931 return src.ToLower(); 931 return src.ToLower();
932 } 932 }
933 933
934 public int llGiveMoney(string destination, int amount) 934 public int llGiveMoney(string destination, int amount)
935 { 935 {
936 NotImplemented("llGiveMoney"); 936 NotImplemented("llGiveMoney");
937 return 0; 937 return 0;
938 } 938 }
939 939
940 public void llMakeExplosion() 940 public void llMakeExplosion()
941 { 941 {
942 NotImplemented("llMakeExplosion"); 942 NotImplemented("llMakeExplosion");
943 } 943 }
944 944
945 public void llMakeFountain() 945 public void llMakeFountain()
946 { 946 {
947 NotImplemented("llMakeFountain"); 947 NotImplemented("llMakeFountain");
948 } 948 }
949 949
950 public void llMakeSmoke() 950 public void llMakeSmoke()
951 { 951 {
952 NotImplemented("llMakeSmoke"); 952 NotImplemented("llMakeSmoke");
953 } 953 }
954 954
955 public void llMakeFire() 955 public void llMakeFire()
956 { 956 {
957 NotImplemented("llMakeFire"); 957 NotImplemented("llMakeFire");
958 } 958 }
959 959
960 public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) 960 public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param)
961 { 961 {
962 NotImplemented("llRezObject"); 962 NotImplemented("llRezObject");
963 } 963 }
964 964
965 public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) 965 public void llLookAt(LSL_Types.Vector3 target, double strength, double damping)
966 { 966 {
967 NotImplemented("llLookAt"); 967 NotImplemented("llLookAt");
968 } 968 }
969 969
970 public void llStopLookAt() 970 public void llStopLookAt()
971 { 971 {
972 NotImplemented("llStopLookAt"); 972 NotImplemented("llStopLookAt");
973 } 973 }
974 974
975 public void llSetTimerEvent(double sec) 975 public void llSetTimerEvent(double sec)
976 { 976 {
977 // Setting timer repeat 977 // Setting timer repeat
978 m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec); 978 m_ScriptEngine.m_LSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec);
979 } 979 }
980 980
981 public void llSleep(double sec) 981 public void llSleep(double sec)
982 { 982 {
983 Thread.Sleep((int)(sec * 1000)); 983 Thread.Sleep((int)(sec * 1000));
984 } 984 }
985 985
986 public double llGetMass() 986 public double llGetMass()
987 { 987 {
988 return m_host.GetMass(); 988 return m_host.GetMass();
989 } 989 }
990 990
991 public void llCollisionFilter(string name, string id, int accept) 991 public void llCollisionFilter(string name, string id, int accept)
992 { 992 {
993 NotImplemented("llCollisionFilter"); 993 NotImplemented("llCollisionFilter");
994 } 994 }
995 995
996 public void llTakeControls(int controls, int accept, int pass_on) 996 public void llTakeControls(int controls, int accept, int pass_on)
997 { 997 {
998 NotImplemented("llTakeControls"); 998 NotImplemented("llTakeControls");
999 } 999 }
1000 1000
1001 public void llReleaseControls() 1001 public void llReleaseControls()
1002 { 1002 {
1003 NotImplemented("llReleaseControls"); 1003 NotImplemented("llReleaseControls");
1004 } 1004 }
1005 1005
1006 public void llAttachToAvatar(int attachment) 1006 public void llAttachToAvatar(int attachment)
1007 { 1007 {
1008 NotImplemented("llAttachToAvatar"); 1008 NotImplemented("llAttachToAvatar");
1009 } 1009 }
1010 1010
1011 public void llDetachFromAvatar() 1011 public void llDetachFromAvatar()
1012 { 1012 {
1013 NotImplemented("llDetachFromAvatar"); 1013 NotImplemented("llDetachFromAvatar");
1014 } 1014 }
1015 1015
1016 public void llTakeCamera() 1016 public void llTakeCamera()
1017 { 1017 {
1018 NotImplemented("llTakeCamera"); 1018 NotImplemented("llTakeCamera");
1019 } 1019 }
1020 1020
1021 public void llReleaseCamera() 1021 public void llReleaseCamera()
1022 { 1022 {
1023 NotImplemented("llReleaseCamera"); 1023 NotImplemented("llReleaseCamera");
1024 } 1024 }
1025 1025
1026 public string llGetOwner() 1026 public string llGetOwner()
1027 { 1027 {
1028 return m_host.ObjectOwner.ToString(); 1028 return m_host.ObjectOwner.ToString();
1029 } 1029 }
1030 1030
1031 public void llInstantMessage(string user, string message) 1031 public void llInstantMessage(string user, string message)
1032 { 1032 {
1033 NotImplemented("llInstantMessage"); 1033 NotImplemented("llInstantMessage");
1034 1034
1035 // We may be able to use ClientView.SendInstantMessage here, but we need a client instance. 1035 // We may be able to use ClientView.SendInstantMessage here, but we need a client instance.
1036 // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent, 1036 // InstantMessageModule.OnInstantMessage searches through a list of scenes for a client matching the toAgent,
1037 // but I don't think we have a list of scenes available from here. 1037 // but I don't think we have a list of scenes available from here.
1038 // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.) 1038 // (We also don't want to duplicate the code in OnInstantMessage if we can avoid it.)
1039 1039
1040 // TODO: figure out values for client, fromSession, and imSessionID 1040 // TODO: figure out values for client, fromSession, and imSessionID
1041 // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch()); 1041 // client.SendInstantMessage(m_host.UUID, fromSession, message, user, imSessionID, m_host.Name, AgentManager.InstantMessageDialog.MessageFromAgent, (uint)Util.UnixTimeSinceEpoch());
1042 } 1042 }
1043 1043
1044 public void llEmail(string address, string subject, string message) 1044 public void llEmail(string address, string subject, string message)
1045 { 1045 {
1046 NotImplemented("llEmail"); 1046 NotImplemented("llEmail");
1047 } 1047 }
1048 1048
1049 public void llGetNextEmail(string address, string subject) 1049 public void llGetNextEmail(string address, string subject)
1050 { 1050 {
1051 NotImplemented("llGetNextEmail"); 1051 NotImplemented("llGetNextEmail");
1052 } 1052 }
1053 1053
1054 public string llGetKey() 1054 public string llGetKey()
1055 { 1055 {
1056 return m_host.UUID.ToString(); 1056 return m_host.UUID.ToString();
1057 } 1057 }
1058 1058
1059 public void llSetBuoyancy(double buoyancy) 1059 public void llSetBuoyancy(double buoyancy)
1060 { 1060 {
1061 NotImplemented("llSetBuoyancy"); 1061 NotImplemented("llSetBuoyancy");
1062 } 1062 }
1063 1063
1064 public void llSetHoverHeight(double height, int water, double tau) 1064 public void llSetHoverHeight(double height, int water, double tau)
1065 { 1065 {
1066 NotImplemented("llSetHoverHeight"); 1066 NotImplemented("llSetHoverHeight");
1067 } 1067 }
1068 1068
1069 public void llStopHover() 1069 public void llStopHover()
1070 { 1070 {
1071 NotImplemented("llStopHover"); 1071 NotImplemented("llStopHover");
1072 } 1072 }
1073 1073
1074 public void llMinEventDelay(double delay) 1074 public void llMinEventDelay(double delay)
1075 { 1075 {
1076 NotImplemented("llMinEventDelay"); 1076 NotImplemented("llMinEventDelay");
1077 } 1077 }
1078 1078
1079 public void llSoundPreload() 1079 public void llSoundPreload()
1080 { 1080 {
1081 NotImplemented("llSoundPreload"); 1081 NotImplemented("llSoundPreload");
1082 } 1082 }
1083 1083
1084 public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping) 1084 public void llRotLookAt(LSL_Types.Quaternion target, double strength, double damping)
1085 { 1085 {
1086 NotImplemented("llRotLookAt"); 1086 NotImplemented("llRotLookAt");
1087 } 1087 }
1088 1088
1089 public int llStringLength(string str) 1089 public int llStringLength(string str)
1090 { 1090 {
1091 if (str.Length > 0) 1091 if (str.Length > 0)
1092 { 1092 {
1093 return str.Length; 1093 return str.Length;
1094 } 1094 }
1095 else 1095 else
1096 { 1096 {
1097 return 0; 1097 return 0;
1098 } 1098 }
1099 } 1099 }
1100 1100
1101 public void llStartAnimation(string anim) 1101 public void llStartAnimation(string anim)
1102 { 1102 {
1103 NotImplemented("llStartAnimation"); 1103 NotImplemented("llStartAnimation");
1104 } 1104 }
1105 1105
1106 public void llStopAnimation(string anim) 1106 public void llStopAnimation(string anim)
1107 { 1107 {
1108 NotImplemented("llStopAnimation"); 1108 NotImplemented("llStopAnimation");
1109 } 1109 }
1110 1110
1111 public void llPointAt() 1111 public void llPointAt()
1112 { 1112 {
1113 NotImplemented("llPointAt"); 1113 NotImplemented("llPointAt");
1114 } 1114 }
1115 1115
1116 public void llStopPointAt() 1116 public void llStopPointAt()
1117 { 1117 {
1118 NotImplemented("llStopPointAt"); 1118 NotImplemented("llStopPointAt");
1119 } 1119 }
1120 1120
1121 public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain) 1121 public void llTargetOmega(LSL_Types.Vector3 axis, double spinrate, double gain)
1122 { 1122 {
1123 m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 1123 m_host.RotationalVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
1124 m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate)); 1124 m_host.AngularVelocity = new LLVector3((float)(axis.x * spinrate), (float)(axis.y * spinrate), (float)(axis.z * spinrate));
1125 m_host.ScheduleTerseUpdate(); 1125 m_host.ScheduleTerseUpdate();
1126 m_host.SendTerseUpdateToAllClients(); 1126 m_host.SendTerseUpdateToAllClients();
1127 //NotImplemented("llTargetOmega"); 1127 //NotImplemented("llTargetOmega");
1128 } 1128 }
1129 1129
1130 public int llGetStartParameter() 1130 public int llGetStartParameter()
1131 { 1131 {
1132 NotImplemented("llGetStartParameter"); 1132 NotImplemented("llGetStartParameter");
1133 return 0; 1133 return 0;
1134 } 1134 }
1135 1135
1136 public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos) 1136 public void llGodLikeRezObject(string inventory, LSL_Types.Vector3 pos)
1137 { 1137 {
1138 NotImplemented("llGodLikeRezObject"); 1138 NotImplemented("llGodLikeRezObject");
1139 } 1139 }
1140 1140
1141 public void llRequestPermissions(string agent, int perm) 1141 public void llRequestPermissions(string agent, int perm)
1142 { 1142 {
1143 NotImplemented("llRequestPermissions"); 1143 NotImplemented("llRequestPermissions");
1144 } 1144 }
1145 1145
1146 public string llGetPermissionsKey() 1146 public string llGetPermissionsKey()
1147 { 1147 {
1148 NotImplemented("llGetPermissionsKey"); 1148 NotImplemented("llGetPermissionsKey");
1149 return ""; 1149 return "";
1150 } 1150 }
1151 1151
1152 public int llGetPermissions() 1152 public int llGetPermissions()
1153 { 1153 {
1154 NotImplemented("llGetPermissions"); 1154 NotImplemented("llGetPermissions");
1155 return 0; 1155 return 0;
1156 } 1156 }
1157 1157
1158 public int llGetLinkNumber() 1158 public int llGetLinkNumber()
1159 { 1159 {
1160 return m_host.LinkNum; 1160 return m_host.LinkNum;
1161 } 1161 }
1162 1162
1163 public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face) 1163 public void llSetLinkColor(int linknumber, LSL_Types.Vector3 color, int face)
1164 { 1164 {
1165 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); 1165 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber);
1166 if (linknumber > -1) 1166 if (linknumber > -1)
1167 { 1167 {
1168 LLObject.TextureEntry tex = part.Shape.Textures; 1168 LLObject.TextureEntry tex = part.Shape.Textures;
1169 LLColor texcolor; 1169 LLColor texcolor;
1170 if (face > -1) 1170 if (face > -1)
1171 { 1171 {
1172 texcolor = tex.CreateFace((uint)face).RGBA; 1172 texcolor = tex.CreateFace((uint)face).RGBA;
1173 texcolor.R = (float)Math.Abs(color.x - 1); 1173 texcolor.R = (float)Math.Abs(color.x - 1);
1174 texcolor.G = (float)Math.Abs(color.y - 1); 1174 texcolor.G = (float)Math.Abs(color.y - 1);
1175 texcolor.B = (float)Math.Abs(color.z - 1); 1175 texcolor.B = (float)Math.Abs(color.z - 1);
1176 tex.FaceTextures[face].RGBA = texcolor; 1176 tex.FaceTextures[face].RGBA = texcolor;
1177 part.UpdateTexture(tex); 1177 part.UpdateTexture(tex);
1178 return; 1178 return;
1179 } 1179 }
1180 else if (face == -1) 1180 else if (face == -1)
1181 { 1181 {
1182 texcolor = tex.DefaultTexture.RGBA; 1182 texcolor = tex.DefaultTexture.RGBA;
1183 texcolor.R = (float)Math.Abs(color.x - 1); 1183 texcolor.R = (float)Math.Abs(color.x - 1);
1184 texcolor.G = (float)Math.Abs(color.y - 1); 1184 texcolor.G = (float)Math.Abs(color.y - 1);
1185 texcolor.B = (float)Math.Abs(color.z - 1); 1185 texcolor.B = (float)Math.Abs(color.z - 1);
1186 tex.DefaultTexture.RGBA = texcolor; 1186 tex.DefaultTexture.RGBA = texcolor;
1187 for (uint i = 0; i < 32; i++) 1187 for (uint i = 0; i < 32; i++)
1188 { 1188 {
1189 if (tex.FaceTextures[i] != null) 1189 if (tex.FaceTextures[i] != null)
1190 { 1190 {
1191 texcolor = tex.FaceTextures[i].RGBA; 1191 texcolor = tex.FaceTextures[i].RGBA;
1192 texcolor.R = (float)Math.Abs(color.x - 1); 1192 texcolor.R = (float)Math.Abs(color.x - 1);
1193 texcolor.G = (float)Math.Abs(color.y - 1); 1193 texcolor.G = (float)Math.Abs(color.y - 1);
1194 texcolor.B = (float)Math.Abs(color.z - 1); 1194 texcolor.B = (float)Math.Abs(color.z - 1);
1195 tex.FaceTextures[i].RGBA = texcolor; 1195 tex.FaceTextures[i].RGBA = texcolor;
1196 } 1196 }
1197 } 1197 }
1198 texcolor = tex.DefaultTexture.RGBA; 1198 texcolor = tex.DefaultTexture.RGBA;
1199 texcolor.R = (float)Math.Abs(color.x - 1); 1199 texcolor.R = (float)Math.Abs(color.x - 1);
1200 texcolor.G = (float)Math.Abs(color.y - 1); 1200 texcolor.G = (float)Math.Abs(color.y - 1);
1201 texcolor.B = (float)Math.Abs(color.z - 1); 1201 texcolor.B = (float)Math.Abs(color.z - 1);
1202 tex.DefaultTexture.RGBA = texcolor; 1202 tex.DefaultTexture.RGBA = texcolor;
1203 part.UpdateTexture(tex); 1203 part.UpdateTexture(tex);
1204 return; 1204 return;
1205 } 1205 }
1206 return; 1206 return;
1207 } 1207 }
1208 else if (linknumber == -1) 1208 else if (linknumber == -1)
1209 { 1209 {
1210 int num = m_host.ParentGroup.PrimCount; 1210 int num = m_host.ParentGroup.PrimCount;
1211 for (int w = 0; w < num; w++) 1211 for (int w = 0; w < num; w++)
1212 { 1212 {
1213 linknumber = w; 1213 linknumber = w;
1214 part = m_host.ParentGroup.GetLinkNumPart(linknumber); 1214 part = m_host.ParentGroup.GetLinkNumPart(linknumber);
1215 LLObject.TextureEntry tex = part.Shape.Textures; 1215 LLObject.TextureEntry tex = part.Shape.Textures;
1216 LLColor texcolor; 1216 LLColor texcolor;
1217 if (face > -1) 1217 if (face > -1)
1218 { 1218 {
1219 texcolor = tex.CreateFace((uint)face).RGBA; 1219 texcolor = tex.CreateFace((uint)face).RGBA;
1220 texcolor.R = (float)Math.Abs(color.x - 1); 1220 texcolor.R = (float)Math.Abs(color.x - 1);
1221 texcolor.G = (float)Math.Abs(color.y - 1); 1221 texcolor.G = (float)Math.Abs(color.y - 1);
1222 texcolor.B = (float)Math.Abs(color.z - 1); 1222 texcolor.B = (float)Math.Abs(color.z - 1);
1223 tex.FaceTextures[face].RGBA = texcolor; 1223 tex.FaceTextures[face].RGBA = texcolor;
1224 part.UpdateTexture(tex); 1224 part.UpdateTexture(tex);
1225 } 1225 }
1226 else if (face == -1) 1226 else if (face == -1)
1227 { 1227 {
1228 texcolor = tex.DefaultTexture.RGBA; 1228 texcolor = tex.DefaultTexture.RGBA;
1229 texcolor.R = (float)Math.Abs(color.x - 1); 1229 texcolor.R = (float)Math.Abs(color.x - 1);
1230 texcolor.G = (float)Math.Abs(color.y - 1); 1230 texcolor.G = (float)Math.Abs(color.y - 1);
1231 texcolor.B = (float)Math.Abs(color.z - 1); 1231 texcolor.B = (float)Math.Abs(color.z - 1);
1232 tex.DefaultTexture.RGBA = texcolor; 1232 tex.DefaultTexture.RGBA = texcolor;
1233 for (uint i = 0; i < 32; i++) 1233 for (uint i = 0; i < 32; i++)
1234 { 1234 {
1235 if (tex.FaceTextures[i] != null) 1235 if (tex.FaceTextures[i] != null)
1236 { 1236 {
1237 texcolor = tex.FaceTextures[i].RGBA; 1237 texcolor = tex.FaceTextures[i].RGBA;
1238 texcolor.R = (float)Math.Abs(color.x - 1); 1238 texcolor.R = (float)Math.Abs(color.x - 1);
1239 texcolor.G = (float)Math.Abs(color.y - 1); 1239 texcolor.G = (float)Math.Abs(color.y - 1);
1240 texcolor.B = (float)Math.Abs(color.z - 1); 1240 texcolor.B = (float)Math.Abs(color.z - 1);
1241 tex.FaceTextures[i].RGBA = texcolor; 1241 tex.FaceTextures[i].RGBA = texcolor;
1242 } 1242 }
1243 } 1243 }
1244 texcolor = tex.DefaultTexture.RGBA; 1244 texcolor = tex.DefaultTexture.RGBA;
1245 texcolor.R = (float)Math.Abs(color.x - 1); 1245 texcolor.R = (float)Math.Abs(color.x - 1);
1246 texcolor.G = (float)Math.Abs(color.y - 1); 1246 texcolor.G = (float)Math.Abs(color.y - 1);
1247 texcolor.B = (float)Math.Abs(color.z - 1); 1247 texcolor.B = (float)Math.Abs(color.z - 1);
1248 tex.DefaultTexture.RGBA = texcolor; 1248 tex.DefaultTexture.RGBA = texcolor;
1249 part.UpdateTexture(tex); 1249 part.UpdateTexture(tex);
1250 } 1250 }
1251 } 1251 }
1252 return; 1252 return;
1253 } 1253 }
1254 else 1254 else
1255 { 1255 {
1256 NotImplemented("llSetLinkColor"); 1256 NotImplemented("llSetLinkColor");
1257 } 1257 }
1258 } 1258 }
1259 1259
1260 public void llCreateLink(string target, int parent) 1260 public void llCreateLink(string target, int parent)
1261 { 1261 {
1262 NotImplemented("llCreateLink"); 1262 NotImplemented("llCreateLink");
1263 } 1263 }
1264 1264
1265 public void llBreakLink(int linknum) 1265 public void llBreakLink(int linknum)
1266 { 1266 {
1267 NotImplemented("llBreakLink"); 1267 NotImplemented("llBreakLink");
1268 } 1268 }
1269 1269
1270 public void llBreakAllLinks() 1270 public void llBreakAllLinks()
1271 { 1271 {
1272 NotImplemented("llBreakAllLinks"); 1272 NotImplemented("llBreakAllLinks");
1273 } 1273 }
1274 1274
1275 public string llGetLinkKey(int linknum) 1275 public string llGetLinkKey(int linknum)
1276 { 1276 {
1277 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); 1277 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum);
1278 if (part != null) 1278 if (part != null)
1279 { 1279 {
1280 return part.UUID.ToString(); 1280 return part.UUID.ToString();
1281 } 1281 }
1282 else 1282 else
1283 { 1283 {
1284 return "00000000-0000-0000-0000-000000000000"; 1284 return "00000000-0000-0000-0000-000000000000";
1285 } 1285 }
1286 } 1286 }
1287 1287
1288 public string llGetLinkName(int linknum) 1288 public string llGetLinkName(int linknum)
1289 { 1289 {
1290 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum); 1290 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknum);
1291 if (part != null) 1291 if (part != null)
1292 { 1292 {
1293 return part.Name; 1293 return part.Name;
1294 } 1294 }
1295 else 1295 else
1296 { 1296 {
1297 return "00000000-0000-0000-0000-000000000000"; 1297 return "00000000-0000-0000-0000-000000000000";
1298 } 1298 }
1299 } 1299 }
1300 1300
1301 public int llGetInventoryNumber(int type) 1301 public int llGetInventoryNumber(int type)
1302 { 1302 {
1303 NotImplemented("llGetInventoryNumber"); 1303 NotImplemented("llGetInventoryNumber");
1304 return 0; 1304 return 0;
1305 } 1305 }
1306 1306
1307 public string llGetInventoryName(int type, int number) 1307 public string llGetInventoryName(int type, int number)
1308 { 1308 {
1309 NotImplemented("llGetInventoryName"); 1309 NotImplemented("llGetInventoryName");
1310 return ""; 1310 return "";
1311 } 1311 }
1312 1312
1313 public void llSetScriptState(string name, int run) 1313 public void llSetScriptState(string name, int run)
1314 { 1314 {
1315 NotImplemented("llSetScriptState"); 1315 NotImplemented("llSetScriptState");
1316 } 1316 }
1317 1317
1318 public double llGetEnergy() 1318 public double llGetEnergy()
1319 { 1319 {
1320 return 1.0f; 1320 return 1.0f;
1321 } 1321 }
1322 1322
1323 public void llGiveInventory(string destination, string inventory) 1323 public void llGiveInventory(string destination, string inventory)
1324 { 1324 {
1325 NotImplemented("llGiveInventory"); 1325 NotImplemented("llGiveInventory");
1326 } 1326 }
1327 1327
1328 public void llRemoveInventory(string item) 1328 public void llRemoveInventory(string item)
1329 { 1329 {
1330 NotImplemented("llRemoveInventory"); 1330 NotImplemented("llRemoveInventory");
1331 } 1331 }
1332 1332
1333 public void llSetText(string text, LSL_Types.Vector3 color, double alpha) 1333 public void llSetText(string text, LSL_Types.Vector3 color, double alpha)
1334 { 1334 {
1335 Vector3 av3 = new Vector3((float)color.x, (float)color.y, (float)color.z); 1335 Vector3 av3 = new Vector3((float)color.x, (float)color.y, (float)color.z);
1336 m_host.SetText(text, av3, alpha); 1336 m_host.SetText(text, av3, alpha);
1337 } 1337 }
1338 1338
1339 public double llWater(LSL_Types.Vector3 offset) 1339 public double llWater(LSL_Types.Vector3 offset)
1340 { 1340 {
1341 return World.RegionInfo.EstateSettings.waterHeight; 1341 return World.RegionInfo.EstateSettings.waterHeight;
1342 } 1342 }
1343 1343
1344 public void llPassTouches(int pass) 1344 public void llPassTouches(int pass)
1345 { 1345 {
1346 NotImplemented("llPassTouches"); 1346 NotImplemented("llPassTouches");
1347 } 1347 }
1348 1348
1349 public string llRequestAgentData(string id, int data) 1349 public string llRequestAgentData(string id, int data)
1350 { 1350 {
1351 NotImplemented("llRequestAgentData"); 1351 NotImplemented("llRequestAgentData");
1352 return ""; 1352 return "";
1353 } 1353 }
1354 1354
1355 public string llRequestInventoryData(string name) 1355 public string llRequestInventoryData(string name)
1356 { 1356 {
1357 NotImplemented("llRequestInventoryData"); 1357 NotImplemented("llRequestInventoryData");
1358 return ""; 1358 return "";
1359 } 1359 }
1360 1360
1361 public void llSetDamage(double damage) 1361 public void llSetDamage(double damage)
1362 { 1362 {
1363 NotImplemented("llSetDamage"); 1363 NotImplemented("llSetDamage");
1364 } 1364 }
1365 1365
1366 public void llTeleportAgentHome(string agent) 1366 public void llTeleportAgentHome(string agent)
1367 { 1367 {
1368 NotImplemented("llTeleportAgentHome"); 1368 NotImplemented("llTeleportAgentHome");
1369 } 1369 }
1370 1370
1371 public void llModifyLand(int action, int brush) 1371 public void llModifyLand(int action, int brush)
1372 { 1372 {
1373 double dsize; 1373 double dsize;
1374 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0))) 1374 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, 0)))
1375 { 1375 {
1376 switch (brush) 1376 switch (brush)
1377 { 1377 {
1378 case 1: 1378 case 1:
1379 dsize = 2; 1379 dsize = 2;
1380 break; 1380 break;
1381 case 2: 1381 case 2:
1382 dsize = 4; 1382 dsize = 4;
1383 break; 1383 break;
1384 case 3: 1384 case 3:
1385 dsize = 8; 1385 dsize = 8;
1386 break; 1386 break;
1387 default: 1387 default:
1388 if (brush < 0) 1388 if (brush < 0)
1389 { 1389 {
1390 dsize = (double)(-1 * brush); 1390 dsize = (double)(-1 * brush);
1391 } 1391 }
1392 else 1392 else
1393 { 1393 {
1394 LSLError("Invalid brush size"); 1394 LSLError("Invalid brush size");
1395 dsize = 0; // Should cease execution, but get unassigned local variable dsize on compile. 1395 dsize = 0; // Should cease execution, but get unassigned local variable dsize on compile.
1396 } 1396 }
1397 break; 1397 break;
1398 } 1398 }
1399 switch (action) 1399 switch (action)
1400 { 1400 {
1401 case 0: 1401 case 0:
1402 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < m_host.AbsolutePosition.Z) 1402 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < m_host.AbsolutePosition.Z)
1403 { 1403 {
1404 World.Terrain.FlattenTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1404 World.Terrain.FlattenTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1405 } 1405 }
1406 break; 1406 break;
1407 case 1: 1407 case 1:
1408 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < (double)m_host.AbsolutePosition.Z) 1408 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) < (double)m_host.AbsolutePosition.Z)
1409 { 1409 {
1410 World.Terrain.RaiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 0.1); 1410 World.Terrain.RaiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 0.1);
1411 } 1411 }
1412 break; 1412 break;
1413 case 2: 1413 case 2:
1414 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) > 0) 1414 if (World.Terrain.GetHeight((int)m_host.AbsolutePosition.X, (int)m_host.AbsolutePosition.Y) > 0)
1415 { 1415 {
1416 World.Terrain.LowerTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1416 World.Terrain.LowerTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1417 } 1417 }
1418 break; 1418 break;
1419 case 3: 1419 case 3:
1420 World.Terrain.SmoothTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1420 World.Terrain.SmoothTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1421 break; 1421 break;
1422 case 4: 1422 case 4:
1423 World.Terrain.NoiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1423 World.Terrain.NoiseTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1424 break; 1424 break;
1425 case 5: 1425 case 5:
1426 World.Terrain.RevertTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1); 1426 World.Terrain.RevertTerrain(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, dsize, 1);
1427 break; 1427 break;
1428 default: 1428 default:
1429 break; 1429 break;
1430 } 1430 }
1431 } 1431 }
1432 } 1432 }
1433 1433
1434 public void llCollisionSound(string impact_sound, double impact_volume) 1434 public void llCollisionSound(string impact_sound, double impact_volume)
1435 { 1435 {
1436 NotImplemented("llCollisionSound"); 1436 NotImplemented("llCollisionSound");
1437 } 1437 }
1438 1438
1439 public void llCollisionSprite(string impact_sprite) 1439 public void llCollisionSprite(string impact_sprite)
1440 { 1440 {
1441 NotImplemented("llCollisionSprite"); 1441 NotImplemented("llCollisionSprite");
1442 } 1442 }
1443 1443
1444 public string llGetAnimation(string id) 1444 public string llGetAnimation(string id)
1445 { 1445 {
1446 NotImplemented("llGetAnimation"); 1446 NotImplemented("llGetAnimation");
1447 return ""; 1447 return "";
1448 } 1448 }
1449 1449
1450 public void llResetScript() 1450 public void llResetScript()
1451 { 1451 {
1452 m_ScriptEngine.m_ScriptManager.ResetScript(m_localID, m_itemID); 1452 m_ScriptEngine.m_ScriptManager.ResetScript(m_localID, m_itemID);
1453 } 1453 }
1454 1454
1455 public void llMessageLinked(int linknum, int num, string str, string id) 1455 public void llMessageLinked(int linknum, int num, string str, string id)
1456 { 1456 {
1457 } 1457 }
1458 1458
1459 public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) 1459 public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local)
1460 { 1460 {
1461 } 1461 }
1462 1462
1463 public void llPassCollisions(int pass) 1463 public void llPassCollisions(int pass)
1464 { 1464 {
1465 } 1465 }
1466 1466
1467 public string llGetScriptName() 1467 public string llGetScriptName()
1468 { 1468 {
1469 return ""; 1469 return "";
1470 } 1470 }
1471 1471
1472 public int llGetNumberOfSides() 1472 public int llGetNumberOfSides()
1473 { 1473 {
1474 return 0; 1474 return 0;
1475 } 1475 }
1476 1476
1477 public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle) 1477 public LSL_Types.Quaternion llAxisAngle2Rot(LSL_Types.Vector3 axis, double angle)
1478 { 1478 {
1479 return new LSL_Types.Quaternion(); 1479 return new LSL_Types.Quaternion();
1480 } 1480 }
1481 1481
1482 public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot) 1482 public LSL_Types.Vector3 llRot2Axis(LSL_Types.Quaternion rot)
1483 { 1483 {
1484 return new LSL_Types.Vector3(); 1484 return new LSL_Types.Vector3();
1485 } 1485 }
1486 1486
1487 public void llRot2Angle() 1487 public void llRot2Angle()
1488 { 1488 {
1489 } 1489 }
1490 1490
1491 public double llAcos(double val) 1491 public double llAcos(double val)
1492 { 1492 {
1493 return (double)Math.Acos(val); 1493 return (double)Math.Acos(val);
1494 } 1494 }
1495 1495
1496 public double llAsin(double val) 1496 public double llAsin(double val)
1497 { 1497 {
1498 return (double)Math.Asin(val); 1498 return (double)Math.Asin(val);
1499 } 1499 }
1500 1500
1501 public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b) 1501 public double llAngleBetween(LSL_Types.Quaternion a, LSL_Types.Quaternion b)
1502 { 1502 {
1503 return 0; 1503 return 0;
1504 } 1504 }
1505 1505
1506 public string llGetInventoryKey(string name) 1506 public string llGetInventoryKey(string name)
1507 { 1507 {
1508 return ""; 1508 return "";
1509 } 1509 }
1510 1510
1511 public void llAllowInventoryDrop(int add) 1511 public void llAllowInventoryDrop(int add)
1512 { 1512 {
1513 } 1513 }
1514 1514
1515 public LSL_Types.Vector3 llGetSunDirection() 1515 public LSL_Types.Vector3 llGetSunDirection()
1516 { 1516 {
1517 return new LSL_Types.Vector3(); 1517 return new LSL_Types.Vector3();
1518 } 1518 }
1519 1519
1520 public LSL_Types.Vector3 llGetTextureOffset(int face) 1520 public LSL_Types.Vector3 llGetTextureOffset(int face)
1521 { 1521 {
1522 LLObject.TextureEntry tex = m_host.Shape.Textures; 1522 LLObject.TextureEntry tex = m_host.Shape.Textures;
1523 LSL_Types.Vector3 offset; 1523 LSL_Types.Vector3 offset;
1524 if (face == -1) 1524 if (face == -1)
1525 { 1525 {
1526 face = 0; 1526 face = 0;
1527 } 1527 }
1528 offset.x = tex.GetFace((uint)face).OffsetU; 1528 offset.x = tex.GetFace((uint)face).OffsetU;
1529 offset.y = tex.GetFace((uint)face).OffsetV; 1529 offset.y = tex.GetFace((uint)face).OffsetV;
1530 offset.z = 0.0; 1530 offset.z = 0.0;
1531 return offset; 1531 return offset;
1532 } 1532 }
1533 1533
1534 public LSL_Types.Vector3 llGetTextureScale(int side) 1534 public LSL_Types.Vector3 llGetTextureScale(int side)
1535 { 1535 {
1536 LLObject.TextureEntry tex = m_host.Shape.Textures; 1536 LLObject.TextureEntry tex = m_host.Shape.Textures;
1537 LSL_Types.Vector3 scale; 1537 LSL_Types.Vector3 scale;
1538 if (side == -1) 1538 if (side == -1)
1539 { 1539 {
1540 side = 0; 1540 side = 0;
1541 } 1541 }
1542 scale.x = tex.GetFace((uint)side).RepeatU; 1542 scale.x = tex.GetFace((uint)side).RepeatU;
1543 scale.y = tex.GetFace((uint)side).RepeatV; 1543 scale.y = tex.GetFace((uint)side).RepeatV;
1544 scale.z = 0.0; 1544 scale.z = 0.0;
1545 return scale; 1545 return scale;
1546 } 1546 }
1547 1547
1548 public double llGetTextureRot(int face) 1548 public double llGetTextureRot(int face)
1549 { 1549 {
1550 LLObject.TextureEntry tex = m_host.Shape.Textures; 1550 LLObject.TextureEntry tex = m_host.Shape.Textures;
1551 if (face == -1) 1551 if (face == -1)
1552 { 1552 {
1553 face = 0; 1553 face = 0;
1554 } 1554 }
1555 return tex.GetFace((uint)face).Rotation; 1555 return tex.GetFace((uint)face).Rotation;
1556 } 1556 }
1557 1557
1558 public int llSubStringIndex(string source, string pattern) 1558 public int llSubStringIndex(string source, string pattern)
1559 { 1559 {
1560 return source.IndexOf(pattern); 1560 return source.IndexOf(pattern);
1561 } 1561 }
1562 1562
1563 public string llGetOwnerKey(string id) 1563 public string llGetOwnerKey(string id)
1564 { 1564 {
1565 NotImplemented("llGetOwnerKey"); 1565 NotImplemented("llGetOwnerKey");
1566 return ""; 1566 return "";
1567 } 1567 }
1568 1568
1569 public LSL_Types.Vector3 llGetCenterOfMass() 1569 public LSL_Types.Vector3 llGetCenterOfMass()
1570 { 1570 {
1571 NotImplemented("llGetCenterOfMass"); 1571 NotImplemented("llGetCenterOfMass");
1572 return new LSL_Types.Vector3(); 1572 return new LSL_Types.Vector3();
1573 } 1573 }
1574 1574
1575 public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending) 1575 public LSL_Types.list llListSort(LSL_Types.list src, int stride, int ascending)
1576 { 1576 {
1577 // SortedList<string, LSL_Types.list> sorted = new SortedList<string, LSL_Types.list>(); 1577 // SortedList<string, LSL_Types.list> sorted = new SortedList<string, LSL_Types.list>();
1578 // Add chunks to an array 1578 // Add chunks to an array
1579 //int s = stride; 1579 //int s = stride;
1580 //if (s < 1) 1580 //if (s < 1)
1581 // s = 1; 1581 // s = 1;
1582 //int c = 0; 1582 //int c = 0;
1583 //LSL_Types.list chunk = new LSL_Types.list(); 1583 //LSL_Types.list chunk = new LSL_Types.list();
1584 //string chunkString = ""; 1584 //string chunkString = "";
1585 //foreach (string element in src) 1585 //foreach (string element in src)
1586 //{ 1586 //{
1587 // c++; 1587 // c++;
1588 // if (c > s) 1588 // if (c > s)
1589 // { 1589 // {
1590 // sorted.Add(chunkString, chunk); 1590 // sorted.Add(chunkString, chunk);
1591 // chunkString = ""; 1591 // chunkString = "";
1592 // chunk = new LSL_Types.list(); 1592 // chunk = new LSL_Types.list();
1593 // c = 0; 1593 // c = 0;
1594 // } 1594 // }
1595 // chunk.Add(element); 1595 // chunk.Add(element);
1596 // chunkString += element.ToString(); 1596 // chunkString += element.ToString();
1597 //} 1597 //}
1598 //if (chunk.Count > 0) 1598 //if (chunk.Count > 0)
1599 // sorted.Add(chunkString, chunk); 1599 // sorted.Add(chunkString, chunk);
1600 1600
1601 //LSL_Types.list ret = new LSL_Types.list(); 1601 //LSL_Types.list ret = new LSL_Types.list();
1602 //foreach (LSL_Types.list ls in sorted.Values) 1602 //foreach (LSL_Types.list ls in sorted.Values)
1603 //{ 1603 //{
1604 // ret.AddRange(ls); 1604 // ret.AddRange(ls);
1605 //} 1605 //}
1606 1606
1607 //if (ascending == LSL_BaseClass.TRUE) 1607 //if (ascending == LSL_BaseClass.TRUE)
1608 // return ret; 1608 // return ret;
1609 //ret.Reverse(); 1609 //ret.Reverse();
1610 //return ret; 1610 //return ret;
1611 NotImplemented("llListSort"); 1611 NotImplemented("llListSort");
1612 return new LSL_Types.list(); 1612 return new LSL_Types.list();
1613 } 1613 }
1614 1614
1615 public int llGetListLength(LSL_Types.list src) 1615 public int llGetListLength(LSL_Types.list src)
1616 { 1616 {
1617 return src.Length; 1617 return src.Length;
1618 } 1618 }
1619 1619
1620 public int llList2Integer(LSL_Types.list src, int index) 1620 public int llList2Integer(LSL_Types.list src, int index)
1621 { 1621 {
1622 if (index < 0) 1622 if (index < 0)
1623 { 1623 {
1624 index = src.Length + index; 1624 index = src.Length + index;
1625 } 1625 }
1626 if (index >= src.Length) 1626 if (index >= src.Length)
1627 { 1627 {
1628 return 0; 1628 return 0;
1629 } 1629 }
1630 return Convert.ToInt32(src.Data[index]); 1630 return Convert.ToInt32(src.Data[index]);
1631 } 1631 }
1632 1632
1633 public double osList2Double(LSL_Types.list src, int index) 1633 public double osList2Double(LSL_Types.list src, int index)
1634 { 1634 {
1635 if (index < 0) 1635 if (index < 0)
1636 { 1636 {
1637 index = src.Length + index; 1637 index = src.Length + index;
1638 } 1638 }
1639 if (index >= src.Length) 1639 if (index >= src.Length)
1640 { 1640 {
1641 return 0.0; 1641 return 0.0;
1642 } 1642 }
1643 return Convert.ToDouble(src.Data[index]); 1643 return Convert.ToDouble(src.Data[index]);
1644 } 1644 }
1645 1645
1646 public double llList2Float(LSL_Types.list src, int index) 1646 public double llList2Float(LSL_Types.list src, int index)
1647 { 1647 {
1648 if (index < 0) 1648 if (index < 0)
1649 { 1649 {
1650 index = src.Length + index; 1650 index = src.Length + index;
1651 } 1651 }
1652 if (index >= src.Length) 1652 if (index >= src.Length)
1653 { 1653 {
1654 return 0.0; 1654 return 0.0;
1655 } 1655 }
1656 return Convert.ToSingle(src.Data[index]); 1656 return Convert.ToSingle(src.Data[index]);
1657 } 1657 }
1658 1658
1659 public string llList2String(LSL_Types.list src, int index) 1659 public string llList2String(LSL_Types.list src, int index)
1660 { 1660 {
1661 if (index < 0) 1661 if (index < 0)
1662 { 1662 {
1663 index = src.Length + index; 1663 index = src.Length + index;
1664 } 1664 }
1665 if (index >= src.Length) 1665 if (index >= src.Length)
1666 { 1666 {
1667 return ""; 1667 return "";
1668 } 1668 }
1669 return src.Data[index].ToString(); 1669 return src.Data[index].ToString();
1670 } 1670 }
1671 1671
1672 public string llList2Key(LSL_Types.list src, int index) 1672 public string llList2Key(LSL_Types.list src, int index)
1673 { 1673 {
1674 if (index < 0) 1674 if (index < 0)
1675 { 1675 {
1676 index = src.Length + index; 1676 index = src.Length + index;
1677 } 1677 }
1678 if (index >= src.Length) 1678 if (index >= src.Length)
1679 { 1679 {
1680 return "00000000-0000-0000-0000-000000000000"; 1680 return "00000000-0000-0000-0000-000000000000";
1681 } 1681 }
1682 //return OpenSim.Framework.ToString(src[index]); 1682 //return OpenSim.Framework.ToString(src[index]);
1683 LLUUID tmpkey; 1683 LLUUID tmpkey;
1684 if (LLUUID.TryParse(src.Data[index].ToString(), out tmpkey)) 1684 if (LLUUID.TryParse(src.Data[index].ToString(), out tmpkey))
1685 { 1685 {
1686 return tmpkey.ToString(); 1686 return tmpkey.ToString();
1687 } 1687 }
1688 else 1688 else
1689 { 1689 {
1690 return "00000000-0000-0000-0000-000000000000"; 1690 return "00000000-0000-0000-0000-000000000000";
1691 } 1691 }
1692 } 1692 }
1693 1693
1694 public LSL_Types.Vector3 llList2Vector(LSL_Types.list src, int index) 1694 public LSL_Types.Vector3 llList2Vector(LSL_Types.list src, int index)
1695 { 1695 {
1696 if (index < 0) 1696 if (index < 0)
1697 { 1697 {
1698 index = src.Length + index; 1698 index = src.Length + index;
1699 } 1699 }
1700 if (index >= src.Length) 1700 if (index >= src.Length)
1701 { 1701 {
1702 return new LSL_Types.Vector3(0, 0, 0); 1702 return new LSL_Types.Vector3(0, 0, 0);
1703 } 1703 }
1704 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3)) 1704 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3))
1705 { 1705 {
1706 return (LSL_Types.Vector3)src.Data[index]; 1706 return (LSL_Types.Vector3)src.Data[index];
1707 } 1707 }
1708 else 1708 else
1709 { 1709 {
1710 return new LSL_Types.Vector3(0, 0, 0); 1710 return new LSL_Types.Vector3(0, 0, 0);
1711 } 1711 }
1712 } 1712 }
1713 1713
1714 public LSL_Types.Quaternion llList2Rot(LSL_Types.list src, int index) 1714 public LSL_Types.Quaternion llList2Rot(LSL_Types.list src, int index)
1715 { 1715 {
1716 if (index < 0) 1716 if (index < 0)
1717 { 1717 {
1718 index = src.Length + index; 1718 index = src.Length + index;
1719 } 1719 }
1720 if (index >= src.Length) 1720 if (index >= src.Length)
1721 { 1721 {
1722 return new LSL_Types.Quaternion(0, 0, 0, 1); 1722 return new LSL_Types.Quaternion(0, 0, 0, 1);
1723 } 1723 }
1724 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion)) 1724 if (src.Data[index].GetType() == typeof(OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion))
1725 { 1725 {
1726 return (LSL_Types.Quaternion)src.Data[index]; 1726 return (LSL_Types.Quaternion)src.Data[index];
1727 } 1727 }
1728 else 1728 else
1729 { 1729 {
1730 return new LSL_Types.Quaternion(0, 0, 0, 1); 1730 return new LSL_Types.Quaternion(0, 0, 0, 1);
1731 } 1731 }
1732 } 1732 }
1733 1733
1734 public LSL_Types.list llList2List(LSL_Types.list src, int start, int end) 1734 public LSL_Types.list llList2List(LSL_Types.list src, int start, int end)
1735 { 1735 {
1736 return src.GetSublist(start, end); 1736 return src.GetSublist(start, end);
1737 } 1737 }
1738 1738
1739 public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end) 1739 public LSL_Types.list llDeleteSubList(LSL_Types.list src, int start, int end)
1740 { 1740 {
1741 //LSL_Types.list ret = new LSL_Types.list(src); 1741 //LSL_Types.list ret = new LSL_Types.list(src);
1742 //ret.RemoveRange(start, end - start); 1742 //ret.RemoveRange(start, end - start);
1743 //return ret; 1743 //return ret;
1744 1744
1745 // Just a hunch - needs testing 1745 // Just a hunch - needs testing
1746 return src.GetSublist(end, start); 1746 return src.GetSublist(end, start);
1747 } 1747 }
1748 1748
1749 public int llGetListEntryType(LSL_Types.list src, int index) 1749 public int llGetListEntryType(LSL_Types.list src, int index)
1750 { 1750 {
1751 if (index < 0) 1751 if (index < 0)
1752 { 1752 {
1753 index = src.Length + index; 1753 index = src.Length + index;
1754 } 1754 }
1755 if (index >= src.Length) 1755 if (index >= src.Length)
1756 { 1756 {
1757 return 0; 1757 return 0;
1758 } 1758 }
1759 1759
1760 if (src.Data[index] is System.Int32) 1760 if (src.Data[index] is System.Int32)
1761 return 1; 1761 return 1;
1762 if (src.Data[index] is System.Double) 1762 if (src.Data[index] is System.Double)
1763 return 2; 1763 return 2;
1764 if (src.Data[index] is System.String) 1764 if (src.Data[index] is System.String)
1765 { 1765 {
1766 LLUUID tuuid; 1766 LLUUID tuuid;
1767 if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid)) 1767 if (LLUUID.TryParse(src.Data[index].ToString(), out tuuid))
1768 { 1768 {
1769 return 3; 1769 return 3;
1770 } 1770 }
1771 else 1771 else
1772 { 1772 {
1773 return 4; 1773 return 4;
1774 } 1774 }
1775 } 1775 }
1776 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3) 1776 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Vector3)
1777 return 5; 1777 return 5;
1778 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion) 1778 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.Quaternion)
1779 return 6; 1779 return 6;
1780 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.list) 1780 if (src.Data[index] is OpenSim.Region.ScriptEngine.Common.LSL_Types.list)
1781 return 7; 1781 return 7;
1782 return 0; 1782 return 0;
1783 1783
1784 } 1784 }
1785 1785
1786 public string llList2CSV(LSL_Types.list src) 1786 public string llList2CSV(LSL_Types.list src)
1787 { 1787 {
1788 string ret = ""; 1788 string ret = "";
1789 foreach (object o in src.Data) 1789 foreach (object o in src.Data)
1790 { 1790 {
1791 ret = ret + o.ToString() + ","; 1791 ret = ret + o.ToString() + ",";
1792 } 1792 }
1793 ret = ret.Substring(0, ret.Length - 2); 1793 ret = ret.Substring(0, ret.Length - 2);
1794 return ret; 1794 return ret;
1795 } 1795 }
1796 1796
1797 public LSL_Types.list llCSV2List(string src) 1797 public LSL_Types.list llCSV2List(string src)
1798 { 1798 {
1799 return new LSL_Types.list(src.Split(",".ToCharArray())); 1799 return new LSL_Types.list(src.Split(",".ToCharArray()));
1800 } 1800 }
1801 1801
1802 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride) 1802 public LSL_Types.list llListRandomize(LSL_Types.list src, int stride)
1803 { 1803 {
1804 //int s = stride; 1804 //int s = stride;
1805 //if (s < 1) 1805 //if (s < 1)
1806 // s = 1; 1806 // s = 1;
1807 1807
1808 // This is a cowardly way of doing it ;) 1808 // This is a cowardly way of doing it ;)
1809 // TODO: Instead, randomize and check if random is mod stride or if it can not be, then array.removerange 1809 // TODO: Instead, randomize and check if random is mod stride or if it can not be, then array.removerange
1810 //List<LSL_Types.list> tmp = new List<LSL_Types.list>(); 1810 //List<LSL_Types.list> tmp = new List<LSL_Types.list>();
1811 1811
1812 // Add chunks to an array 1812 // Add chunks to an array
1813 //int c = 0; 1813 //int c = 0;
1814 //LSL_Types.list chunk = new LSL_Types.list(); 1814 //LSL_Types.list chunk = new LSL_Types.list();
1815 //foreach (string element in src) 1815 //foreach (string element in src)
1816 //{ 1816 //{
1817 // c++; 1817 // c++;
1818 // if (c > s) 1818 // if (c > s)
1819 // { 1819 // {
1820 // tmp.Add(chunk); 1820 // tmp.Add(chunk);
1821 // chunk = new LSL_Types.list(); 1821 // chunk = new LSL_Types.list();
1822 // c = 0; 1822 // c = 0;
1823 // } 1823 // }
1824 // chunk.Add(element); 1824 // chunk.Add(element);
1825 //} 1825 //}
1826 //if (chunk.Count > 0) 1826 //if (chunk.Count > 0)
1827 // tmp.Add(chunk); 1827 // tmp.Add(chunk);
1828 1828
1829 // Decreate (<- what kind of word is that? :D ) array back into a list 1829 // Decreate (<- what kind of word is that? :D ) array back into a list
1830 //int rnd; 1830 //int rnd;
1831 //LSL_Types.list ret = new LSL_Types.list(); 1831 //LSL_Types.list ret = new LSL_Types.list();
1832 //while (tmp.Count > 0) 1832 //while (tmp.Count > 0)
1833 //{ 1833 //{
1834 // rnd = Util.RandomClass.Next(tmp.Count); 1834 // rnd = Util.RandomClass.Next(tmp.Count);
1835 // foreach (string str in tmp[rnd]) 1835 // foreach (string str in tmp[rnd])
1836 // { 1836 // {
1837 // ret.Add(str); 1837 // ret.Add(str);
1838 // } 1838 // }
1839 // tmp.RemoveAt(rnd); 1839 // tmp.RemoveAt(rnd);
1840 //} 1840 //}
1841 1841
1842 //return ret; 1842 //return ret;
1843 NotImplemented("llListRandomize"); 1843 NotImplemented("llListRandomize");
1844 return new LSL_Types.list(); 1844 return new LSL_Types.list();
1845 } 1845 }
1846 1846
1847 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride) 1847 public LSL_Types.list llList2ListStrided(LSL_Types.list src, int start, int end, int stride)
1848 { 1848 {
1849 LSL_Types.list ret = new LSL_Types.list(); 1849 LSL_Types.list ret = new LSL_Types.list();
1850 //int s = stride; 1850 //int s = stride;
1851 //if (s < 1) 1851 //if (s < 1)
1852 // s = 1; 1852 // s = 1;
1853 1853
1854 //int sc = s; 1854 //int sc = s;
1855 //for (int i = start; i < src.Count; i++) 1855 //for (int i = start; i < src.Count; i++)
1856 //{ 1856 //{
1857 // sc--; 1857 // sc--;
1858 // if (sc == 0) 1858 // if (sc == 0)
1859 // { 1859 // {
1860 // sc = s; 1860 // sc = s;
1861 // // Addthis 1861 // // Addthis
1862 // ret.Add(src[i]); 1862 // ret.Add(src[i]);
1863 // } 1863 // }
1864 // if (i == end) 1864 // if (i == end)
1865 // break; 1865 // break;
1866 //} 1866 //}
1867 NotImplemented("llList2ListStrided"); 1867 NotImplemented("llList2ListStrided");
1868 return ret; 1868 return ret;
1869 } 1869 }
1870 1870
1871 public LSL_Types.Vector3 llGetRegionCorner() 1871 public LSL_Types.Vector3 llGetRegionCorner()
1872 { 1872 {
1873 return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0); 1873 return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0);
1874 } 1874 }
1875 1875
1876 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start) 1876 public LSL_Types.list llListInsertList(LSL_Types.list dest, LSL_Types.list src, int start)
1877 { 1877 {
1878 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(start, -1); 1878 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(start, -1);
1879 } 1879 }
1880 1880
1881 public int llListFindList(LSL_Types.list src, LSL_Types.list test) 1881 public int llListFindList(LSL_Types.list src, LSL_Types.list test)
1882 { 1882 {
1883 //foreach (string s in test) 1883 //foreach (string s in test)
1884 //{ 1884 //{
1885 // for (int ci = 0; ci < src.Count; ci++) 1885 // for (int ci = 0; ci < src.Count; ci++)
1886 // { 1886 // {
1887 // if (s == src[ci]) 1887 // if (s == src[ci])
1888 // return ci; 1888 // return ci;
1889 // } 1889 // }
1890 //} 1890 //}
1891 NotImplemented("llListFindList"); 1891 NotImplemented("llListFindList");
1892 return -1; 1892 return -1;
1893 } 1893 }
1894 1894
1895 public string llGetObjectName() 1895 public string llGetObjectName()
1896 { 1896 {
1897 return m_host.Name; 1897 return m_host.Name;
1898 } 1898 }
1899 1899
1900 public void llSetObjectName(string name) 1900 public void llSetObjectName(string name)
1901 { 1901 {
1902 m_host.Name = name; 1902 m_host.Name = name;
1903 } 1903 }
1904 1904
1905 public string llGetDate() 1905 public string llGetDate()
1906 { 1906 {
1907 DateTime date = DateTime.Now.ToUniversalTime(); 1907 DateTime date = DateTime.Now.ToUniversalTime();
1908 string result = date.ToString("yyyy-MM-dd"); 1908 string result = date.ToString("yyyy-MM-dd");
1909 return result; 1909 return result;
1910 } 1910 }
1911 1911
1912 public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) 1912 public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir)
1913 { 1913 {
1914 NotImplemented("llEdgeOfWorld"); 1914 NotImplemented("llEdgeOfWorld");
1915 return 0; 1915 return 0;
1916 } 1916 }
1917 1917
1918 public int llGetAgentInfo(string id) 1918 public int llGetAgentInfo(string id)
1919 { 1919 {
1920 NotImplemented("llGetAgentInfo"); 1920 NotImplemented("llGetAgentInfo");
1921 return 0; 1921 return 0;
1922 } 1922 }
1923 1923
1924 public void llAdjustSoundVolume(double volume) 1924 public void llAdjustSoundVolume(double volume)
1925 { 1925 {
1926 NotImplemented("llAdjustSoundVolume"); 1926 NotImplemented("llAdjustSoundVolume");
1927 } 1927 }
1928 1928
1929 public void llSetSoundQueueing(int queue) 1929 public void llSetSoundQueueing(int queue)
1930 { 1930 {
1931 NotImplemented("llSetSoundQueueing"); 1931 NotImplemented("llSetSoundQueueing");
1932 } 1932 }
1933 1933
1934 public void llSetSoundRadius(double radius) 1934 public void llSetSoundRadius(double radius)
1935 { 1935 {
1936 NotImplemented("llSetSoundRadius"); 1936 NotImplemented("llSetSoundRadius");
1937 } 1937 }
1938 1938
1939 public string llKey2Name(string id) 1939 public string llKey2Name(string id)
1940 { 1940 {
1941 NotImplemented("llKey2Name"); 1941 NotImplemented("llKey2Name");
1942 return ""; 1942 return "";
1943 } 1943 }
1944 1944
1945 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate) 1945 public void llSetTextureAnim(int mode, int face, int sizex, int sizey, double start, double length, double rate)
1946 { 1946 {
1947 NotImplemented("llSetTextureAnim"); 1947 NotImplemented("llSetTextureAnim");
1948 } 1948 }
1949 1949
1950 public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east, 1950 public void llTriggerSoundLimited(string sound, double volume, LSL_Types.Vector3 top_north_east,
1951 LSL_Types.Vector3 bottom_south_west) 1951 LSL_Types.Vector3 bottom_south_west)
1952 { 1952 {
1953 NotImplemented("llTriggerSoundLimited"); 1953 NotImplemented("llTriggerSoundLimited");
1954 } 1954 }
1955 1955
1956 public void llEjectFromLand(string pest) 1956 public void llEjectFromLand(string pest)
1957 { 1957 {
1958 NotImplemented("llEjectFromLand"); 1958 NotImplemented("llEjectFromLand");
1959 } 1959 }
1960 1960
1961 public void llParseString2List() 1961 public void llParseString2List()
1962 { 1962 {
1963 NotImplemented("llParseString2List"); 1963 NotImplemented("llParseString2List");
1964 } 1964 }
1965 1965
1966 public int llOverMyLand(string id) 1966 public int llOverMyLand(string id)
1967 { 1967 {
1968 NotImplemented("llOverMyLand"); 1968 NotImplemented("llOverMyLand");
1969 return 0; 1969 return 0;
1970 } 1970 }
1971 1971
1972 public string llGetLandOwnerAt(LSL_Types.Vector3 pos) 1972 public string llGetLandOwnerAt(LSL_Types.Vector3 pos)
1973 { 1973 {
1974 return World.GetLandOwner((float)pos.x, (float)pos.y).ToString(); 1974 return World.GetLandOwner((float)pos.x, (float)pos.y).ToString();
1975 } 1975 }
1976 1976
1977 public string llGetNotecardLine(string name, int line) 1977 public string llGetNotecardLine(string name, int line)
1978 { 1978 {
1979 NotImplemented("llGetNotecardLine"); 1979 NotImplemented("llGetNotecardLine");
1980 return ""; 1980 return "";
1981 } 1981 }
1982 1982
1983 public LSL_Types.Vector3 llGetAgentSize(string id) 1983 public LSL_Types.Vector3 llGetAgentSize(string id)
1984 { 1984 {
1985 NotImplemented("llGetAgentSize"); 1985 NotImplemented("llGetAgentSize");
1986 return new LSL_Types.Vector3(); 1986 return new LSL_Types.Vector3();
1987 } 1987 }
1988 1988
1989 public int llSameGroup(string agent) 1989 public int llSameGroup(string agent)
1990 { 1990 {
1991 NotImplemented("llSameGroup"); 1991 NotImplemented("llSameGroup");
1992 return 0; 1992 return 0;
1993 } 1993 }
1994 1994
1995 public void llUnSit(string id) 1995 public void llUnSit(string id)
1996 { 1996 {
1997 NotImplemented("llUnSit"); 1997 NotImplemented("llUnSit");
1998 } 1998 }
1999 1999
2000 public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset) 2000 public LSL_Types.Vector3 llGroundSlope(LSL_Types.Vector3 offset)
2001 { 2001 {
2002 NotImplemented("llGroundSlope"); 2002 NotImplemented("llGroundSlope");
2003 return new LSL_Types.Vector3(); 2003 return new LSL_Types.Vector3();
2004 } 2004 }
2005 2005
2006 public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset) 2006 public LSL_Types.Vector3 llGroundNormal(LSL_Types.Vector3 offset)
2007 { 2007 {
2008 NotImplemented("llGroundNormal"); 2008 NotImplemented("llGroundNormal");
2009 return new LSL_Types.Vector3(); 2009 return new LSL_Types.Vector3();
2010 } 2010 }
2011 2011
2012 public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset) 2012 public LSL_Types.Vector3 llGroundContour(LSL_Types.Vector3 offset)
2013 { 2013 {
2014 NotImplemented("llGroundContour"); 2014 NotImplemented("llGroundContour");
2015 return new LSL_Types.Vector3(); 2015 return new LSL_Types.Vector3();
2016 } 2016 }
2017 2017
2018 public int llGetAttached() 2018 public int llGetAttached()
2019 { 2019 {
2020 NotImplemented("llGetAttached"); 2020 NotImplemented("llGetAttached");
2021 return 0; 2021 return 0;
2022 } 2022 }
2023 2023
2024 public int llGetFreeMemory() 2024 public int llGetFreeMemory()
2025 { 2025 {
2026 NotImplemented("llGetFreeMemory"); 2026 NotImplemented("llGetFreeMemory");
2027 return 0; 2027 return 0;
2028 } 2028 }
2029 2029
2030 public string llGetRegionName() 2030 public string llGetRegionName()
2031 { 2031 {
2032 return World.RegionInfo.RegionName; 2032 return World.RegionInfo.RegionName;
2033 } 2033 }
2034 2034
2035 public double llGetRegionTimeDilation() 2035 public double llGetRegionTimeDilation()
2036 { 2036 {
2037 return (double)World.TimeDilation; 2037 return (double)World.TimeDilation;
2038 } 2038 }
2039 2039
2040 public double llGetRegionFPS() 2040 public double llGetRegionFPS()
2041 { 2041 {
2042 return 10.0f; 2042 return 10.0f;
2043 } 2043 }
2044 2044
2045 /* particle system rules should be coming into this routine as doubles, that is 2045 /* particle system rules should be coming into this routine as doubles, that is
2046 rule[0] should be an integer from this list and rule[1] should be the arg 2046 rule[0] should be an integer from this list and rule[1] should be the arg
2047 for the same integer. wiki.secondlife.com has most of this mapping, but some 2047 for the same integer. wiki.secondlife.com has most of this mapping, but some
2048 came from http://www.caligari-designs.com/p4u2 2048 came from http://www.caligari-designs.com/p4u2
2049 2049
2050 We iterate through the list for 'Count' elements, incrementing by two for each 2050 We iterate through the list for 'Count' elements, incrementing by two for each
2051 iteration and set the members of Primitive.ParticleSystem, one at a time. 2051 iteration and set the members of Primitive.ParticleSystem, one at a time.
2052 */ 2052 */
2053 2053
2054 public enum PrimitiveRule : int 2054 public enum PrimitiveRule : int
2055 { 2055 {
2056 PSYS_PART_FLAGS = 0, 2056 PSYS_PART_FLAGS = 0,
2057 PSYS_PART_START_COLOR = 1, 2057 PSYS_PART_START_COLOR = 1,
2058 PSYS_PART_START_ALPHA = 2, 2058 PSYS_PART_START_ALPHA = 2,
2059 PSYS_PART_END_COLOR = 3, 2059 PSYS_PART_END_COLOR = 3,
2060 PSYS_PART_END_ALPHA = 4, 2060 PSYS_PART_END_ALPHA = 4,
2061 PSYS_PART_START_SCALE = 5, 2061 PSYS_PART_START_SCALE = 5,
2062 PSYS_PART_END_SCALE = 6, 2062 PSYS_PART_END_SCALE = 6,
2063 PSYS_PART_MAX_AGE = 7, 2063 PSYS_PART_MAX_AGE = 7,
2064 PSYS_SRC_ACCEL = 8, 2064 PSYS_SRC_ACCEL = 8,
2065 PSYS_SRC_PATTERN = 9, 2065 PSYS_SRC_PATTERN = 9,
2066 PSYS_SRC_TEXTURE = 12, 2066 PSYS_SRC_TEXTURE = 12,
2067 PSYS_SRC_BURST_RATE = 13, 2067 PSYS_SRC_BURST_RATE = 13,
2068 PSYS_SRC_BURST_PART_COUNT = 15, 2068 PSYS_SRC_BURST_PART_COUNT = 15,
2069 PSYS_SRC_BURST_RADIUS = 16, 2069 PSYS_SRC_BURST_RADIUS = 16,
2070 PSYS_SRC_BURST_SPEED_MIN = 17, 2070 PSYS_SRC_BURST_SPEED_MIN = 17,
2071 PSYS_SRC_BURST_SPEED_MAX = 18, 2071 PSYS_SRC_BURST_SPEED_MAX = 18,
2072 PSYS_SRC_MAX_AGE = 19, 2072 PSYS_SRC_MAX_AGE = 19,
2073 PSYS_SRC_TARGET_KEY = 20, 2073 PSYS_SRC_TARGET_KEY = 20,
2074 PSYS_SRC_OMEGA = 21, 2074 PSYS_SRC_OMEGA = 21,
2075 PSYS_SRC_ANGLE_BEGIN = 22, 2075 PSYS_SRC_ANGLE_BEGIN = 22,
2076 PSYS_SRC_ANGLE_END = 23 2076 PSYS_SRC_ANGLE_END = 23
2077 } 2077 }
2078 2078
2079 public void llParticleSystem(List<Object> rules) 2079 public void llParticleSystem(List<Object> rules)
2080 { 2080 {
2081 Primitive.ParticleSystem prules = new Primitive.ParticleSystem(); 2081 Primitive.ParticleSystem prules = new Primitive.ParticleSystem();
2082 for (int i = 0; i < rules.Count; i += 2) 2082 for (int i = 0; i < rules.Count; i += 2)
2083 { 2083 {
2084 switch ((int)rules[i]) 2084 switch ((int)rules[i])
2085 { 2085 {
2086 case (int)LSL_BaseClass.PSYS_PART_FLAGS: 2086 case (int)LSL_BaseClass.PSYS_PART_FLAGS:
2087 prules.PartFlags = (uint)rules[i + 1]; 2087 prules.PartFlags = (uint)rules[i + 1];
2088 break; 2088 break;
2089 2089
2090 case (int)LSL_BaseClass.PSYS_PART_START_COLOR: 2090 case (int)LSL_BaseClass.PSYS_PART_START_COLOR:
2091 prules.PartStartColor = (LLColor)rules[i + 1]; 2091 prules.PartStartColor = (LLColor)rules[i + 1];
2092 break; 2092 break;
2093 2093
2094 case (int)LSL_BaseClass.PSYS_PART_START_ALPHA: 2094 case (int)LSL_BaseClass.PSYS_PART_START_ALPHA:
2095 //what is the cast? prules.PartStartColor = (LSL_Types.Vec)rules[i + 1]; 2095 //what is the cast? prules.PartStartColor = (LSL_Types.Vec)rules[i + 1];
2096 break; 2096 break;
2097 2097
2098 case (int)LSL_BaseClass.PSYS_PART_END_COLOR: 2098 case (int)LSL_BaseClass.PSYS_PART_END_COLOR:
2099 prules.PartEndColor = (LLColor)rules[i + 1]; 2099 prules.PartEndColor = (LLColor)rules[i + 1];
2100 break; 2100 break;
2101 2101
2102 case (int)LSL_BaseClass.PSYS_PART_END_ALPHA: 2102 case (int)LSL_BaseClass.PSYS_PART_END_ALPHA:
2103 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2103 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2104 break; 2104 break;
2105 2105
2106 case (int)LSL_BaseClass.PSYS_PART_START_SCALE: 2106 case (int)LSL_BaseClass.PSYS_PART_START_SCALE:
2107 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2107 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2108 break; 2108 break;
2109 2109
2110 case (int)LSL_BaseClass.PSYS_PART_END_SCALE: 2110 case (int)LSL_BaseClass.PSYS_PART_END_SCALE:
2111 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2111 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2112 break; 2112 break;
2113 2113
2114 case (int)LSL_BaseClass.PSYS_PART_MAX_AGE: 2114 case (int)LSL_BaseClass.PSYS_PART_MAX_AGE:
2115 prules.MaxAge = (float)rules[i + 1]; 2115 prules.MaxAge = (float)rules[i + 1];
2116 break; 2116 break;
2117 2117
2118 case (int)LSL_BaseClass.PSYS_SRC_ACCEL: 2118 case (int)LSL_BaseClass.PSYS_SRC_ACCEL:
2119 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2119 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2120 break; 2120 break;
2121 2121
2122 case (int)LSL_BaseClass.PSYS_SRC_PATTERN: 2122 case (int)LSL_BaseClass.PSYS_SRC_PATTERN:
2123 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1]; 2123 //what is the cast? prules.PartStartColor = (LLColor)rules[i + 1];
2124 break; 2124 break;
2125 2125
2126 case (int)LSL_BaseClass.PSYS_SRC_TEXTURE: 2126 case (int)LSL_BaseClass.PSYS_SRC_TEXTURE:
2127 prules.Texture = (LLUUID)rules[i + 1]; 2127 prules.Texture = (LLUUID)rules[i + 1];
2128 break; 2128 break;
2129 2129
2130 case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE: 2130 case (int)LSL_BaseClass.PSYS_SRC_BURST_RATE:
2131 prules.BurstRate = (float)rules[i + 1]; 2131 prules.BurstRate = (float)rules[i + 1];
2132 break; 2132 break;
2133 2133
2134 case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT: 2134 case (int)LSL_BaseClass.PSYS_SRC_BURST_PART_COUNT:
2135 prules.BurstPartCount = (byte)rules[i + 1]; 2135 prules.BurstPartCount = (byte)rules[i + 1];
2136 break; 2136 break;
2137 2137
2138 case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS: 2138 case (int)LSL_BaseClass.PSYS_SRC_BURST_RADIUS:
2139 prules.BurstRadius = (float)rules[i + 1]; 2139 prules.BurstRadius = (float)rules[i + 1];
2140 break; 2140 break;
2141 2141
2142 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN: 2142 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MIN:
2143 prules.BurstSpeedMin = (float)rules[i + 1]; 2143 prules.BurstSpeedMin = (float)rules[i + 1];
2144 break; 2144 break;
2145 2145
2146 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX: 2146 case (int)LSL_BaseClass.PSYS_SRC_BURST_SPEED_MAX:
2147 prules.BurstSpeedMax = (float)rules[i + 1]; 2147 prules.BurstSpeedMax = (float)rules[i + 1];
2148 break; 2148 break;
2149 2149
2150 case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE: 2150 case (int)LSL_BaseClass.PSYS_SRC_MAX_AGE:
2151 prules.MaxAge = (float)rules[i + 1]; 2151 prules.MaxAge = (float)rules[i + 1];
2152 break; 2152 break;
2153 2153
2154 case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY: 2154 case (int)LSL_BaseClass.PSYS_SRC_TARGET_KEY:
2155 prules.Target = (LLUUID)rules[i + 1]; 2155 prules.Target = (LLUUID)rules[i + 1];
2156 break; 2156 break;
2157 2157
2158 case (int)LSL_BaseClass.PSYS_SRC_OMEGA: 2158 case (int)LSL_BaseClass.PSYS_SRC_OMEGA:
2159 //cast?? prules.MaxAge = (float)rules[i + 1]; 2159 //cast?? prules.MaxAge = (float)rules[i + 1];
2160 break; 2160 break;
2161 2161
2162 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN: 2162 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_BEGIN:
2163 prules.InnerAngle = (float)rules[i + 1]; 2163 prules.InnerAngle = (float)rules[i + 1];
2164 break; 2164 break;
2165 2165
2166 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END: 2166 case (int)LSL_BaseClass.PSYS_SRC_ANGLE_END:
2167 prules.OuterAngle = (float)rules[i + 1]; 2167 prules.OuterAngle = (float)rules[i + 1];
2168 break; 2168 break;
2169 } 2169 }
2170 } 2170 }
2171 2171
2172 m_host.AddNewParticleSystem(prules); 2172 m_host.AddNewParticleSystem(prules);
2173 } 2173 }
2174 2174
2175 public void llGroundRepel(double height, int water, double tau) 2175 public void llGroundRepel(double height, int water, double tau)
2176 { 2176 {
2177 NotImplemented("llGroundRepel"); 2177 NotImplemented("llGroundRepel");
2178 } 2178 }
2179 2179
2180 public void llGiveInventoryList() 2180 public void llGiveInventoryList()
2181 { 2181 {
2182 NotImplemented("llGiveInventoryList"); 2182 NotImplemented("llGiveInventoryList");
2183 } 2183 }
2184 2184
2185 public void llSetVehicleType(int type) 2185 public void llSetVehicleType(int type)
2186 { 2186 {
2187 NotImplemented("llSetVehicleType"); 2187 NotImplemented("llSetVehicleType");
2188 } 2188 }
2189 2189
2190 public void llSetVehicledoubleParam(int param, double value) 2190 public void llSetVehicledoubleParam(int param, double value)
2191 { 2191 {
2192 NotImplemented("llSetVehicledoubleParam"); 2192 NotImplemented("llSetVehicledoubleParam");
2193 } 2193 }
2194 2194
2195 public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec) 2195 public void llSetVehicleVectorParam(int param, LSL_Types.Vector3 vec)
2196 { 2196 {
2197 NotImplemented("llSetVehicleVectorParam"); 2197 NotImplemented("llSetVehicleVectorParam");
2198 } 2198 }
2199 2199
2200 public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot) 2200 public void llSetVehicleRotationParam(int param, LSL_Types.Quaternion rot)
2201 { 2201 {
2202 NotImplemented("llSetVehicleRotationParam"); 2202 NotImplemented("llSetVehicleRotationParam");
2203 } 2203 }
2204 2204
2205 public void llSetVehicleFlags(int flags) 2205 public void llSetVehicleFlags(int flags)
2206 { 2206 {
2207 NotImplemented("llSetVehicleFlags"); 2207 NotImplemented("llSetVehicleFlags");
2208 } 2208 }
2209 2209
2210 public void llRemoveVehicleFlags(int flags) 2210 public void llRemoveVehicleFlags(int flags)
2211 { 2211 {
2212 NotImplemented("llRemoveVehicleFlags"); 2212 NotImplemented("llRemoveVehicleFlags");
2213 } 2213 }
2214 2214
2215 public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot) 2215 public void llSitTarget(LSL_Types.Vector3 offset, LSL_Types.Quaternion rot)
2216 { 2216 {
2217 // LSL quaternions can normalize to 0, normal Quaternions can't. 2217 // LSL quaternions can normalize to 0, normal Quaternions can't.
2218 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0) 2218 if (rot.s == 0 && rot.x == 0 && rot.y == 0 && rot.z == 0)
2219 rot.z = 1; // ZERO_ROTATION = 0,0,0,1 2219 rot.z = 1; // ZERO_ROTATION = 0,0,0,1
2220 2220
2221 m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z)); 2221 m_host.SetSitTarget(new Vector3((float)offset.x, (float)offset.y, (float)offset.z), new Quaternion((float)rot.s, (float)rot.x, (float)rot.y, (float)rot.z));
2222 } 2222 }
2223 2223
2224 public string llAvatarOnSitTarget() 2224 public string llAvatarOnSitTarget()
2225 { 2225 {
2226 LLUUID AVID = m_host.GetAvatarOnSitTarget(); 2226 LLUUID AVID = m_host.GetAvatarOnSitTarget();
2227 2227
2228 if (AVID != LLUUID.Zero) 2228 if (AVID != LLUUID.Zero)
2229 return AVID.ToString(); 2229 return AVID.ToString();
2230 else 2230 else
2231 return ""; 2231 return "";
2232 } 2232 }
2233 2233
2234 public void llAddToLandPassList(string avatar, double hours) 2234 public void llAddToLandPassList(string avatar, double hours)
2235 { 2235 {
2236 NotImplemented("llAddToLandPassList"); 2236 NotImplemented("llAddToLandPassList");
2237 } 2237 }
2238 2238
2239 public void llSetTouchText(string text) 2239 public void llSetTouchText(string text)
2240 { 2240 {
2241 m_host.TouchName = text; 2241 m_host.TouchName = text;
2242 } 2242 }
2243 2243
2244 public void llSetSitText(string text) 2244 public void llSetSitText(string text)
2245 { 2245 {
2246 m_host.SitName = text; 2246 m_host.SitName = text;
2247 } 2247 }
2248 2248
2249 public void llSetCameraEyeOffset(LSL_Types.Vector3 offset) 2249 public void llSetCameraEyeOffset(LSL_Types.Vector3 offset)
2250 { 2250 {
2251 NotImplemented("llSetCameraEyeOffset"); 2251 NotImplemented("llSetCameraEyeOffset");
2252 } 2252 }
2253 2253
2254 public void llSetCameraAtOffset(LSL_Types.Vector3 offset) 2254 public void llSetCameraAtOffset(LSL_Types.Vector3 offset)
2255 { 2255 {
2256 NotImplemented("llSetCameraAtOffset"); 2256 NotImplemented("llSetCameraAtOffset");
2257 } 2257 }
2258 2258
2259 public string llDumpList2String(LSL_Types.list src, string seperator) 2259 public string llDumpList2String(LSL_Types.list src, string seperator)
2260 { 2260 {
2261 if (src.Length == 0) 2261 if (src.Length == 0)
2262 { 2262 {
2263 return ""; 2263 return "";
2264 } 2264 }
2265 string ret = ""; 2265 string ret = "";
2266 foreach (object o in src.Data) 2266 foreach (object o in src.Data)
2267 { 2267 {
2268 ret = ret + o.ToString() + seperator; 2268 ret = ret + o.ToString() + seperator;
2269 } 2269 }
2270 ret = ret.Substring(0, ret.Length - seperator.Length); 2270 ret = ret.Substring(0, ret.Length - seperator.Length);
2271 return ret; 2271 return ret;
2272 } 2272 }
2273 2273
2274 public void llScriptDanger(LSL_Types.Vector3 pos) 2274 public void llScriptDanger(LSL_Types.Vector3 pos)
2275 { 2275 {
2276 NotImplemented("llScriptDanger"); 2276 NotImplemented("llScriptDanger");
2277 } 2277 }
2278 2278
2279 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel) 2279 public void llDialog(string avatar, string message, LSL_Types.list buttons, int chat_channel)
2280 { 2280 {
2281 NotImplemented("llDialog"); 2281 NotImplemented("llDialog");
2282 } 2282 }
2283 2283
2284 public void llVolumeDetect(int detect) 2284 public void llVolumeDetect(int detect)
2285 { 2285 {
2286 NotImplemented("llVolumeDetect"); 2286 NotImplemented("llVolumeDetect");
2287 } 2287 }
2288 2288
2289 public void llResetOtherScript(string name) 2289 public void llResetOtherScript(string name)
2290 { 2290 {
2291 NotImplemented("llResetOtherScript"); 2291 NotImplemented("llResetOtherScript");
2292 } 2292 }
2293 2293
2294 public int llGetScriptState(string name) 2294 public int llGetScriptState(string name)
2295 { 2295 {
2296 NotImplemented("llGetScriptState"); 2296 NotImplemented("llGetScriptState");
2297 return 0; 2297 return 0;
2298 } 2298 }
2299 2299
2300 public void llRemoteLoadScript() 2300 public void llRemoteLoadScript()
2301 { 2301 {
2302 NotImplemented("llRemoteLoadScript"); 2302 NotImplemented("llRemoteLoadScript");
2303 } 2303 }
2304 2304
2305 public void llSetRemoteScriptAccessPin(int pin) 2305 public void llSetRemoteScriptAccessPin(int pin)
2306 { 2306 {
2307 NotImplemented("llSetRemoteScriptAccessPin"); 2307 NotImplemented("llSetRemoteScriptAccessPin");
2308 } 2308 }
2309 2309
2310 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) 2310 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param)
2311 { 2311 {
2312 NotImplemented("llRemoteLoadScriptPin"); 2312 NotImplemented("llRemoteLoadScriptPin");
2313 } 2313 }
2314 2314
2315 // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval) 2315 // remote_data(integer type, key channel, key message_id, string sender, integer ival, string sval)
2316 // Not sure where these constants should live: 2316 // Not sure where these constants should live:
2317 // REMOTE_DATA_CHANNEL = 1 2317 // REMOTE_DATA_CHANNEL = 1
2318 // REMOTE_DATA_REQUEST = 2 2318 // REMOTE_DATA_REQUEST = 2
2319 // REMOTE_DATA_REPLY = 3 2319 // REMOTE_DATA_REPLY = 3
2320 public void llOpenRemoteDataChannel() 2320 public void llOpenRemoteDataChannel()
2321 { 2321 {
2322 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 2322 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
2323 if (xmlrpcMod.IsEnabled()) 2323 if (xmlrpcMod.IsEnabled())
2324 { 2324 {
2325 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID); 2325 LLUUID channelID = xmlrpcMod.OpenXMLRPCChannel(m_localID, m_itemID);
2326 object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), "", 0, "" }; 2326 object[] resobj = new object[] { 1, channelID.ToString(), LLUUID.Zero.ToString(), "", 0, "" };
2327 m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", resobj); 2327 m_ScriptEngine.m_EventQueueManager.AddToScriptQueue(m_localID, m_itemID, "remote_data", resobj);
2328 } 2328 }
2329 } 2329 }
2330 2330
2331 public string llSendRemoteData(string channel, string dest, int idata, string sdata) 2331 public string llSendRemoteData(string channel, string dest, int idata, string sdata)
2332 { 2332 {
2333 NotImplemented("llSendRemoteData"); 2333 NotImplemented("llSendRemoteData");
2334 return ""; 2334 return "";
2335 } 2335 }
2336 2336
2337 public void llRemoteDataReply(string channel, string message_id, string sdata, int idata) 2337 public void llRemoteDataReply(string channel, string message_id, string sdata, int idata)
2338 { 2338 {
2339 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 2339 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
2340 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata); 2340 xmlrpcMod.RemoteDataReply(channel, message_id, sdata, idata);
2341 } 2341 }
2342 2342
2343 public void llCloseRemoteDataChannel(string channel) 2343 public void llCloseRemoteDataChannel(string channel)
2344 { 2344 {
2345 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 2345 IXMLRPC xmlrpcMod = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
2346 xmlrpcMod.CloseXMLRPCChannel(channel); 2346 xmlrpcMod.CloseXMLRPCChannel(channel);
2347 } 2347 }
2348 2348
2349 public string llMD5String(string src, int nonce) 2349 public string llMD5String(string src, int nonce)
2350 { 2350 {
2351 return Util.Md5Hash(src + ":" + nonce.ToString()); 2351 return Util.Md5Hash(src + ":" + nonce.ToString());
2352 } 2352 }
2353 2353
2354 public void llSetPrimitiveParams(LSL_Types.list rules) 2354 public void llSetPrimitiveParams(LSL_Types.list rules)
2355 { 2355 {
2356 NotImplemented("llSetPrimitiveParams"); 2356 NotImplemented("llSetPrimitiveParams");
2357 } 2357 }
2358 2358
2359 public string llStringToBase64(string str) 2359 public string llStringToBase64(string str)
2360 { 2360 {
2361 try 2361 try
2362 { 2362 {
2363 byte[] encData_byte = new byte[str.Length]; 2363 byte[] encData_byte = new byte[str.Length];
2364 encData_byte = Encoding.UTF8.GetBytes(str); 2364 encData_byte = Encoding.UTF8.GetBytes(str);
2365 string encodedData = Convert.ToBase64String(encData_byte); 2365 string encodedData = Convert.ToBase64String(encData_byte);
2366 return encodedData; 2366 return encodedData;
2367 } 2367 }
2368 catch (Exception e) 2368 catch (Exception e)
2369 { 2369 {
2370 throw new Exception("Error in base64Encode" + e.Message); 2370 throw new Exception("Error in base64Encode" + e.Message);
2371 } 2371 }
2372 } 2372 }
2373 2373
2374 public string llBase64ToString(string str) 2374 public string llBase64ToString(string str)
2375 { 2375 {
2376 UTF8Encoding encoder = new UTF8Encoding(); 2376 UTF8Encoding encoder = new UTF8Encoding();
2377 Decoder utf8Decode = encoder.GetDecoder(); 2377 Decoder utf8Decode = encoder.GetDecoder();
2378 try 2378 try
2379 { 2379 {
2380 byte[] todecode_byte = Convert.FromBase64String(str); 2380 byte[] todecode_byte = Convert.FromBase64String(str);
2381 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); 2381 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
2382 char[] decoded_char = new char[charCount]; 2382 char[] decoded_char = new char[charCount];
2383 utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0); 2383 utf8Decode.GetChars(todecode_byte, 0, todecode_byte.Length, decoded_char, 0);
2384 string result = new String(decoded_char); 2384 string result = new String(decoded_char);
2385 return result; 2385 return result;
2386 } 2386 }
2387 catch (Exception e) 2387 catch (Exception e)
2388 { 2388 {
2389 throw new Exception("Error in base64Decode" + e.Message); 2389 throw new Exception("Error in base64Decode" + e.Message);
2390 } 2390 }
2391 } 2391 }
2392 2392
2393 public void llXorBase64Strings() 2393 public void llXorBase64Strings()
2394 { 2394 {
2395 throw new Exception("Command deprecated! Use llXorBase64StringsCorrect instead."); 2395 throw new Exception("Command deprecated! Use llXorBase64StringsCorrect instead.");
2396 } 2396 }
2397 2397
2398 public void llRemoteDataSetRegion() 2398 public void llRemoteDataSetRegion()
2399 { 2399 {
2400 NotImplemented("llRemoteDataSetRegion"); 2400 NotImplemented("llRemoteDataSetRegion");
2401 } 2401 }
2402 2402
2403 public double llLog10(double val) 2403 public double llLog10(double val)
2404 { 2404 {
2405 return (double)Math.Log10(val); 2405 return (double)Math.Log10(val);
2406 } 2406 }
2407 2407
2408 public double llLog(double val) 2408 public double llLog(double val)
2409 { 2409 {
2410 return (double)Math.Log(val); 2410 return (double)Math.Log(val);
2411 } 2411 }
2412 2412
2413 public LSL_Types.list llGetAnimationList(string id) 2413 public LSL_Types.list llGetAnimationList(string id)
2414 { 2414 {
2415 NotImplemented("llGetAnimationList"); 2415 NotImplemented("llGetAnimationList");
2416 return new LSL_Types.list(); 2416 return new LSL_Types.list();
2417 } 2417 }
2418 2418
2419 public void llSetParcelMusicURL(string url) 2419 public void llSetParcelMusicURL(string url)
2420 { 2420 {
2421 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y); 2421 LLUUID landowner = World.GetLandOwner(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y);
2422 if (landowner.Equals(null)) 2422 if (landowner.Equals(null))
2423 { 2423 {
2424 return; 2424 return;
2425 } 2425 }
2426 if (landowner != m_host.ObjectOwner) 2426 if (landowner != m_host.ObjectOwner)
2427 { 2427 {
2428 return; 2428 return;
2429 } 2429 }
2430 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url); 2430 World.SetLandMusicURL(m_host.AbsolutePosition.X, m_host.AbsolutePosition.Y, url);
2431 } 2431 }
2432 2432
2433 public LSL_Types.Vector3 llGetRootPosition() 2433 public LSL_Types.Vector3 llGetRootPosition()
2434 { 2434 {
2435 return new LSL_Types.Vector3(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z); 2435 return new LSL_Types.Vector3(m_host.ParentGroup.AbsolutePosition.X, m_host.ParentGroup.AbsolutePosition.Y, m_host.ParentGroup.AbsolutePosition.Z);
2436 } 2436 }
2437 2437
2438 public LSL_Types.Quaternion llGetRootRotation() 2438 public LSL_Types.Quaternion llGetRootRotation()
2439 { 2439 {
2440 return new LSL_Types.Quaternion(m_host.ParentGroup.GroupRotation.X, m_host.ParentGroup.GroupRotation.Y, m_host.ParentGroup.GroupRotation.Z, m_host.ParentGroup.GroupRotation.W); 2440 return new LSL_Types.Quaternion(m_host.ParentGroup.GroupRotation.X, m_host.ParentGroup.GroupRotation.Y, m_host.ParentGroup.GroupRotation.Z, m_host.ParentGroup.GroupRotation.W);
2441 } 2441 }
2442 2442
2443 public string llGetObjectDesc() 2443 public string llGetObjectDesc()
2444 { 2444 {
2445 return m_host.Description; 2445 return m_host.Description;
2446 } 2446 }
2447 2447
2448 public void llSetObjectDesc(string desc) 2448 public void llSetObjectDesc(string desc)
2449 { 2449 {
2450 m_host.Description = desc; 2450 m_host.Description = desc;
2451 } 2451 }
2452 2452
2453 public string llGetCreator() 2453 public string llGetCreator()
2454 { 2454 {
2455 return m_host.ObjectCreator.ToString(); 2455 return m_host.ObjectCreator.ToString();
2456 } 2456 }
2457 2457
2458 public string llGetTimestamp() 2458 public string llGetTimestamp()
2459 { 2459 {
2460 return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ"); 2460 return DateTime.Now.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ss.fffffffZ");
2461 } 2461 }
2462 2462
2463 public void llSetLinkAlpha(int linknumber, double alpha, int face) 2463 public void llSetLinkAlpha(int linknumber, double alpha, int face)
2464 { 2464 {
2465 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber); 2465 SceneObjectPart part = m_host.ParentGroup.GetLinkNumPart(linknumber);
2466 if (linknumber > -1) 2466 if (linknumber > -1)
2467 { 2467 {
2468 LLObject.TextureEntry tex = part.Shape.Textures; 2468 LLObject.TextureEntry tex = part.Shape.Textures;
2469 LLColor texcolor; 2469 LLColor texcolor;
2470 if (face > -1) 2470 if (face > -1)
2471 { 2471 {
2472 texcolor = tex.CreateFace((uint)face).RGBA; 2472 texcolor = tex.CreateFace((uint)face).RGBA;
2473 texcolor.A = (float)Math.Abs(alpha - 1); 2473 texcolor.A = (float)Math.Abs(alpha - 1);
2474 tex.FaceTextures[face].RGBA = texcolor; 2474 tex.FaceTextures[face].RGBA = texcolor;
2475 part.UpdateTexture(tex); 2475 part.UpdateTexture(tex);
2476 return; 2476 return;
2477 } 2477 }
2478 else if (face == -1) 2478 else if (face == -1)
2479 { 2479 {
2480 texcolor = tex.DefaultTexture.RGBA; 2480 texcolor = tex.DefaultTexture.RGBA;
2481 texcolor.A = (float)Math.Abs(alpha - 1); 2481 texcolor.A = (float)Math.Abs(alpha - 1);
2482 tex.DefaultTexture.RGBA = texcolor; 2482 tex.DefaultTexture.RGBA = texcolor;
2483 for (uint i = 0; i < 32; i++) 2483 for (uint i = 0; i < 32; i++)
2484 { 2484 {
2485 if (tex.FaceTextures[i] != null) 2485 if (tex.FaceTextures[i] != null)
2486 { 2486 {
2487 texcolor = tex.FaceTextures[i].RGBA; 2487 texcolor = tex.FaceTextures[i].RGBA;
2488 texcolor.A = (float)Math.Abs(alpha - 1); 2488 texcolor.A = (float)Math.Abs(alpha - 1);
2489 tex.FaceTextures[i].RGBA = texcolor; 2489 tex.FaceTextures[i].RGBA = texcolor;
2490 } 2490 }
2491 } 2491 }
2492 texcolor = tex.DefaultTexture.RGBA; 2492 texcolor = tex.DefaultTexture.RGBA;
2493 texcolor.A = (float)Math.Abs(alpha - 1); 2493 texcolor.A = (float)Math.Abs(alpha - 1);
2494 tex.DefaultTexture.RGBA = texcolor; 2494 tex.DefaultTexture.RGBA = texcolor;
2495 part.UpdateTexture(tex); 2495 part.UpdateTexture(tex);
2496 return; 2496 return;
2497 } 2497 }
2498 return; 2498 return;
2499 } 2499 }
2500 else if (linknumber == -1) 2500 else if (linknumber == -1)
2501 { 2501 {
2502 int num = m_host.ParentGroup.PrimCount; 2502 int num = m_host.ParentGroup.PrimCount;
2503 for (int w = 0; w < num; w++) 2503 for (int w = 0; w < num; w++)
2504 { 2504 {
2505 linknumber = w; 2505 linknumber = w;
2506 part = m_host.ParentGroup.GetLinkNumPart(linknumber); 2506 part = m_host.ParentGroup.GetLinkNumPart(linknumber);
2507 LLObject.TextureEntry tex = part.Shape.Textures; 2507 LLObject.TextureEntry tex = part.Shape.Textures;
2508 LLColor texcolor; 2508 LLColor texcolor;
2509 if (face > -1) 2509 if (face > -1)
2510 { 2510 {
2511 texcolor = tex.CreateFace((uint)face).RGBA; 2511 texcolor = tex.CreateFace((uint)face).RGBA;
2512 texcolor.A = (float)Math.Abs(alpha - 1); 2512 texcolor.A = (float)Math.Abs(alpha - 1);
2513 tex.FaceTextures[face].RGBA = texcolor; 2513 tex.FaceTextures[face].RGBA = texcolor;
2514 part.UpdateTexture(tex); 2514 part.UpdateTexture(tex);
2515 } 2515 }
2516 else if (face == -1) 2516 else if (face == -1)
2517 { 2517 {
2518 texcolor = tex.DefaultTexture.RGBA; 2518 texcolor = tex.DefaultTexture.RGBA;
2519 texcolor.A = (float)Math.Abs(alpha - 1); 2519 texcolor.A = (float)Math.Abs(alpha - 1);
2520 tex.DefaultTexture.RGBA = texcolor; 2520 tex.DefaultTexture.RGBA = texcolor;
2521 for (uint i = 0; i < 32; i++) 2521 for (uint i = 0; i < 32; i++)
2522 { 2522 {
2523 if (tex.FaceTextures[i] != null) 2523 if (tex.FaceTextures[i] != null)
2524 { 2524 {
2525 texcolor = tex.FaceTextures[i].RGBA; 2525 texcolor = tex.FaceTextures[i].RGBA;
2526 texcolor.A = (float)Math.Abs(alpha - 1); 2526 texcolor.A = (float)Math.Abs(alpha - 1);
2527 tex.FaceTextures[i].RGBA = texcolor; 2527 tex.FaceTextures[i].RGBA = texcolor;
2528 } 2528 }
2529 } 2529 }
2530 texcolor = tex.DefaultTexture.RGBA; 2530 texcolor = tex.DefaultTexture.RGBA;
2531 texcolor.A = (float)Math.Abs(alpha - 1); 2531 texcolor.A = (float)Math.Abs(alpha - 1);
2532 tex.DefaultTexture.RGBA = texcolor; 2532 tex.DefaultTexture.RGBA = texcolor;
2533 part.UpdateTexture(tex); 2533 part.UpdateTexture(tex);
2534 } 2534 }
2535 } 2535 }
2536 return; 2536 return;
2537 } 2537 }
2538 else 2538 else
2539 { 2539 {
2540 NotImplemented("llSetLinkAlpha"); 2540 NotImplemented("llSetLinkAlpha");
2541 } 2541 }
2542 } 2542 }
2543 2543
2544 public int llGetNumberOfPrims() 2544 public int llGetNumberOfPrims()
2545 { 2545 {
2546 return m_host.ParentGroup.PrimCount; 2546 return m_host.ParentGroup.PrimCount;
2547 } 2547 }
2548 2548
2549 public string llGetNumberOfNotecardLines(string name) 2549 public string llGetNumberOfNotecardLines(string name)
2550 { 2550 {
2551 NotImplemented("llGetNumberOfNotecardLines"); 2551 NotImplemented("llGetNumberOfNotecardLines");
2552 return ""; 2552 return "";
2553 } 2553 }
2554 2554
2555 public LSL_Types.list llGetBoundingBox(string obj) 2555 public LSL_Types.list llGetBoundingBox(string obj)
2556 { 2556 {
2557 NotImplemented("llGetBoundingBox"); 2557 NotImplemented("llGetBoundingBox");
2558 return new LSL_Types.list(); 2558 return new LSL_Types.list();
2559 } 2559 }
2560 2560
2561 public LSL_Types.Vector3 llGetGeometricCenter() 2561 public LSL_Types.Vector3 llGetGeometricCenter()
2562 { 2562 {
2563 return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); 2563 return new LSL_Types.Vector3(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z);
2564 } 2564 }
2565 2565
2566 public void llGetPrimitiveParams() 2566 public void llGetPrimitiveParams()
2567 { 2567 {
2568 NotImplemented("llGetPrimitiveParams"); 2568 NotImplemented("llGetPrimitiveParams");
2569 } 2569 }
2570 2570
2571 public string llIntegerToBase64(int number) 2571 public string llIntegerToBase64(int number)
2572 { 2572 {
2573 NotImplemented("llIntegerToBase64"); 2573 NotImplemented("llIntegerToBase64");
2574 return ""; 2574 return "";
2575 } 2575 }
2576 2576
2577 public int llBase64ToInteger(string str) 2577 public int llBase64ToInteger(string str)
2578 { 2578 {
2579 NotImplemented("llBase64ToInteger"); 2579 NotImplemented("llBase64ToInteger");
2580 return 0; 2580 return 0;
2581 } 2581 }
2582 2582
2583 public double llGetGMTclock() 2583 public double llGetGMTclock()
2584 { 2584 {
2585 return DateTime.UtcNow.TimeOfDay.TotalSeconds; 2585 return DateTime.UtcNow.TimeOfDay.TotalSeconds;
2586 } 2586 }
2587 2587
2588 public string llGetSimulatorHostname() 2588 public string llGetSimulatorHostname()
2589 { 2589 {
2590 return System.Environment.MachineName; 2590 return System.Environment.MachineName;
2591 } 2591 }
2592 2592
2593 public void llSetLocalRot(LSL_Types.Quaternion rot) 2593 public void llSetLocalRot(LSL_Types.Quaternion rot)
2594 { 2594 {
2595 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s); 2595 m_host.RotationOffset = new LLQuaternion((float)rot.x, (float)rot.y, (float)rot.z, (float)rot.s);
2596 } 2596 }
2597 2597
2598 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers) 2598 public LSL_Types.list llParseStringKeepNulls(string src, LSL_Types.list seperators, LSL_Types.list spacers)
2599 { 2599 {
2600 NotImplemented("llParseStringKeepNulls"); 2600 NotImplemented("llParseStringKeepNulls");
2601 return new LSL_Types.list(); 2601 return new LSL_Types.list();
2602 } 2602 }
2603 2603
2604 public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity, 2604 public void llRezAtRoot(string inventory, LSL_Types.Vector3 position, LSL_Types.Vector3 velocity,
2605 LSL_Types.Quaternion rot, int param) 2605 LSL_Types.Quaternion rot, int param)
2606 { 2606 {
2607 NotImplemented("llRezAtRoot"); 2607 NotImplemented("llRezAtRoot");
2608 } 2608 }
2609 2609
2610 public int llGetObjectPermMask(int mask) 2610 public int llGetObjectPermMask(int mask)
2611 { 2611 {
2612 NotImplemented("llGetObjectPermMask"); 2612 NotImplemented("llGetObjectPermMask");
2613 return 0; 2613 return 0;
2614 } 2614 }
2615 2615
2616 public void llSetObjectPermMask(int mask, int value) 2616 public void llSetObjectPermMask(int mask, int value)
2617 { 2617 {
2618 NotImplemented("llSetObjectPermMask"); 2618 NotImplemented("llSetObjectPermMask");
2619 } 2619 }
2620 2620
2621 public void llGetInventoryPermMask(string item, int mask) 2621 public void llGetInventoryPermMask(string item, int mask)
2622 { 2622 {
2623 NotImplemented("llGetInventoryPermMask"); 2623 NotImplemented("llGetInventoryPermMask");
2624 } 2624 }
2625 2625
2626 public void llSetInventoryPermMask(string item, int mask, int value) 2626 public void llSetInventoryPermMask(string item, int mask, int value)
2627 { 2627 {
2628 NotImplemented("llSetInventoryPermMask"); 2628 NotImplemented("llSetInventoryPermMask");
2629 } 2629 }
2630 2630
2631 public string llGetInventoryCreator(string item) 2631 public string llGetInventoryCreator(string item)
2632 { 2632 {
2633 NotImplemented("llGetInventoryCreator"); 2633 NotImplemented("llGetInventoryCreator");
2634 return ""; 2634 return "";
2635 } 2635 }
2636 2636
2637 public void llOwnerSay(string msg) 2637 public void llOwnerSay(string msg)
2638 { 2638 {
2639 //temp fix so that lsl wiki examples aren't annoying to use to test other functions 2639 //temp fix so that lsl wiki examples aren't annoying to use to test other functions
2640 World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 2640 World.SimChat(Helpers.StringToField(msg), ChatTypeEnum.Say, 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
2641 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 2641 IWorldComm wComm = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
2642 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg); 2642 wComm.DeliverMessage(m_host.UUID.ToString(), ChatTypeEnum.Say, 0, m_host.Name, msg);
2643 } 2643 }
2644 2644
2645 public void llRequestSimulatorData(string simulator, int data) 2645 public void llRequestSimulatorData(string simulator, int data)
2646 { 2646 {
2647 NotImplemented("llRequestSimulatorData"); 2647 NotImplemented("llRequestSimulatorData");
2648 } 2648 }
2649 2649
2650 public void llForceMouselook(int mouselook) 2650 public void llForceMouselook(int mouselook)
2651 { 2651 {
2652 NotImplemented("llForceMouselook"); 2652 NotImplemented("llForceMouselook");
2653 } 2653 }
2654 2654
2655 public double llGetObjectMass(string id) 2655 public double llGetObjectMass(string id)
2656 { 2656 {
2657 NotImplemented("llGetObjectMass"); 2657 NotImplemented("llGetObjectMass");
2658 return 0; 2658 return 0;
2659 } 2659 }
2660 2660
2661 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end) 2661 public LSL_Types.list llListReplaceList(LSL_Types.list dest, LSL_Types.list src, int start, int end)
2662 { 2662 {
2663 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1); 2663 return dest.GetSublist(0, start - 1) + src + dest.GetSublist(end + 1, -1);
2664 } 2664 }
2665 2665
2666 public void llLoadURL(string avatar_id, string message, string url) 2666 public void llLoadURL(string avatar_id, string message, string url)
2667 { 2667 {
2668 LLUUID avatarId = new LLUUID(avatar_id); 2668 LLUUID avatarId = new LLUUID(avatar_id);
2669 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message, 2669 m_ScriptEngine.World.SendUrlToUser(avatarId, m_host.Name, m_host.UUID, m_host.ObjectOwner, false, message,
2670 url); 2670 url);
2671 } 2671 }
2672 2672
2673 public void llParcelMediaCommandList(LSL_Types.list commandList) 2673 public void llParcelMediaCommandList(LSL_Types.list commandList)
2674 { 2674 {
2675 NotImplemented("llParcelMediaCommandList"); 2675 NotImplemented("llParcelMediaCommandList");
2676 } 2676 }
2677 2677
2678 public void llParcelMediaQuery() 2678 public void llParcelMediaQuery()
2679 { 2679 {
2680 NotImplemented("llParcelMediaQuery"); 2680 NotImplemented("llParcelMediaQuery");
2681 } 2681 }
2682 2682
2683 public int llModPow(int a, int b, int c) 2683 public int llModPow(int a, int b, int c)
2684 { 2684 {
2685 Int64 tmp = 0; 2685 Int64 tmp = 0;
2686 Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp); 2686 Int64 val = Math.DivRem(Convert.ToInt64(Math.Pow(a, b)), c, out tmp);
2687 return Convert.ToInt32(tmp); 2687 return Convert.ToInt32(tmp);
2688 } 2688 }
2689 2689
2690 public int llGetInventoryType(string name) 2690 public int llGetInventoryType(string name)
2691 { 2691 {
2692 NotImplemented("llGetInventoryType"); 2692 NotImplemented("llGetInventoryType");
2693 return 0; 2693 return 0;
2694 } 2694 }
2695 2695
2696 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons) 2696 public void llSetPayPrice(int price, LSL_Types.list quick_pay_buttons)
2697 { 2697 {
2698 NotImplemented("llSetPayPrice"); 2698 NotImplemented("llSetPayPrice");
2699 } 2699 }
2700 2700
2701 public LSL_Types.Vector3 llGetCameraPos() 2701 public LSL_Types.Vector3 llGetCameraPos()
2702 { 2702 {
2703 NotImplemented("llGetCameraPos"); 2703 NotImplemented("llGetCameraPos");
2704 return new LSL_Types.Vector3(); 2704 return new LSL_Types.Vector3();
2705 } 2705 }
2706 2706
2707 public LSL_Types.Quaternion llGetCameraRot() 2707 public LSL_Types.Quaternion llGetCameraRot()
2708 { 2708 {
2709 NotImplemented("llGetCameraRot"); 2709 NotImplemented("llGetCameraRot");
2710 return new LSL_Types.Quaternion(); 2710 return new LSL_Types.Quaternion();
2711 } 2711 }
2712 2712
2713 public void llSetPrimURL() 2713 public void llSetPrimURL()
2714 { 2714 {
2715 NotImplemented("llSetPrimURL"); 2715 NotImplemented("llSetPrimURL");
2716 } 2716 }
2717 2717
2718 public void llRefreshPrimURL() 2718 public void llRefreshPrimURL()
2719 { 2719 {
2720 NotImplemented("llRefreshPrimURL"); 2720 NotImplemented("llRefreshPrimURL");
2721 } 2721 }
2722 2722
2723 public string llEscapeURL(string url) 2723 public string llEscapeURL(string url)
2724 { 2724 {
2725 try 2725 try
2726 { 2726 {
2727 return Uri.EscapeUriString(url); 2727 return Uri.EscapeUriString(url);
2728 } 2728 }
2729 catch (Exception ex) 2729 catch (Exception ex)
2730 { 2730 {
2731 return "llEscapeURL: " + ex.ToString(); 2731 return "llEscapeURL: " + ex.ToString();
2732 } 2732 }
2733 } 2733 }
2734 2734
2735 public string llUnescapeURL(string url) 2735 public string llUnescapeURL(string url)
2736 { 2736 {
2737 try 2737 try
2738 { 2738 {
2739 return Uri.UnescapeDataString(url); 2739 return Uri.UnescapeDataString(url);
2740 } 2740 }
2741 catch (Exception ex) 2741 catch (Exception ex)
2742 { 2742 {
2743 return "llUnescapeURL: " + ex.ToString(); 2743 return "llUnescapeURL: " + ex.ToString();
2744 } 2744 }
2745 } 2745 }
2746 2746
2747 public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at) 2747 public void llMapDestination(string simname, LSL_Types.Vector3 pos, LSL_Types.Vector3 look_at)
2748 { 2748 {
2749 NotImplemented("llMapDestination"); 2749 NotImplemented("llMapDestination");
2750 } 2750 }
2751 2751
2752 public void llAddToLandBanList(string avatar, double hours) 2752 public void llAddToLandBanList(string avatar, double hours)
2753 { 2753 {
2754 NotImplemented("llAddToLandBanList"); 2754 NotImplemented("llAddToLandBanList");
2755 } 2755 }
2756 2756
2757 public void llRemoveFromLandPassList(string avatar) 2757 public void llRemoveFromLandPassList(string avatar)
2758 { 2758 {
2759 NotImplemented("llRemoveFromLandPassList"); 2759 NotImplemented("llRemoveFromLandPassList");
2760 } 2760 }
2761 2761
2762 public void llRemoveFromLandBanList(string avatar) 2762 public void llRemoveFromLandBanList(string avatar)
2763 { 2763 {
2764 NotImplemented("llRemoveFromLandBanList"); 2764 NotImplemented("llRemoveFromLandBanList");
2765 } 2765 }
2766 2766
2767 public void llSetCameraParams(LSL_Types.list rules) 2767 public void llSetCameraParams(LSL_Types.list rules)
2768 { 2768 {
2769 NotImplemented("llSetCameraParams"); 2769 NotImplemented("llSetCameraParams");
2770 } 2770 }
2771 2771
2772 public void llClearCameraParams() 2772 public void llClearCameraParams()
2773 { 2773 {
2774 NotImplemented("llClearCameraParams"); 2774 NotImplemented("llClearCameraParams");
2775 } 2775 }
2776 2776
2777 public double llListStatistics(int operation, LSL_Types.list src) 2777 public double llListStatistics(int operation, LSL_Types.list src)
2778 { 2778 {
2779 NotImplemented("llListStatistics"); 2779 NotImplemented("llListStatistics");
2780 return 0; 2780 return 0;
2781 } 2781 }
2782 2782
2783 public int llGetUnixTime() 2783 public int llGetUnixTime()
2784 { 2784 {
2785 return Util.UnixTimeSinceEpoch(); 2785 return Util.UnixTimeSinceEpoch();
2786 } 2786 }
2787 2787
2788 public int llGetParcelFlags(LSL_Types.Vector3 pos) 2788 public int llGetParcelFlags(LSL_Types.Vector3 pos)
2789 { 2789 {
2790 NotImplemented("llGetParcelFlags"); 2790 NotImplemented("llGetParcelFlags");
2791 return 0; 2791 return 0;
2792 } 2792 }
2793 2793
2794 public int llGetRegionFlags() 2794 public int llGetRegionFlags()
2795 { 2795 {
2796 NotImplemented("llGetRegionFlags"); 2796 NotImplemented("llGetRegionFlags");
2797 return 0; 2797 return 0;
2798 } 2798 }
2799 2799
2800 public string llXorBase64StringsCorrect(string str1, string str2) 2800 public string llXorBase64StringsCorrect(string str1, string str2)
2801 { 2801 {
2802 string ret = ""; 2802 string ret = "";
2803 string src1 = llBase64ToString(str1); 2803 string src1 = llBase64ToString(str1);
2804 string src2 = llBase64ToString(str2); 2804 string src2 = llBase64ToString(str2);
2805 int c = 0; 2805 int c = 0;
2806 for (int i = 0; i < src1.Length; i++) 2806 for (int i = 0; i < src1.Length; i++)
2807 { 2807 {
2808 ret += src1[i] ^ src2[c]; 2808 ret += src1[i] ^ src2[c];
2809 2809
2810 c++; 2810 c++;
2811 if (c > src2.Length) 2811 if (c > src2.Length)
2812 c = 0; 2812 c = 0;
2813 } 2813 }
2814 return llStringToBase64(ret); 2814 return llStringToBase64(ret);
2815 } 2815 }
2816 2816
2817 public string llHTTPRequest(string url, LSL_Types.list parameters, string body) 2817 public string llHTTPRequest(string url, LSL_Types.list parameters, string body)
2818 { 2818 {
2819 IHttpRequests httpScriptMod = 2819 IHttpRequests httpScriptMod =
2820 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); 2820 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>();
2821 List<string> param = new List<string>(); 2821 List<string> param = new List<string>();
2822 foreach (object o in parameters.Data) 2822 foreach (object o in parameters.Data)
2823 { 2823 {
2824 param.Add(o.ToString()); 2824 param.Add(o.ToString());
2825 } 2825 }
2826 LLUUID reqID = httpScriptMod. 2826 LLUUID reqID = httpScriptMod.
2827 StartHttpRequest(m_localID, m_itemID, url, param, body); 2827 StartHttpRequest(m_localID, m_itemID, url, param, body);
2828 2828
2829 if (!reqID.Equals(null)) 2829 if (!reqID.Equals(null))
2830 return reqID.ToString(); 2830 return reqID.ToString();
2831 else 2831 else
2832 return null; 2832 return null;
2833 } 2833 }
2834 2834
2835 public void llResetLandBanList() 2835 public void llResetLandBanList()
2836 { 2836 {
2837 NotImplemented("llResetLandBanList"); 2837 NotImplemented("llResetLandBanList");
2838 } 2838 }
2839 2839
2840 public void llResetLandPassList() 2840 public void llResetLandPassList()
2841 { 2841 {
2842 NotImplemented("llResetLandPassList"); 2842 NotImplemented("llResetLandPassList");
2843 } 2843 }
2844 2844
2845 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) 2845 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide)
2846 { 2846 {
2847 NotImplemented("llGetParcelPrimCount"); 2847 NotImplemented("llGetParcelPrimCount");
2848 return 0; 2848 return 0;
2849 } 2849 }
2850 2850
2851 public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos) 2851 public LSL_Types.list llGetParcelPrimOwners(LSL_Types.Vector3 pos)
2852 { 2852 {
2853 NotImplemented("llGetParcelPrimOwners"); 2853 NotImplemented("llGetParcelPrimOwners");
2854 return new LSL_Types.list(); 2854 return new LSL_Types.list();
2855 } 2855 }
2856 2856
2857 public int llGetObjectPrimCount(string object_id) 2857 public int llGetObjectPrimCount(string object_id)
2858 { 2858 {
2859 SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id)); 2859 SceneObjectPart part = World.GetSceneObjectPart(new LLUUID(object_id));
2860 if (part == null) 2860 if (part == null)
2861 { 2861 {
2862 return 0; 2862 return 0;
2863 } 2863 }
2864 else 2864 else
2865 { 2865 {
2866 return part.ParentGroup.Children.Count; 2866 return part.ParentGroup.Children.Count;
2867 } 2867 }
2868 } 2868 }
2869 2869
2870 public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide) 2870 public int llGetParcelMaxPrims(LSL_Types.Vector3 pos, int sim_wide)
2871 { 2871 {
2872 // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation 2872 // Alondria: This currently just is utilizing the normal grid's 0.22 prims/m2 calculation
2873 // Which probably will be irrelevent in OpenSim.... 2873 // Which probably will be irrelevent in OpenSim....
2874 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 2874 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
2875 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor; 2875 float bonusfactor = World.RegionInfo.EstateSettings.objectBonusFactor;
2876 if (land == null) 2876 if (land == null)
2877 { 2877 {
2878 return 0; 2878 return 0;
2879 } 2879 }
2880 if (sim_wide == 1) 2880 if (sim_wide == 1)
2881 { 2881 {
2882 decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor; 2882 decimal v = land.simwideArea * (decimal)(0.22) * (decimal)bonusfactor;
2883 return (int)v; 2883 return (int)v;
2884 } 2884 }
2885 else 2885 else
2886 { 2886 {
2887 decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor; 2887 decimal v = land.area * (decimal)(0.22) * (decimal)bonusfactor;
2888 return (int)v; 2888 return (int)v;
2889 } 2889 }
2890 2890
2891 } 2891 }
2892 2892
2893 public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param) 2893 public LSL_Types.list llGetParcelDetails(LSL_Types.Vector3 pos, LSL_Types.list param)
2894 { 2894 {
2895 LandData land = World.GetLandData((float)pos.x, (float)pos.y); 2895 LandData land = World.GetLandData((float)pos.x, (float)pos.y);
2896 if (land == null) 2896 if (land == null)
2897 { 2897 {
2898 return new LSL_Types.list(0); 2898 return new LSL_Types.list(0);
2899 } 2899 }
2900 LSL_Types.list ret = new LSL_Types.list(); 2900 LSL_Types.list ret = new LSL_Types.list();
2901 foreach (object o in param.Data) 2901 foreach (object o in param.Data)
2902 { 2902 {
2903 switch (o.ToString()) 2903 switch (o.ToString())
2904 { 2904 {
2905 case "0": 2905 case "0":
2906 ret = ret + new LSL_Types.list(land.landName); 2906 ret = ret + new LSL_Types.list(land.landName);
2907 break; 2907 break;
2908 case "1": 2908 case "1":
2909 ret = ret + new LSL_Types.list(land.landDesc); 2909 ret = ret + new LSL_Types.list(land.landDesc);
2910 break; 2910 break;
2911 case "2": 2911 case "2":
2912 ret = ret + new LSL_Types.list(land.ownerID.ToString()); 2912 ret = ret + new LSL_Types.list(land.ownerID.ToString());
2913 break; 2913 break;
2914 case "3": 2914 case "3":
2915 ret = ret + new LSL_Types.list(land.groupID.ToString()); 2915 ret = ret + new LSL_Types.list(land.groupID.ToString());
2916 break; 2916 break;
2917 case "4": 2917 case "4":
2918 ret = ret + new LSL_Types.list(land.area); 2918 ret = ret + new LSL_Types.list(land.area);
2919 break; 2919 break;
2920 default: 2920 default:
2921 ret = ret + new LSL_Types.list(0); 2921 ret = ret + new LSL_Types.list(0);
2922 break; 2922 break;
2923 } 2923 }
2924 } 2924 }
2925 return ret; 2925 return ret;
2926 } 2926 }
2927 2927
2928 // 2928 //
2929 // OpenSim functions 2929 // OpenSim functions
2930 // 2930 //
2931 public int osTerrainSetHeight(int x, int y, double val) 2931 public int osTerrainSetHeight(int x, int y, double val)
2932 { 2932 {
2933 if (x > 255 || x < 0 || y > 255 || y < 0) 2933 if (x > 255 || x < 0 || y > 255 || y < 0)
2934 LSLError("osTerrainSetHeight: Coordinate out of bounds"); 2934 LSLError("osTerrainSetHeight: Coordinate out of bounds");
2935 2935
2936 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0))) 2936 if (World.PermissionsMngr.CanTerraform(m_host.OwnerID, new LLVector3(x, y, 0)))
2937 { 2937 {
2938 World.Terrain.Set(x, y, val); 2938 World.Terrain.Set(x, y, val);
2939 return 1; 2939 return 1;
2940 } 2940 }
2941 else 2941 else
2942 { 2942 {
2943 return 0; 2943 return 0;
2944 } 2944 }
2945 } 2945 }
2946 2946
2947 public double osTerrainGetHeight(int x, int y) 2947 public double osTerrainGetHeight(int x, int y)
2948 { 2948 {
2949 if (x > 255 || x < 0 || y > 255 || y < 0) 2949 if (x > 255 || x < 0 || y > 255 || y < 0)
2950 LSLError("osTerrainGetHeight: Coordinate out of bounds"); 2950 LSLError("osTerrainGetHeight: Coordinate out of bounds");
2951 2951
2952 return World.Terrain.GetHeight(x, y); 2952 return World.Terrain.GetHeight(x, y);
2953 } 2953 }
2954 2954
2955 public int osRegionRestart(double seconds) 2955 public int osRegionRestart(double seconds)
2956 { 2956 {
2957 if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID)) 2957 if (World.PermissionsMngr.CanRestartSim(m_host.OwnerID))
2958 { 2958 {
2959 World.Restart((float)seconds); 2959 World.Restart((float)seconds);
2960 return 1; 2960 return 1;
2961 } 2961 }
2962 else 2962 else
2963 { 2963 {
2964 return 0; 2964 return 0;
2965 } 2965 }
2966 } 2966 }
2967 2967
2968 public void osRegionNotice(string msg) 2968 public void osRegionNotice(string msg)
2969 { 2969 {
2970 World.SendGeneralAlert(msg); 2970 World.SendGeneralAlert(msg);
2971 } 2971 }
2972 2972
2973 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams, 2973 public string osSetDynamicTextureURL(string dynamicID, string contentType, string url, string extraParams,
2974 int timer) 2974 int timer)
2975 { 2975 {
2976 if (dynamicID == "") 2976 if (dynamicID == "")
2977 { 2977 {
2978 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>(); 2978 IDynamicTextureManager textureManager = World.RequestModuleInterface<IDynamicTextureManager>();
2979 LLUUID createdTexture = 2979 LLUUID createdTexture =
2980 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url, 2980 textureManager.AddDynamicTextureURL(World.RegionInfo.RegionID, m_host.UUID, contentType, url,
2981 extraParams, timer); 2981 extraParams, timer);
2982 return createdTexture.ToString(); 2982 return createdTexture.ToString();
2983 } 2983 }
2984 else 2984 else
2985 { 2985 {
2986 //TODO update existing dynamic textures 2986 //TODO update existing dynamic textures
2987 } 2987 }
2988 2988
2989 return LLUUID.Zero.ToString(); 2989 return LLUUID.Zero.ToString();
2990 } 2990 }
2991 2991
2992 private void NotImplemented(string Command) 2992 private void NotImplemented(string Command)
2993 { 2993 {
2994 if (throwErrorOnNotImplemented) 2994 if (throwErrorOnNotImplemented)
2995 throw new NotImplementedException("Command not implemented: " + Command); 2995 throw new NotImplementedException("Command not implemented: " + Command);
2996 } 2996 }
2997 2997
2998 private void LSLError(string msg) 2998 private void LSLError(string msg)
2999 { 2999 {
3000 throw new Exception("LSL Runtime Error: " + msg); 3000 throw new Exception("LSL Runtime Error: " + msg);
3001 } 3001 }
3002 } 3002 }
3003} \ No newline at end of file 3003} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs
index df00d4e..68ad88d 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/AppDomainManager.cs
@@ -1,239 +1,239 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29 29
30using System; 30using System;
31using System.Collections; 31using System.Collections;
32using System.Collections.Generic; 32using System.Collections.Generic;
33using System.Reflection; 33using System.Reflection;
34using OpenSim.Region.ScriptEngine.Common; 34using OpenSim.Region.ScriptEngine.Common;
35 35
36namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 36namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
37{ 37{
38 public class AppDomainManager 38 public class AppDomainManager
39 { 39 {
40 40
41 // 41 //
42 // This class does AppDomain handling and loading/unloading of scripts in it. 42 // This class does AppDomain handling and loading/unloading of scripts in it.
43 // It is instanced in "ScriptEngine" and controlled from "ScriptManager" 43 // It is instanced in "ScriptEngine" and controlled from "ScriptManager"
44 // 44 //
45 // 1. Create a new AppDomain if old one is full (or doesn't exist) 45 // 1. Create a new AppDomain if old one is full (or doesn't exist)
46 // 2. Load scripts into AppDomain 46 // 2. Load scripts into AppDomain
47 // 3. Unload scripts from AppDomain (stopping them and marking them as inactive) 47 // 3. Unload scripts from AppDomain (stopping them and marking them as inactive)
48 // 4. Unload AppDomain completely when all scripts in it has stopped 48 // 4. Unload AppDomain completely when all scripts in it has stopped
49 // 49 //
50 50
51 51
52 private int maxScriptsPerAppDomain = 1; 52 private int maxScriptsPerAppDomain = 1;
53 53
54 /// <summary> 54 /// <summary>
55 /// Internal list of all AppDomains 55 /// Internal list of all AppDomains
56 /// </summary> 56 /// </summary>
57 private List<AppDomainStructure> appDomains = new List<AppDomainStructure>(); 57 private List<AppDomainStructure> appDomains = new List<AppDomainStructure>();
58 58
59 /// <summary> 59 /// <summary>
60 /// Structure to keep track of data around AppDomain 60 /// Structure to keep track of data around AppDomain
61 /// </summary> 61 /// </summary>
62 private class AppDomainStructure 62 private class AppDomainStructure
63 { 63 {
64 /// <summary> 64 /// <summary>
65 /// The AppDomain itself 65 /// The AppDomain itself
66 /// </summary> 66 /// </summary>
67 public AppDomain CurrentAppDomain; 67 public AppDomain CurrentAppDomain;
68 68
69 /// <summary> 69 /// <summary>
70 /// Number of scripts loaded into AppDomain 70 /// Number of scripts loaded into AppDomain
71 /// </summary> 71 /// </summary>
72 public int ScriptsLoaded; 72 public int ScriptsLoaded;
73 73
74 /// <summary> 74 /// <summary>
75 /// Number of dead scripts 75 /// Number of dead scripts
76 /// </summary> 76 /// </summary>
77 public int ScriptsWaitingUnload; 77 public int ScriptsWaitingUnload;
78 } 78 }
79 79
80 /// <summary> 80 /// <summary>
81 /// Current AppDomain 81 /// Current AppDomain
82 /// </summary> 82 /// </summary>
83 private AppDomainStructure currentAD; 83 private AppDomainStructure currentAD;
84 84
85 private object getLock = new object(); // Mutex 85 private object getLock = new object(); // Mutex
86 private object freeLock = new object(); // Mutex 86 private object freeLock = new object(); // Mutex
87 87
88 //private ScriptEngine m_scriptEngine; 88 //private ScriptEngine m_scriptEngine;
89 //public AppDomainManager(ScriptEngine scriptEngine) 89 //public AppDomainManager(ScriptEngine scriptEngine)
90 public AppDomainManager() 90 public AppDomainManager()
91 { 91 {
92 //m_scriptEngine = scriptEngine; 92 //m_scriptEngine = scriptEngine;
93 } 93 }
94 94
95 /// <summary> 95 /// <summary>
96 /// Find a free AppDomain, creating one if necessary 96 /// Find a free AppDomain, creating one if necessary
97 /// </summary> 97 /// </summary>
98 /// <returns>Free AppDomain</returns> 98 /// <returns>Free AppDomain</returns>
99 private AppDomainStructure GetFreeAppDomain() 99 private AppDomainStructure GetFreeAppDomain()
100 { 100 {
101 Console.WriteLine("Finding free AppDomain"); 101 Console.WriteLine("Finding free AppDomain");
102 lock (getLock) 102 lock (getLock)
103 { 103 {
104 // Current full? 104 // Current full?
105 if (currentAD != null && currentAD.ScriptsLoaded >= maxScriptsPerAppDomain) 105 if (currentAD != null && currentAD.ScriptsLoaded >= maxScriptsPerAppDomain)
106 { 106 {
107 // Add it to AppDomains list and empty current 107 // Add it to AppDomains list and empty current
108 appDomains.Add(currentAD); 108 appDomains.Add(currentAD);
109 currentAD = null; 109 currentAD = null;
110 } 110 }
111 // No current 111 // No current
112 if (currentAD == null) 112 if (currentAD == null)
113 { 113 {
114 // Create a new current AppDomain 114 // Create a new current AppDomain
115 currentAD = new AppDomainStructure(); 115 currentAD = new AppDomainStructure();
116 currentAD.CurrentAppDomain = PrepareNewAppDomain(); 116 currentAD.CurrentAppDomain = PrepareNewAppDomain();
117 } 117 }
118 118
119 Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded); 119 Console.WriteLine("Scripts loaded in this Appdomain: " + currentAD.ScriptsLoaded);
120 return currentAD; 120 return currentAD;
121 } // lock 121 } // lock
122 } 122 }
123 123
124 private int AppDomainNameCount; 124 private int AppDomainNameCount;
125 125
126 /// <summary> 126 /// <summary>
127 /// Create and prepare a new AppDomain for scripts 127 /// Create and prepare a new AppDomain for scripts
128 /// </summary> 128 /// </summary>
129 /// <returns>The new AppDomain</returns> 129 /// <returns>The new AppDomain</returns>
130 private AppDomain PrepareNewAppDomain() 130 private AppDomain PrepareNewAppDomain()
131 { 131 {
132 // Create and prepare a new AppDomain 132 // Create and prepare a new AppDomain
133 AppDomainNameCount++; 133 AppDomainNameCount++;
134 // TODO: Currently security match current appdomain 134 // TODO: Currently security match current appdomain
135 135
136 // Construct and initialize settings for a second AppDomain. 136 // Construct and initialize settings for a second AppDomain.
137 AppDomainSetup ads = new AppDomainSetup(); 137 AppDomainSetup ads = new AppDomainSetup();
138 ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory; 138 ads.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;
139 ads.DisallowBindingRedirects = false; 139 ads.DisallowBindingRedirects = false;
140 ads.DisallowCodeDownload = true; 140 ads.DisallowCodeDownload = true;
141 ads.LoaderOptimization = LoaderOptimization.MultiDomain; // Sounds good ;) 141 ads.LoaderOptimization = LoaderOptimization.MultiDomain; // Sounds good ;)
142 ads.ShadowCopyFiles = "true"; // Enabled shadowing 142 ads.ShadowCopyFiles = "true"; // Enabled shadowing
143 ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile; 143 ads.ConfigurationFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;
144 144
145 AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads); 145 AppDomain AD = AppDomain.CreateDomain("ScriptAppDomain_" + AppDomainNameCount, null, ads);
146 Console.WriteLine("Loading: " + 146 Console.WriteLine("Loading: " +
147 AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString()); 147 AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll").ToString());
148 AD.Load(AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll")); 148 AD.Load(AssemblyName.GetAssemblyName("OpenSim.Region.ScriptEngine.Common.dll"));
149 149
150 // Return the new AppDomain 150 // Return the new AppDomain
151 return AD; 151 return AD;
152 } 152 }
153 153
154 /// <summary> 154 /// <summary>
155 /// Unload appdomains that are full and have only dead scripts 155 /// Unload appdomains that are full and have only dead scripts
156 /// </summary> 156 /// </summary>
157 private void UnloadAppDomains() 157 private void UnloadAppDomains()
158 { 158 {
159 lock (freeLock) 159 lock (freeLock)
160 { 160 {
161 // Go through all 161 // Go through all
162 foreach (AppDomainStructure ads in new ArrayList(appDomains)) 162 foreach (AppDomainStructure ads in new ArrayList(appDomains))
163 { 163 {
164 // Don't process current AppDomain 164 // Don't process current AppDomain
165 if (ads.CurrentAppDomain != currentAD.CurrentAppDomain) 165 if (ads.CurrentAppDomain != currentAD.CurrentAppDomain)
166 { 166 {
167 // Not current AppDomain 167 // Not current AppDomain
168 // Is number of unloaded bigger or equal to number of loaded? 168 // Is number of unloaded bigger or equal to number of loaded?
169 if (ads.ScriptsLoaded <= ads.ScriptsWaitingUnload) 169 if (ads.ScriptsLoaded <= ads.ScriptsWaitingUnload)
170 { 170 {
171 Console.WriteLine("Found empty AppDomain, unloading"); 171 Console.WriteLine("Found empty AppDomain, unloading");
172 // Remove from internal list 172 // Remove from internal list
173 appDomains.Remove(ads); 173 appDomains.Remove(ads);
174#if DEBUG 174#if DEBUG
175 long m = GC.GetTotalMemory(true); 175 long m = GC.GetTotalMemory(true);
176#endif 176#endif
177 // Unload 177 // Unload
178 AppDomain.Unload(ads.CurrentAppDomain); 178 AppDomain.Unload(ads.CurrentAppDomain);
179#if DEBUG 179#if DEBUG
180 Console.WriteLine("AppDomain unload freed " + (m - GC.GetTotalMemory(true)) + 180 Console.WriteLine("AppDomain unload freed " + (m - GC.GetTotalMemory(true)) +
181 " bytes of memory"); 181 " bytes of memory");
182#endif 182#endif
183 } 183 }
184 } 184 }
185 } // foreach 185 } // foreach
186 } // lock 186 } // lock
187 } 187 }
188 188
189 189
190 public IScript LoadScript(string FileName) 190 public IScript LoadScript(string FileName)
191 { 191 {
192 // Find next available AppDomain to put it in 192 // Find next available AppDomain to put it in
193 AppDomainStructure FreeAppDomain = GetFreeAppDomain(); 193 AppDomainStructure FreeAppDomain = GetFreeAppDomain();
194 194
195 Console.WriteLine("Loading into AppDomain: " + FileName); 195 Console.WriteLine("Loading into AppDomain: " + FileName);
196 IScript mbrt = 196 IScript mbrt =
197 (IScript) 197 (IScript)
198 FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script"); 198 FreeAppDomain.CurrentAppDomain.CreateInstanceFromAndUnwrap(FileName, "SecondLife.Script");
199 //Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt)); 199 //Console.WriteLine("ScriptEngine AppDomainManager: is proxy={0}", RemotingServices.IsTransparentProxy(mbrt));
200 FreeAppDomain.ScriptsLoaded++; 200 FreeAppDomain.ScriptsLoaded++;
201 201
202 return mbrt; 202 return mbrt;
203 } 203 }
204 204
205 205
206 /// <summary> 206 /// <summary>
207 /// Increase "dead script" counter for an AppDomain 207 /// Increase "dead script" counter for an AppDomain
208 /// </summary> 208 /// </summary>
209 /// <param name="ad"></param> 209 /// <param name="ad"></param>
210 //[Obsolete("Needs fixing, needs a real purpose in life!!!")] 210 //[Obsolete("Needs fixing, needs a real purpose in life!!!")]
211 public void StopScript(AppDomain ad) 211 public void StopScript(AppDomain ad)
212 { 212 {
213 lock (freeLock) 213 lock (freeLock)
214 { 214 {
215 Console.WriteLine("Stopping script in AppDomain"); 215 Console.WriteLine("Stopping script in AppDomain");
216 // Check if it is current AppDomain 216 // Check if it is current AppDomain
217 if (currentAD.CurrentAppDomain == ad) 217 if (currentAD.CurrentAppDomain == ad)
218 { 218 {
219 // Yes - increase 219 // Yes - increase
220 currentAD.ScriptsWaitingUnload++; 220 currentAD.ScriptsWaitingUnload++;
221 return; 221 return;
222 } 222 }
223 223
224 // Lopp through all AppDomains 224 // Lopp through all AppDomains
225 foreach (AppDomainStructure ads in new ArrayList(appDomains)) 225 foreach (AppDomainStructure ads in new ArrayList(appDomains))
226 { 226 {
227 if (ads.CurrentAppDomain == ad) 227 if (ads.CurrentAppDomain == ad)
228 { 228 {
229 // Found it 229 // Found it
230 ads.ScriptsWaitingUnload++; 230 ads.ScriptsWaitingUnload++;
231 break; 231 break;
232 } 232 }
233 } // foreach 233 } // foreach
234 } // lock 234 } // lock
235 235
236 UnloadAppDomains(); // Outsite lock, has its own GetLock 236 UnloadAppDomains(); // Outsite lock, has its own GetLock
237 } 237 }
238 } 238 }
239} \ No newline at end of file 239} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs
index b2eea38..bce26ff 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/Common.cs
@@ -1,58 +1,58 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29 29
30namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 30namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
31{ 31{
32 public static class Common 32 public static class Common
33 { 33 {
34 public static bool debug = true; 34 public static bool debug = true;
35 public static ScriptEngine mySE; 35 public static ScriptEngine mySE;
36 36
37 // This class just contains some static log stuff used for debugging. 37 // This class just contains some static log stuff used for debugging.
38 38
39 //public delegate void SendToDebugEventDelegate(string Message); 39 //public delegate void SendToDebugEventDelegate(string Message);
40 //public delegate void SendToLogEventDelegate(string Message); 40 //public delegate void SendToLogEventDelegate(string Message);
41 //static public event SendToDebugEventDelegate SendToDebugEvent; 41 //static public event SendToDebugEventDelegate SendToDebugEvent;
42 //static public event SendToLogEventDelegate SendToLogEvent; 42 //static public event SendToLogEventDelegate SendToLogEvent;
43 43
44 public static void SendToDebug(string Message) 44 public static void SendToDebug(string Message)
45 { 45 {
46 //if (Debug == true) 46 //if (Debug == true)
47 mySE.Log.Verbose("ScriptEngine", "Debug: " + Message); 47 mySE.Log.Verbose("ScriptEngine", "Debug: " + Message);
48 //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); 48 //SendToDebugEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
49 } 49 }
50 50
51 public static void SendToLog(string Message) 51 public static void SendToLog(string Message)
52 { 52 {
53 //if (Debug == true) 53 //if (Debug == true)
54 mySE.Log.Verbose("ScriptEngine", "LOG: " + Message); 54 mySE.Log.Verbose("ScriptEngine", "LOG: " + Message);
55 //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message); 55 //SendToLogEvent("\r\n" + DateTime.Now.ToString("[HH:mm:ss] ") + Message);
56 } 56 }
57 } 57 }
58} \ No newline at end of file 58} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
index 07476ac..6df8343 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventManager.cs
@@ -1,260 +1,260 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29 29
30using System; 30using System;
31using libsecondlife; 31using libsecondlife;
32using OpenSim.Framework; 32using OpenSim.Framework;
33 33
34namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 34namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
35{ 35{
36 /// <summary> 36 /// <summary>
37 /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it. 37 /// Prepares events so they can be directly executed upon a script by EventQueueManager, then queues it.
38 /// </summary> 38 /// </summary>
39 [Serializable] 39 [Serializable]
40 public class EventManager : OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.RemoteEvents 40 public class EventManager : OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.RemoteEvents
41 { 41 {
42 42
43 // 43 //
44 // Class is instanced in "ScriptEngine" and Uses "EventQueueManager" that is also instanced in "ScriptEngine". 44 // Class is instanced in "ScriptEngine" and Uses "EventQueueManager" that is also instanced in "ScriptEngine".
45 // This class needs a bit of explaining: 45 // This class needs a bit of explaining:
46 // 46 //
47 // This class it the link between an event inside OpenSim and the corresponding event in a user script being executed. 47 // This class it the link between an event inside OpenSim and the corresponding event in a user script being executed.
48 // 48 //
49 // For example when an user touches an object then the "myScriptEngine.World.EventManager.OnObjectGrab" event is fired inside OpenSim. 49 // For example when an user touches an object then the "myScriptEngine.World.EventManager.OnObjectGrab" event is fired inside OpenSim.
50 // We hook up to this event and queue a touch_start in EventQueueManager with the proper LSL parameters. 50 // We hook up to this event and queue a touch_start in EventQueueManager with the proper LSL parameters.
51 // It will then be delivered to the script by EventQueueManager. 51 // It will then be delivered to the script by EventQueueManager.
52 // 52 //
53 // You can check debug C# dump of an LSL script if you need to verify what exact parameters are needed. 53 // You can check debug C# dump of an LSL script if you need to verify what exact parameters are needed.
54 // 54 //
55 55
56 56
57 private ScriptEngine myScriptEngine; 57 private ScriptEngine myScriptEngine;
58 //public IScriptHost TEMP_OBJECT_ID; 58 //public IScriptHost TEMP_OBJECT_ID;
59 public EventManager(ScriptEngine _ScriptEngine, bool performHookUp) 59 public EventManager(ScriptEngine _ScriptEngine, bool performHookUp)
60 { 60 {
61 myScriptEngine = _ScriptEngine; 61 myScriptEngine = _ScriptEngine;
62 62
63 // Hook up to events from OpenSim 63 // Hook up to events from OpenSim
64 // We may not want to do it because someone is controlling us and will deliver events to us 64 // We may not want to do it because someone is controlling us and will deliver events to us
65 if (performHookUp) 65 if (performHookUp)
66 { 66 {
67 myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events"); 67 myScriptEngine.Log.Verbose("ScriptEngine", "Hooking up to server events");
68 myScriptEngine.World.EventManager.OnObjectGrab += touch_start; 68 myScriptEngine.World.EventManager.OnObjectGrab += touch_start;
69 myScriptEngine.World.EventManager.OnRezScript += OnRezScript; 69 myScriptEngine.World.EventManager.OnRezScript += OnRezScript;
70 myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript; 70 myScriptEngine.World.EventManager.OnRemoveScript += OnRemoveScript;
71 // TODO: HOOK ALL EVENTS UP TO SERVER! 71 // TODO: HOOK ALL EVENTS UP TO SERVER!
72 } 72 }
73 } 73 }
74 74
75 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient) 75 public void touch_start(uint localID, LLVector3 offsetPos, IClientAPI remoteClient)
76 { 76 {
77 // Add to queue for all scripts in ObjectID object 77 // Add to queue for all scripts in ObjectID object
78 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1}); 78 myScriptEngine.m_EventQueueManager.AddToObjectQueue(localID, "touch_start", new object[] {(int) 1});
79 } 79 }
80 80
81 public void OnRezScript(uint localID, LLUUID itemID, string script) 81 public void OnRezScript(uint localID, LLUUID itemID, string script)
82 { 82 {
83 Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " + 83 Console.WriteLine("OnRezScript localID: " + localID + " LLUID: " + itemID.ToString() + " Size: " +
84 script.Length); 84 script.Length);
85 myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script); 85 myScriptEngine.m_ScriptManager.StartScript(localID, itemID, script);
86 } 86 }
87 87
88 public void OnRemoveScript(uint localID, LLUUID itemID) 88 public void OnRemoveScript(uint localID, LLUUID itemID)
89 { 89 {
90 Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString()); 90 Console.WriteLine("OnRemoveScript localID: " + localID + " LLUID: " + itemID.ToString());
91 myScriptEngine.m_ScriptManager.StopScript( 91 myScriptEngine.m_ScriptManager.StopScript(
92 localID, 92 localID,
93 itemID 93 itemID
94 ); 94 );
95 } 95 }
96 96
97 // TODO: Replace placeholders below 97 // TODO: Replace placeholders below
98 // NOTE! THE PARAMETERS FOR THESE FUNCTIONS ARE NOT CORRECT! 98 // NOTE! THE PARAMETERS FOR THESE FUNCTIONS ARE NOT CORRECT!
99 // These needs to be hooked up to OpenSim during init of this class 99 // These needs to be hooked up to OpenSim during init of this class
100 // then queued in EventQueueManager. 100 // then queued in EventQueueManager.
101 // When queued in EventQueueManager they need to be LSL compatible (name and params) 101 // When queued in EventQueueManager they need to be LSL compatible (name and params)
102 102
103 public void state_exit(uint localID, LLUUID itemID) 103 public void state_exit(uint localID, LLUUID itemID)
104 { 104 {
105 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_exit"); 105 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "state_exit");
106 } 106 }
107 107
108 public void touch(uint localID, LLUUID itemID) 108 public void touch(uint localID, LLUUID itemID)
109 { 109 {
110 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch"); 110 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch");
111 } 111 }
112 112
113 public void touch_end(uint localID, LLUUID itemID) 113 public void touch_end(uint localID, LLUUID itemID)
114 { 114 {
115 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end"); 115 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "touch_end");
116 } 116 }
117 117
118 public void collision_start(uint localID, LLUUID itemID) 118 public void collision_start(uint localID, LLUUID itemID)
119 { 119 {
120 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start"); 120 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_start");
121 } 121 }
122 122
123 public void collision(uint localID, LLUUID itemID) 123 public void collision(uint localID, LLUUID itemID)
124 { 124 {
125 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision"); 125 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision");
126 } 126 }
127 127
128 public void collision_end(uint localID, LLUUID itemID) 128 public void collision_end(uint localID, LLUUID itemID)
129 { 129 {
130 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end"); 130 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "collision_end");
131 } 131 }
132 132
133 public void land_collision_start(uint localID, LLUUID itemID) 133 public void land_collision_start(uint localID, LLUUID itemID)
134 { 134 {
135 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start"); 135 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_start");
136 } 136 }
137 137
138 public void land_collision(uint localID, LLUUID itemID) 138 public void land_collision(uint localID, LLUUID itemID)
139 { 139 {
140 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision"); 140 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision");
141 } 141 }
142 142
143 public void land_collision_end(uint localID, LLUUID itemID) 143 public void land_collision_end(uint localID, LLUUID itemID)
144 { 144 {
145 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_end"); 145 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "land_collision_end");
146 } 146 }
147 147
148 // Handled by long commands 148 // Handled by long commands
149 public void timer(uint localID, LLUUID itemID) 149 public void timer(uint localID, LLUUID itemID)
150 { 150 {
151 //myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, ""); 151 //myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "");
152 } 152 }
153 153
154 public void listen(uint localID, LLUUID itemID) 154 public void listen(uint localID, LLUUID itemID)
155 { 155 {
156 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "listen"); 156 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "listen");
157 } 157 }
158 158
159 public void on_rez(uint localID, LLUUID itemID) 159 public void on_rez(uint localID, LLUUID itemID)
160 { 160 {
161 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "on_rez"); 161 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "on_rez");
162 } 162 }
163 163
164 public void sensor(uint localID, LLUUID itemID) 164 public void sensor(uint localID, LLUUID itemID)
165 { 165 {
166 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "sensor"); 166 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "sensor");
167 } 167 }
168 168
169 public void no_sensor(uint localID, LLUUID itemID) 169 public void no_sensor(uint localID, LLUUID itemID)
170 { 170 {
171 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor"); 171 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "no_sensor");
172 } 172 }
173 173
174 public void control(uint localID, LLUUID itemID) 174 public void control(uint localID, LLUUID itemID)
175 { 175 {
176 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control"); 176 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "control");
177 } 177 }
178 178
179 public void money(uint localID, LLUUID itemID) 179 public void money(uint localID, LLUUID itemID)
180 { 180 {
181 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "money"); 181 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "money");
182 } 182 }
183 183
184 public void email(uint localID, LLUUID itemID) 184 public void email(uint localID, LLUUID itemID)
185 { 185 {
186 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email"); 186 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "email");
187 } 187 }
188 188
189 public void at_target(uint localID, LLUUID itemID) 189 public void at_target(uint localID, LLUUID itemID)
190 { 190 {
191 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target"); 191 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_target");
192 } 192 }
193 193
194 public void not_at_target(uint localID, LLUUID itemID) 194 public void not_at_target(uint localID, LLUUID itemID)
195 { 195 {
196 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target"); 196 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_target");
197 } 197 }
198 198
199 public void at_rot_target(uint localID, LLUUID itemID) 199 public void at_rot_target(uint localID, LLUUID itemID)
200 { 200 {
201 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_rot_target"); 201 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "at_rot_target");
202 } 202 }
203 203
204 public void not_at_rot_target(uint localID, LLUUID itemID) 204 public void not_at_rot_target(uint localID, LLUUID itemID)
205 { 205 {
206 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_rot_target"); 206 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "not_at_rot_target");
207 } 207 }
208 208
209 public void run_time_permissions(uint localID, LLUUID itemID) 209 public void run_time_permissions(uint localID, LLUUID itemID)
210 { 210 {
211 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "run_time_permissions"); 211 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "run_time_permissions");
212 } 212 }
213 213
214 public void changed(uint localID, LLUUID itemID) 214 public void changed(uint localID, LLUUID itemID)
215 { 215 {
216 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "changed"); 216 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "changed");
217 } 217 }
218 218
219 public void attach(uint localID, LLUUID itemID) 219 public void attach(uint localID, LLUUID itemID)
220 { 220 {
221 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "attach"); 221 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "attach");
222 } 222 }
223 223
224 public void dataserver(uint localID, LLUUID itemID) 224 public void dataserver(uint localID, LLUUID itemID)
225 { 225 {
226 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "dataserver"); 226 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "dataserver");
227 } 227 }
228 228
229 public void link_message(uint localID, LLUUID itemID) 229 public void link_message(uint localID, LLUUID itemID)
230 { 230 {
231 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "link_message"); 231 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "link_message");
232 } 232 }
233 233
234 public void moving_start(uint localID, LLUUID itemID) 234 public void moving_start(uint localID, LLUUID itemID)
235 { 235 {
236 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_start"); 236 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_start");
237 } 237 }
238 238
239 public void moving_end(uint localID, LLUUID itemID) 239 public void moving_end(uint localID, LLUUID itemID)
240 { 240 {
241 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_end"); 241 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "moving_end");
242 } 242 }
243 243
244 public void object_rez(uint localID, LLUUID itemID) 244 public void object_rez(uint localID, LLUUID itemID)
245 { 245 {
246 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "object_rez"); 246 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "object_rez");
247 } 247 }
248 248
249 public void remote_data(uint localID, LLUUID itemID) 249 public void remote_data(uint localID, LLUUID itemID)
250 { 250 {
251 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "remote_data"); 251 myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "remote_data");
252 } 252 }
253 253
254 // Handled by long commands 254 // Handled by long commands
255 public void http_response(uint localID, LLUUID itemID) 255 public void http_response(uint localID, LLUUID itemID)
256 { 256 {
257 // myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "http_response"); 257 // myScriptEngine.m_EventQueueManager.AddToScriptQueue(localID, itemID, "http_response");
258 } 258 }
259 } 259 }
260} \ No newline at end of file 260} \ 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 ad9ff45..8081e2c 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/EventQueueManager.cs
@@ -1,364 +1,364 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29 29
30using System; 30using System;
31using System.Collections; 31using System.Collections;
32using System.Collections.Generic; 32using System.Collections.Generic;
33using System.Threading; 33using System.Threading;
34using libsecondlife; 34using libsecondlife;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.Environment.Scenes.Scripting; 36using OpenSim.Region.Environment.Scenes.Scripting;
37 37
38namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 38namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// EventQueueManager handles event queues 41 /// EventQueueManager handles event queues
42 /// Events are queued and executed in separate thread 42 /// Events are queued and executed in separate thread
43 /// </summary> 43 /// </summary>
44 [Serializable] 44 [Serializable]
45 public class EventQueueManager 45 public class EventQueueManager
46 { 46 {
47 47
48 // 48 //
49 // Class is instanced in "ScriptEngine" and used by "EventManager" also instanced in "ScriptEngine". 49 // Class is instanced in "ScriptEngine" and used by "EventManager" also instanced in "ScriptEngine".
50 // 50 //
51 // Class purpose is to queue and execute functions that are received by "EventManager": 51 // Class purpose is to queue and execute functions that are received by "EventManager":
52 // - allowing "EventManager" to release its event thread immediately, thus not interrupting server execution. 52 // - allowing "EventManager" to release its event thread immediately, thus not interrupting server execution.
53 // - allowing us to prioritize and control execution of script functions. 53 // - allowing us to prioritize and control execution of script functions.
54 // Class can use multiple threads for simultaneous execution. Mutexes are used for thread safety. 54 // Class can use multiple threads for simultaneous execution. Mutexes are used for thread safety.
55 // 55 //
56 // 1. Hold an execution queue for scripts 56 // 1. Hold an execution queue for scripts
57 // 2. Use threads to process queue, each thread executes one script function on each pass. 57 // 2. Use threads to process queue, each thread executes one script function on each pass.
58 // 3. Catch any script error and process it 58 // 3. Catch any script error and process it
59 // 59 //
60 // 60 //
61 // Notes: 61 // Notes:
62 // * Current execution load balancing is optimized for 1 thread, and can cause unfair execute balancing between scripts. 62 // * Current execution load balancing is optimized for 1 thread, and can cause unfair execute balancing between scripts.
63 // Not noticeable unless server is under high load. 63 // Not noticeable unless server is under high load.
64 // * This class contains the number of threads used for script executions. Since we are not microthreading scripts yet, 64 // * This class contains the number of threads used for script executions. Since we are not microthreading scripts yet,
65 // increase number of threads to allow more concurrent script executions in OpenSim. 65 // increase number of threads to allow more concurrent script executions in OpenSim.
66 // 66 //
67 67
68 68
69 /// <summary> 69 /// <summary>
70 /// List of threads processing event queue 70 /// List of threads processing event queue
71 /// </summary> 71 /// </summary>
72 private List<Thread> eventQueueThreads = new List<Thread>(); 72 private List<Thread> eventQueueThreads = new List<Thread>();
73 73
74 private object queueLock = new object(); // Mutex lock object 74 private object queueLock = new object(); // Mutex lock object
75 75
76 /// <summary> 76 /// <summary>
77 /// How many ms to sleep if queue is empty 77 /// How many ms to sleep if queue is empty
78 /// </summary> 78 /// </summary>
79 private int nothingToDoSleepms = 50; 79 private int nothingToDoSleepms = 50;
80 80
81 /// <summary> 81 /// <summary>
82 /// How many threads to process queue with 82 /// How many threads to process queue with
83 /// </summary> 83 /// </summary>
84 private int numberOfThreads = 2; 84 private int numberOfThreads = 2;
85 85
86 /// <summary> 86 /// <summary>
87 /// Queue containing events waiting to be executed 87 /// Queue containing events waiting to be executed
88 /// </summary> 88 /// </summary>
89 private Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>(); 89 private Queue<QueueItemStruct> eventQueue = new Queue<QueueItemStruct>();
90 90
91 /// <summary> 91 /// <summary>
92 /// Queue item structure 92 /// Queue item structure
93 /// </summary> 93 /// </summary>
94 private struct QueueItemStruct 94 private struct QueueItemStruct
95 { 95 {
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 object[] param; 99 public object[] param;
100 } 100 }
101 101
102 /// <summary> 102 /// <summary>
103 /// List of localID locks for mutex processing of script events 103 /// List of localID locks for mutex processing of script events
104 /// </summary> 104 /// </summary>
105 private List<uint> objectLocks = new List<uint>(); 105 private List<uint> objectLocks = new List<uint>();
106 106
107 private object tryLockLock = new object(); // Mutex lock object 107 private object tryLockLock = new object(); // Mutex lock object
108 108
109 private ScriptEngine m_ScriptEngine; 109 private ScriptEngine m_ScriptEngine;
110 110
111 public EventQueueManager(ScriptEngine _ScriptEngine) 111 public EventQueueManager(ScriptEngine _ScriptEngine)
112 { 112 {
113 m_ScriptEngine = _ScriptEngine; 113 m_ScriptEngine = _ScriptEngine;
114 114
115 // 115 //
116 // Start event queue processing threads (worker threads) 116 // Start event queue processing threads (worker threads)
117 // 117 //
118 for (int ThreadCount = 0; ThreadCount <= numberOfThreads; ThreadCount++) 118 for (int ThreadCount = 0; ThreadCount <= numberOfThreads; ThreadCount++)
119 { 119 {
120 Thread EventQueueThread = new Thread(EventQueueThreadLoop); 120 Thread EventQueueThread = new Thread(EventQueueThreadLoop);
121 eventQueueThreads.Add(EventQueueThread); 121 eventQueueThreads.Add(EventQueueThread);
122 EventQueueThread.IsBackground = true; 122 EventQueueThread.IsBackground = true;
123 EventQueueThread.Priority = ThreadPriority.BelowNormal; 123 EventQueueThread.Priority = ThreadPriority.BelowNormal;
124 EventQueueThread.Name = "EventQueueManagerThread_" + ThreadCount; 124 EventQueueThread.Name = "EventQueueManagerThread_" + ThreadCount;
125 EventQueueThread.Start(); 125 EventQueueThread.Start();
126 } 126 }
127 } 127 }
128 128
129 ~EventQueueManager() 129 ~EventQueueManager()
130 { 130 {
131 // Kill worker threads 131 // Kill worker threads
132 foreach (Thread EventQueueThread in new ArrayList(eventQueueThreads)) 132 foreach (Thread EventQueueThread in new ArrayList(eventQueueThreads))
133 { 133 {
134 if (EventQueueThread != null && EventQueueThread.IsAlive == true) 134 if (EventQueueThread != null && EventQueueThread.IsAlive == true)
135 { 135 {
136 try 136 try
137 { 137 {
138 EventQueueThread.Abort(); 138 EventQueueThread.Abort();
139 EventQueueThread.Join(); 139 EventQueueThread.Join();
140 } 140 }
141 catch (Exception) 141 catch (Exception)
142 { 142 {
143 //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString()); 143 //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Exception killing worker thread: " + e.ToString());
144 } 144 }
145 } 145 }
146 } 146 }
147 eventQueueThreads.Clear(); 147 eventQueueThreads.Clear();
148 // Todo: Clean up our queues 148 // Todo: Clean up our queues
149 eventQueue.Clear(); 149 eventQueue.Clear();
150 } 150 }
151 151
152 /// <summary> 152 /// <summary>
153 /// Queue processing thread loop 153 /// Queue processing thread loop
154 /// </summary> 154 /// </summary>
155 private void EventQueueThreadLoop() 155 private void EventQueueThreadLoop()
156 { 156 {
157 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned"); 157 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Worker thread spawned");
158 try 158 try
159 { 159 {
160 QueueItemStruct BlankQIS = new QueueItemStruct(); 160 QueueItemStruct BlankQIS = new QueueItemStruct();
161 while (true) 161 while (true)
162 { 162 {
163 try 163 try
164 { 164 {
165 QueueItemStruct QIS = BlankQIS; 165 QueueItemStruct QIS = BlankQIS;
166 bool GotItem = false; 166 bool GotItem = false;
167 167
168 if (eventQueue.Count == 0) 168 if (eventQueue.Count == 0)
169 { 169 {
170 // Nothing to do? Sleep a bit waiting for something to do 170 // Nothing to do? Sleep a bit waiting for something to do
171 Thread.Sleep(nothingToDoSleepms); 171 Thread.Sleep(nothingToDoSleepms);
172 } 172 }
173 else 173 else
174 { 174 {
175 // Something in queue, process 175 // Something in queue, process
176 //myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName); 176 //myScriptEngine.m_logger.Verbose("ScriptEngine", "Processing event for localID: " + QIS.localID + ", itemID: " + QIS.itemID + ", FunctionName: " + QIS.FunctionName);
177 177
178 // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD 178 // OBJECT BASED LOCK - TWO THREADS WORKING ON SAME OBJECT IS NOT GOOD
179 lock (queueLock) 179 lock (queueLock)
180 { 180 {
181 GotItem = false; 181 GotItem = false;
182 for (int qc = 0; qc < eventQueue.Count; qc++) 182 for (int qc = 0; qc < eventQueue.Count; qc++)
183 { 183 {
184 // Get queue item 184 // Get queue item
185 QIS = eventQueue.Dequeue(); 185 QIS = eventQueue.Dequeue();
186 186
187 // Check if object is being processed by someone else 187 // Check if object is being processed by someone else
188 if (TryLock(QIS.localID) == false) 188 if (TryLock(QIS.localID) == false)
189 { 189 {
190 // Object is already being processed, requeue it 190 // Object is already being processed, requeue it
191 eventQueue.Enqueue(QIS); 191 eventQueue.Enqueue(QIS);
192 } 192 }
193 else 193 else
194 { 194 {
195 // We have lock on an object and can process it 195 // We have lock on an object and can process it
196 GotItem = true; 196 GotItem = true;
197 break; 197 break;
198 } 198 }
199 } // go through queue 199 } // go through queue
200 } // lock 200 } // lock
201 201
202 if (GotItem == true) 202 if (GotItem == true)
203 { 203 {
204 // Execute function 204 // Execute function
205 try 205 try
206 { 206 {
207#if DEBUG 207#if DEBUG
208 m_ScriptEngine.Log.Debug("ScriptEngine", "Executing event:\r\n" 208 m_ScriptEngine.Log.Debug("ScriptEngine", "Executing event:\r\n"
209 + "QIS.localID: " + QIS.localID 209 + "QIS.localID: " + QIS.localID
210 + ", QIS.itemID: " + QIS.itemID 210 + ", QIS.itemID: " + QIS.itemID
211 + ", QIS.functionName: " + QIS.functionName); 211 + ", QIS.functionName: " + QIS.functionName);
212#endif 212#endif
213 m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID, 213 m_ScriptEngine.m_ScriptManager.ExecuteEvent(QIS.localID, QIS.itemID,
214 QIS.functionName, QIS.param); 214 QIS.functionName, QIS.param);
215 } 215 }
216 catch (Exception e) 216 catch (Exception e)
217 { 217 {
218 // DISPLAY ERROR INWORLD 218 // DISPLAY ERROR INWORLD
219 string text = "Error executing script function \"" + QIS.functionName + "\":\r\n"; 219 string text = "Error executing script function \"" + QIS.functionName + "\":\r\n";
220 //if (e.InnerException != null) 220 //if (e.InnerException != null)
221 //{ 221 //{
222 // Send inner exception 222 // Send inner exception
223 text += e.InnerException.Message.ToString(); 223 text += e.InnerException.Message.ToString();
224 //} 224 //}
225 //else 225 //else
226 //{ 226 //{
227 text += "\r\n"; 227 text += "\r\n";
228 // Send normal 228 // Send normal
229 text += e.Message.ToString(); 229 text += e.Message.ToString();
230 //} 230 //}
231 try 231 try
232 { 232 {
233 if (text.Length > 1500) 233 if (text.Length > 1500)
234 text = text.Substring(0, 1500); 234 text = text.Substring(0, 1500);
235 IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID); 235 IScriptHost m_host = m_ScriptEngine.World.GetSceneObjectPart(QIS.localID);
236 //if (m_host != null) 236 //if (m_host != null)
237 //{ 237 //{
238 m_ScriptEngine.World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0, 238 m_ScriptEngine.World.SimChat(Helpers.StringToField(text), ChatTypeEnum.Say, 0,
239 m_host.AbsolutePosition, m_host.Name, m_host.UUID); 239 m_host.AbsolutePosition, m_host.Name, m_host.UUID);
240 } 240 }
241 catch 241 catch
242 { 242 {
243 //} 243 //}
244 //else 244 //else
245 //{ 245 //{
246 // T oconsole 246 // T oconsole
247 m_ScriptEngine.Log.Error("ScriptEngine", 247 m_ScriptEngine.Log.Error("ScriptEngine",
248 "Unable to send text in-world:\r\n" + text); 248 "Unable to send text in-world:\r\n" + text);
249 } 249 }
250 } 250 }
251 finally 251 finally
252 { 252 {
253 ReleaseLock(QIS.localID); 253 ReleaseLock(QIS.localID);
254 } 254 }
255 } 255 }
256 } // Something in queue 256 } // Something in queue
257 } 257 }
258 catch (ThreadAbortException tae) 258 catch (ThreadAbortException tae)
259 { 259 {
260 throw tae; 260 throw tae;
261 } 261 }
262 catch (Exception e) 262 catch (Exception e)
263 { 263 {
264 m_ScriptEngine.Log.Error("ScriptEngine", "Exception in EventQueueThreadLoop: " + e.ToString()); 264 m_ScriptEngine.Log.Error("ScriptEngine", "Exception in EventQueueThreadLoop: " + e.ToString());
265 } 265 }
266 } // while 266 } // while
267 } // try 267 } // try
268 catch (ThreadAbortException) 268 catch (ThreadAbortException)
269 { 269 {
270 //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message); 270 //myScriptEngine.Log.Verbose("ScriptEngine", "EventQueueManager Worker thread killed: " + tae.Message);
271 } 271 }
272 } 272 }
273 273
274 /// <summary> 274 /// <summary>
275 /// Try to get a mutex lock on localID 275 /// Try to get a mutex lock on localID
276 /// </summary> 276 /// </summary>
277 /// <param name="localID"></param> 277 /// <param name="localID"></param>
278 /// <returns></returns> 278 /// <returns></returns>
279 private bool TryLock(uint localID) 279 private bool TryLock(uint localID)
280 { 280 {
281 lock (tryLockLock) 281 lock (tryLockLock)
282 { 282 {
283 if (objectLocks.Contains(localID) == true) 283 if (objectLocks.Contains(localID) == true)
284 { 284 {
285 return false; 285 return false;
286 } 286 }
287 else 287 else
288 { 288 {
289 objectLocks.Add(localID); 289 objectLocks.Add(localID);
290 return true; 290 return true;
291 } 291 }
292 } 292 }
293 } 293 }
294 294
295 /// <summary> 295 /// <summary>
296 /// Release mutex lock on localID 296 /// Release mutex lock on localID
297 /// </summary> 297 /// </summary>
298 /// <param name="localID"></param> 298 /// <param name="localID"></param>
299 private void ReleaseLock(uint localID) 299 private void ReleaseLock(uint localID)
300 { 300 {
301 lock (tryLockLock) 301 lock (tryLockLock)
302 { 302 {
303 if (objectLocks.Contains(localID) == true) 303 if (objectLocks.Contains(localID) == true)
304 { 304 {
305 objectLocks.Remove(localID); 305 objectLocks.Remove(localID);
306 } 306 }
307 } 307 }
308 } 308 }
309 309
310 310
311 /// <summary> 311 /// <summary>
312 /// Add event to event execution queue 312 /// Add event to event execution queue
313 /// </summary> 313 /// </summary>
314 /// <param name="localID"></param> 314 /// <param name="localID"></param>
315 /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> 315 /// <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> 316 /// <param name="param">Array of parameters to match event mask</param>
317 public void AddToObjectQueue(uint localID, string FunctionName, params object[] param) 317 public void AddToObjectQueue(uint localID, string FunctionName, params object[] param)
318 { 318 {
319 // Determine all scripts in Object and add to their queue 319 // Determine all scripts in Object and add to their queue
320 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName); 320 //myScriptEngine.m_logger.Verbose("ScriptEngine", "EventQueueManager Adding localID: " + localID + ", FunctionName: " + FunctionName);
321 321
322 322
323 // Do we have any scripts in this object at all? If not, return 323 // Do we have any scripts in this object at all? If not, return
324 if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false) 324 if (m_ScriptEngine.m_ScriptManager.Scripts.ContainsKey(localID) == false)
325 { 325 {
326 //Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID."); 326 //Console.WriteLine("Event \"" + FunctionName + "\" for localID: " + localID + ". No scripts found on this localID.");
327 return; 327 return;
328 } 328 }
329 329
330 Dictionary<LLUUID, IScript>.KeyCollection scriptKeys = 330 Dictionary<LLUUID, IScript>.KeyCollection scriptKeys =
331 m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID); 331 m_ScriptEngine.m_ScriptManager.GetScriptKeys(localID);
332 332
333 foreach (LLUUID itemID in scriptKeys) 333 foreach (LLUUID itemID in scriptKeys)
334 { 334 {
335 // Add to each script in that object 335 // 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? 336 // TODO: Some scripts may not subscribe to this event. Should we NOT add it? Does it matter?
337 AddToScriptQueue(localID, itemID, FunctionName, param); 337 AddToScriptQueue(localID, itemID, FunctionName, param);
338 } 338 }
339 } 339 }
340 340
341 /// <summary> 341 /// <summary>
342 /// Add event to event execution queue 342 /// Add event to event execution queue
343 /// </summary> 343 /// </summary>
344 /// <param name="localID"></param> 344 /// <param name="localID"></param>
345 /// <param name="itemID"></param> 345 /// <param name="itemID"></param>
346 /// <param name="FunctionName">Name of the function, will be state + "_event_" + FunctionName</param> 346 /// <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> 347 /// <param name="param">Array of parameters to match event mask</param>
348 public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, params object[] param) 348 public void AddToScriptQueue(uint localID, LLUUID itemID, string FunctionName, params object[] param)
349 { 349 {
350 lock (queueLock) 350 lock (queueLock)
351 { 351 {
352 // Create a structure and add data 352 // Create a structure and add data
353 QueueItemStruct QIS = new QueueItemStruct(); 353 QueueItemStruct QIS = new QueueItemStruct();
354 QIS.localID = localID; 354 QIS.localID = localID;
355 QIS.itemID = itemID; 355 QIS.itemID = itemID;
356 QIS.functionName = FunctionName; 356 QIS.functionName = FunctionName;
357 QIS.param = param; 357 QIS.param = param;
358 358
359 // Add it to queue 359 // Add it to queue
360 eventQueue.Enqueue(QIS); 360 eventQueue.Enqueue(QIS);
361 } 361 }
362 } 362 }
363 } 363 }
364} \ No newline at end of file 364} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs
index 94241eb..635c32a 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/LSLLongCmdHandler.cs
@@ -1,295 +1,295 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29using System; 29using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using System.Threading; 31using System.Threading;
32using libsecondlife; 32using libsecondlife;
33using OpenSim.Region.Environment.Interfaces; 33using OpenSim.Region.Environment.Interfaces;
34using OpenSim.Region.Environment.Modules; 34using OpenSim.Region.Environment.Modules;
35 35
36namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 36namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
37{ 37{
38 /// <summary> 38 /// <summary>
39 /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc. 39 /// Handles LSL commands that takes long time and returns an event, for example timers, HTTP requests, etc.
40 /// </summary> 40 /// </summary>
41 public class LSLLongCmdHandler 41 public class LSLLongCmdHandler
42 { 42 {
43 private Thread cmdHandlerThread; 43 private Thread cmdHandlerThread;
44 private int cmdHandlerThreadCycleSleepms = 100; 44 private int cmdHandlerThreadCycleSleepms = 100;
45 45
46 private ScriptEngine m_ScriptEngine; 46 private ScriptEngine m_ScriptEngine;
47 47
48 public LSLLongCmdHandler(ScriptEngine _ScriptEngine) 48 public LSLLongCmdHandler(ScriptEngine _ScriptEngine)
49 { 49 {
50 m_ScriptEngine = _ScriptEngine; 50 m_ScriptEngine = _ScriptEngine;
51 51
52 // Start the thread that will be doing the work 52 // Start the thread that will be doing the work
53 cmdHandlerThread = new Thread(CmdHandlerThreadLoop); 53 cmdHandlerThread = new Thread(CmdHandlerThreadLoop);
54 cmdHandlerThread.Name = "CmdHandlerThread"; 54 cmdHandlerThread.Name = "CmdHandlerThread";
55 cmdHandlerThread.Priority = ThreadPriority.BelowNormal; 55 cmdHandlerThread.Priority = ThreadPriority.BelowNormal;
56 cmdHandlerThread.IsBackground = true; 56 cmdHandlerThread.IsBackground = true;
57 cmdHandlerThread.Start(); 57 cmdHandlerThread.Start();
58 } 58 }
59 59
60 ~LSLLongCmdHandler() 60 ~LSLLongCmdHandler()
61 { 61 {
62 // Shut down thread 62 // Shut down thread
63 try 63 try
64 { 64 {
65 if (cmdHandlerThread != null) 65 if (cmdHandlerThread != null)
66 { 66 {
67 if (cmdHandlerThread.IsAlive == true) 67 if (cmdHandlerThread.IsAlive == true)
68 { 68 {
69 cmdHandlerThread.Abort(); 69 cmdHandlerThread.Abort();
70 cmdHandlerThread.Join(); 70 cmdHandlerThread.Join();
71 } 71 }
72 } 72 }
73 } 73 }
74 catch 74 catch
75 { 75 {
76 } 76 }
77 } 77 }
78 78
79 private void CmdHandlerThreadLoop() 79 private void CmdHandlerThreadLoop()
80 { 80 {
81 while (true) 81 while (true)
82 { 82 {
83 // Check timers 83 // Check timers
84 CheckTimerEvents(); 84 CheckTimerEvents();
85 Thread.Sleep(25); 85 Thread.Sleep(25);
86 // Check HttpRequests 86 // Check HttpRequests
87 CheckHttpRequests(); 87 CheckHttpRequests();
88 Thread.Sleep(25); 88 Thread.Sleep(25);
89 // Check XMLRPCRequests 89 // Check XMLRPCRequests
90 CheckXMLRPCRequests(); 90 CheckXMLRPCRequests();
91 Thread.Sleep(25); 91 Thread.Sleep(25);
92 // Check Listeners 92 // Check Listeners
93 CheckListeners(); 93 CheckListeners();
94 Thread.Sleep(25); 94 Thread.Sleep(25);
95 95
96 // Sleep before next cycle 96 // Sleep before next cycle
97 //Thread.Sleep(cmdHandlerThreadCycleSleepms); 97 //Thread.Sleep(cmdHandlerThreadCycleSleepms);
98 } 98 }
99 } 99 }
100 100
101 /// <summary> 101 /// <summary>
102 /// Remove a specific script (and all its pending commands) 102 /// Remove a specific script (and all its pending commands)
103 /// </summary> 103 /// </summary>
104 /// <param name="m_localID"></param> 104 /// <param name="m_localID"></param>
105 /// <param name="m_itemID"></param> 105 /// <param name="m_itemID"></param>
106 public void RemoveScript(uint localID, LLUUID itemID) 106 public void RemoveScript(uint localID, LLUUID itemID)
107 { 107 {
108 // Remove a specific script 108 // Remove a specific script
109 109
110 // Remove from: Timers 110 // Remove from: Timers
111 UnSetTimerEvents(localID, itemID); 111 UnSetTimerEvents(localID, itemID);
112 // Remove from: HttpRequest 112 // Remove from: HttpRequest
113 IHttpRequests iHttpReq = 113 IHttpRequests iHttpReq =
114 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); 114 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>();
115 iHttpReq.StopHttpRequest(localID, itemID); 115 iHttpReq.StopHttpRequest(localID, itemID);
116 } 116 }
117 117
118 #region TIMER 118 #region TIMER
119 119
120 // 120 //
121 // TIMER 121 // TIMER
122 // 122 //
123 private class TimerClass 123 private class TimerClass
124 { 124 {
125 public uint localID; 125 public uint localID;
126 public LLUUID itemID; 126 public LLUUID itemID;
127 public double interval; 127 public double interval;
128 public DateTime next; 128 public DateTime next;
129 } 129 }
130 130
131 private List<TimerClass> Timers = new List<TimerClass>(); 131 private List<TimerClass> Timers = new List<TimerClass>();
132 private object TimerListLock = new object(); 132 private object TimerListLock = new object();
133 133
134 public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec) 134 public void SetTimerEvent(uint m_localID, LLUUID m_itemID, double sec)
135 { 135 {
136 Console.WriteLine("SetTimerEvent"); 136 Console.WriteLine("SetTimerEvent");
137 137
138 // Always remove first, in case this is a re-set 138 // Always remove first, in case this is a re-set
139 UnSetTimerEvents(m_localID, m_itemID); 139 UnSetTimerEvents(m_localID, m_itemID);
140 if (sec == 0) // Disabling timer 140 if (sec == 0) // Disabling timer
141 return; 141 return;
142 142
143 // Add to timer 143 // Add to timer
144 TimerClass ts = new TimerClass(); 144 TimerClass ts = new TimerClass();
145 ts.localID = m_localID; 145 ts.localID = m_localID;
146 ts.itemID = m_itemID; 146 ts.itemID = m_itemID;
147 ts.interval = sec; 147 ts.interval = sec;
148 ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); 148 ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
149 lock (TimerListLock) 149 lock (TimerListLock)
150 { 150 {
151 Timers.Add(ts); 151 Timers.Add(ts);
152 } 152 }
153 } 153 }
154 154
155 public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID) 155 public void UnSetTimerEvents(uint m_localID, LLUUID m_itemID)
156 { 156 {
157 // Remove from timer 157 // Remove from timer
158 lock (TimerListLock) 158 lock (TimerListLock)
159 { 159 {
160 List<TimerClass> NewTimers = new List<TimerClass>(); 160 List<TimerClass> NewTimers = new List<TimerClass>();
161 foreach (TimerClass ts in Timers) 161 foreach (TimerClass ts in Timers)
162 { 162 {
163 if (ts.localID != m_localID && ts.itemID != m_itemID) 163 if (ts.localID != m_localID && ts.itemID != m_itemID)
164 { 164 {
165 NewTimers.Add(ts); 165 NewTimers.Add(ts);
166 } 166 }
167 } 167 }
168 Timers.Clear(); 168 Timers.Clear();
169 Timers = NewTimers; 169 Timers = NewTimers;
170 } 170 }
171 } 171 }
172 172
173 public void CheckTimerEvents() 173 public void CheckTimerEvents()
174 { 174 {
175 // Nothing to do here? 175 // Nothing to do here?
176 if (Timers.Count == 0) 176 if (Timers.Count == 0)
177 return; 177 return;
178 178
179 lock (TimerListLock) 179 lock (TimerListLock)
180 { 180 {
181 // Go through all timers 181 // Go through all timers
182 foreach (TimerClass ts in Timers) 182 foreach (TimerClass ts in Timers)
183 { 183 {
184 // Time has passed? 184 // Time has passed?
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",
189 new object[] {}); 189 new object[] {});
190 // set next interval 190 // set next interval
191 191
192 192
193 ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval); 193 ts.next = DateTime.Now.ToUniversalTime().AddSeconds(ts.interval);
194 } 194 }
195 } 195 }
196 } // lock 196 } // lock
197 } 197 }
198 198
199 #endregion 199 #endregion
200 200
201 #region HTTP REQUEST 201 #region HTTP REQUEST
202 202
203 public void CheckHttpRequests() 203 public void CheckHttpRequests()
204 { 204 {
205 if (m_ScriptEngine.World == null) 205 if (m_ScriptEngine.World == null)
206 return; 206 return;
207 207
208 IHttpRequests iHttpReq = 208 IHttpRequests iHttpReq =
209 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>(); 209 m_ScriptEngine.World.RequestModuleInterface<IHttpRequests>();
210 210
211 HttpRequestClass httpInfo = null; 211 HttpRequestClass httpInfo = null;
212 212
213 if (iHttpReq != null) 213 if (iHttpReq != null)
214 httpInfo = iHttpReq.GetNextCompletedRequest(); 214 httpInfo = iHttpReq.GetNextCompletedRequest();
215 215
216 while (httpInfo != null) 216 while (httpInfo != null)
217 { 217 {
218 //Console.WriteLine("PICKED HTTP REQ:" + httpInfo.response_body + httpInfo.status); 218 //Console.WriteLine("PICKED HTTP REQ:" + httpInfo.response_body + httpInfo.status);
219 219
220 // Deliver data to prim's remote_data handler 220 // Deliver data to prim's remote_data handler
221 // 221 //
222 // TODO: Returning null for metadata, since the lsl function 222 // TODO: Returning null for metadata, since the lsl function
223 // only returns the byte for HTTP_BODY_TRUNCATED, which is not 223 // only returns the byte for HTTP_BODY_TRUNCATED, which is not
224 // implemented here yet anyway. Should be fixed if/when maxsize 224 // implemented here yet anyway. Should be fixed if/when maxsize
225 // is supported 225 // is supported
226 226
227 object[] resobj = new object[] 227 object[] resobj = new object[]
228 { 228 {
229 httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body 229 httpInfo.reqID.ToString(), httpInfo.status, null, httpInfo.response_body
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", resobj
234 ); 234 );
235 235
236 httpInfo.Stop(); 236 httpInfo.Stop();
237 httpInfo = null; 237 httpInfo = null;
238 238
239 httpInfo = iHttpReq.GetNextCompletedRequest(); 239 httpInfo = iHttpReq.GetNextCompletedRequest();
240 } 240 }
241 } 241 }
242 242
243 #endregion 243 #endregion
244 244
245 public void CheckXMLRPCRequests() 245 public void CheckXMLRPCRequests()
246 { 246 {
247 if (m_ScriptEngine.World == null) 247 if (m_ScriptEngine.World == null)
248 return; 248 return;
249 249
250 IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>(); 250 IXMLRPC xmlrpc = m_ScriptEngine.World.RequestModuleInterface<IXMLRPC>();
251 251
252 if (xmlrpc != null) 252 if (xmlrpc != null)
253 { 253 {
254 while (xmlrpc.hasRequests()) 254 while (xmlrpc.hasRequests())
255 { 255 {
256 RPCRequestInfo rInfo = xmlrpc.GetNextRequest(); 256 RPCRequestInfo rInfo = xmlrpc.GetNextRequest();
257 //Console.WriteLine("PICKED REQUEST"); 257 //Console.WriteLine("PICKED REQUEST");
258 258
259 //Deliver data to prim's remote_data handler 259 //Deliver data to prim's remote_data handler
260 object[] resobj = new object[] 260 object[] resobj = new object[]
261 { 261 {
262 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), "", 262 2, rInfo.GetChannelKey().ToString(), rInfo.GetMessageID().ToString(), "",
263 rInfo.GetIntValue(), 263 rInfo.GetIntValue(),
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", resobj
268 ); 268 );
269 } 269 }
270 } 270 }
271 } 271 }
272 272
273 public void CheckListeners() 273 public void CheckListeners()
274 { 274 {
275 if (m_ScriptEngine.World == null) 275 if (m_ScriptEngine.World == null)
276 return; 276 return;
277 IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>(); 277 IWorldComm comms = m_ScriptEngine.World.RequestModuleInterface<IWorldComm>();
278 278
279 while (comms.HasMessages()) 279 while (comms.HasMessages())
280 { 280 {
281 ListenerInfo lInfo = comms.GetNextMessage(); 281 ListenerInfo lInfo = comms.GetNextMessage();
282 282
283 //Deliver data to prim's listen handler 283 //Deliver data to prim's listen handler
284 object[] resobj = new object[] 284 object[] resobj = new object[]
285 { 285 {
286 lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage() 286 lInfo.GetChannel(), lInfo.GetName(), lInfo.GetID().ToString(), lInfo.GetMessage()
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", resobj
291 ); 291 );
292 } 292 }
293 } 293 }
294 } 294 }
295} \ No newline at end of file 295} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
index 39d0bc3..da0baba 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptEngine.cs
@@ -1,132 +1,132 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29 29
30using System; 30using System;
31using Nini.Config; 31using Nini.Config;
32using OpenSim.Framework.Console; 32using OpenSim.Framework.Console;
33using OpenSim.Region.Environment.Interfaces; 33using OpenSim.Region.Environment.Interfaces;
34using OpenSim.Region.Environment.Scenes; 34using OpenSim.Region.Environment.Scenes;
35using OpenSim.Region.ScriptEngine.Common; 35using OpenSim.Region.ScriptEngine.Common;
36using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase; 36using OpenSim.Region.ScriptEngine.Common.ScriptEngineBase;
37 37
38namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 38namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
39{ 39{
40 /// <summary> 40 /// <summary>
41 /// This is the root object for ScriptEngine. Objects access each other trough this class. 41 /// This is the root object for ScriptEngine. Objects access each other trough this class.
42 /// </summary> 42 /// </summary>
43 /// 43 ///
44 [Serializable] 44 [Serializable]
45 public abstract class ScriptEngine : IRegionModule, OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.ScriptEngine 45 public abstract class ScriptEngine : IRegionModule, OpenSim.Region.ScriptEngine.Common.ScriptServerInterfaces.ScriptEngine
46 { 46 {
47 public Scene World; 47 public Scene World;
48 public EventManager m_EventManager; // Handles and queues incoming events from OpenSim 48 public EventManager m_EventManager; // Handles and queues incoming events from OpenSim
49 public EventQueueManager m_EventQueueManager; // Executes events 49 public EventQueueManager m_EventQueueManager; // Executes events
50 public ScriptManager m_ScriptManager; // Load, unload and execute scripts 50 public ScriptManager m_ScriptManager; // Load, unload and execute scripts
51 public AppDomainManager m_AppDomainManager; 51 public AppDomainManager m_AppDomainManager;
52 public LSLLongCmdHandler m_LSLLongCmdHandler; 52 public LSLLongCmdHandler m_LSLLongCmdHandler;
53 53
54 public ScriptManager GetScriptManager() 54 public ScriptManager GetScriptManager()
55 { 55 {
56 return _GetScriptManager(); 56 return _GetScriptManager();
57 } 57 }
58 public abstract ScriptManager _GetScriptManager(); 58 public abstract ScriptManager _GetScriptManager();
59 59
60 private LogBase m_log; 60 private LogBase m_log;
61 61
62 public ScriptEngine() 62 public ScriptEngine()
63 { 63 {
64 //Common.SendToDebug("ScriptEngine Object Initialized"); 64 //Common.SendToDebug("ScriptEngine Object Initialized");
65 Common.mySE = this; 65 Common.mySE = this;
66 } 66 }
67 67
68 public LogBase Log 68 public LogBase Log
69 { 69 {
70 get { return m_log; } 70 get { return m_log; }
71 } 71 }
72 72
73 public void InitializeEngine(Scene Sceneworld, LogBase logger, bool HookUpToServer, ScriptManager newScriptManager) 73 public void InitializeEngine(Scene Sceneworld, LogBase logger, bool HookUpToServer, ScriptManager newScriptManager)
74 { 74 {
75 World = Sceneworld; 75 World = Sceneworld;
76 m_log = logger; 76 m_log = logger;
77 77
78 Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing"); 78 Log.Verbose("ScriptEngine", "DotNet & LSL ScriptEngine initializing");
79 79
80 //m_logger.Status("ScriptEngine", "InitializeEngine"); 80 //m_logger.Status("ScriptEngine", "InitializeEngine");
81 81
82 // Create all objects we'll be using 82 // Create all objects we'll be using
83 m_EventQueueManager = new EventQueueManager(this); 83 m_EventQueueManager = new EventQueueManager(this);
84 m_EventManager = new EventManager(this, HookUpToServer); 84 m_EventManager = new EventManager(this, HookUpToServer);
85 m_ScriptManager = newScriptManager; 85 m_ScriptManager = newScriptManager;
86 //m_ScriptManager = new ScriptManager(this); 86 //m_ScriptManager = new ScriptManager(this);
87 m_AppDomainManager = new AppDomainManager(); 87 m_AppDomainManager = new AppDomainManager();
88 m_LSLLongCmdHandler = new LSLLongCmdHandler(this); 88 m_LSLLongCmdHandler = new LSLLongCmdHandler(this);
89 89
90 // Should we iterate the region for scripts that needs starting? 90 // Should we iterate the region for scripts that needs starting?
91 // Or can we assume we are loaded before anything else so we can use proper events? 91 // Or can we assume we are loaded before anything else so we can use proper events?
92 } 92 }
93 93
94 public void Shutdown() 94 public void Shutdown()
95 { 95 {
96 // We are shutting down 96 // We are shutting down
97 } 97 }
98 98
99 ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ScriptEngine.EventManager() 99 ScriptServerInterfaces.RemoteEvents ScriptServerInterfaces.ScriptEngine.EventManager()
100 { 100 {
101 return this.m_EventManager; 101 return this.m_EventManager;
102 } 102 }
103 103
104 104
105 #region IRegionModule 105 #region IRegionModule
106 106
107 public abstract void Initialise(Scene scene, IConfigSource config); 107 public abstract void Initialise(Scene scene, IConfigSource config);
108 108
109 public void PostInitialise() 109 public void PostInitialise()
110 { 110 {
111 } 111 }
112 112
113 public void Close() 113 public void Close()
114 { 114 {
115 } 115 }
116 116
117 public string Name 117 public string Name
118 { 118 {
119 get { return "DotNetEngine"; } 119 get { return "DotNetEngine"; }
120 } 120 }
121 121
122 public bool IsSharedModule 122 public bool IsSharedModule
123 { 123 {
124 get { return false; } 124 get { return false; }
125 } 125 }
126 126
127 127
128 128
129 #endregion 129 #endregion
130 130
131 } 131 }
132} \ No newline at end of file 132} \ No newline at end of file
diff --git a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
index e98ff81..8f74620 100644
--- a/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
+++ b/OpenSim/Region/ScriptEngine/Common/ScriptEngineBase/ScriptManager.cs
@@ -1,348 +1,348 @@
1/* 1/*
2* Copyright (c) Contributors, http://opensimulator.org/ 2* Copyright (c) Contributors, http://opensimulator.org/
3* See CONTRIBUTORS.TXT for a full list of copyright holders. 3* See CONTRIBUTORS.TXT for a full list of copyright holders.
4* 4*
5* Redistribution and use in source and binary forms, with or without 5* Redistribution and use in source and binary forms, with or without
6* modification, are permitted provided that the following conditions are met: 6* modification, are permitted provided that the following conditions are met:
7* * Redistributions of source code must retain the above copyright 7* * Redistributions of source code must retain the above copyright
8* notice, this list of conditions and the following disclaimer. 8* notice, this list of conditions and the following disclaimer.
9* * Redistributions in binary form must reproduce the above copyright 9* * Redistributions in binary form must reproduce the above copyright
10* notice, this list of conditions and the following disclaimer in the 10* notice, this list of conditions and the following disclaimer in the
11* documentation and/or other materials provided with the distribution. 11* documentation and/or other materials provided with the distribution.
12* * Neither the name of the OpenSim Project nor the 12* * Neither the name of the OpenSim Project nor the
13* names of its contributors may be used to endorse or promote products 13* names of its contributors may be used to endorse or promote products
14* derived from this software without specific prior written permission. 14* derived from this software without specific prior written permission.
15* 15*
16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY 16* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS AS IS AND ANY
17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY 19* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY
20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26* 26*
27*/ 27*/
28 28
29 29
30using System; 30using System;
31using System.Collections.Generic; 31using System.Collections.Generic;
32using System.IO; 32using System.IO;
33using System.Reflection; 33using System.Reflection;
34using System.Runtime.Serialization.Formatters.Binary; 34using System.Runtime.Serialization.Formatters.Binary;
35using System.Threading; 35using System.Threading;
36using libsecondlife; 36using libsecondlife;
37using OpenSim.Framework; 37using OpenSim.Framework;
38using OpenSim.Region.Environment.Scenes; 38using OpenSim.Region.Environment.Scenes;
39using OpenSim.Region.ScriptEngine.Common; 39using OpenSim.Region.ScriptEngine.Common;
40 40
41namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase 41namespace OpenSim.Region.ScriptEngine.Common.ScriptEngineBase
42{ 42{
43 /// <summary> 43 /// <summary>
44 /// Loads scripts 44 /// Loads scripts
45 /// Compiles them if necessary 45 /// Compiles them if necessary
46 /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution) 46 /// Execute functions for EventQueueManager (Sends them to script on other AppDomain for execution)
47 /// </summary> 47 /// </summary>
48 /// 48 ///
49 49
50 // This class is as close as you get to the script without being inside script class. It handles all the dirty work for other classes. 50 // This class is as close as you get to the script without being inside script class. It handles all the dirty work for other classes.
51 // * Keeps track of running scripts 51 // * Keeps track of running scripts
52 // * Compiles script if necessary (through "Compiler") 52 // * Compiles script if necessary (through "Compiler")
53 // * Loads script (through "AppDomainManager" called from for example "EventQueueManager") 53 // * Loads script (through "AppDomainManager" called from for example "EventQueueManager")
54 // * Executes functions inside script (called from for example "EventQueueManager" class) 54 // * Executes functions inside script (called from for example "EventQueueManager" class)
55 // * Unloads script (through "AppDomainManager" called from for example "EventQueueManager") 55 // * Unloads script (through "AppDomainManager" called from for example "EventQueueManager")
56 // * Dedicated load/unload thread, and queues loading/unloading. 56 // * Dedicated load/unload thread, and queues loading/unloading.
57 // This so that scripts starting or stopping will not slow down other theads or whole system. 57 // This so that scripts starting or stopping will not slow down other theads or whole system.
58 // 58 //
59 [Serializable] 59 [Serializable]
60 public abstract class ScriptManager 60 public abstract class ScriptManager
61 { 61 {
62 #region Declares 62 #region Declares
63 63
64 private Thread scriptLoadUnloadThread; 64 private Thread scriptLoadUnloadThread;
65 private int scriptLoadUnloadThread_IdleSleepms = 100; 65 private int scriptLoadUnloadThread_IdleSleepms = 100;
66 private Queue<LUStruct> LUQueue = new Queue<LUStruct>(); 66 private Queue<LUStruct> LUQueue = new Queue<LUStruct>();
67 67
68 68
69 // Load/Unload structure 69 // Load/Unload structure
70 private struct LUStruct 70 private struct LUStruct
71 { 71 {
72 public uint localID; 72 public uint localID;
73 public LLUUID itemID; 73 public LLUUID itemID;
74 public string script; 74 public string script;
75 public LUType Action; 75 public LUType Action;
76 } 76 }
77 77
78 private enum LUType 78 private enum LUType
79 { 79 {
80 Unknown = 0, 80 Unknown = 0,
81 Load = 1, 81 Load = 1,
82 Unload = 2 82 Unload = 2
83 } 83 }
84 84
85 // Object<string, Script<string, script>> 85 // Object<string, Script<string, script>>
86 // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory. 86 // IMPORTANT: Types and MemberInfo-derived objects require a LOT of memory.
87 // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead! 87 // Instead use RuntimeTypeHandle, RuntimeFieldHandle and RunTimeHandle (IntPtr) instead!
88 public Dictionary<uint, Dictionary<LLUUID, IScript>> Scripts = 88 public Dictionary<uint, Dictionary<LLUUID, IScript>> Scripts =
89 new Dictionary<uint, Dictionary<LLUUID, IScript>>(); 89 new Dictionary<uint, Dictionary<LLUUID, IScript>>();
90 90
91 public Scene World 91 public Scene World
92 { 92 {
93 get { return m_scriptEngine.World; } 93 get { return m_scriptEngine.World; }
94 } 94 }
95 95
96 #endregion 96 #endregion
97 97
98 #region Object init/shutdown 98 #region Object init/shutdown
99 99
100 public ScriptEngineBase.ScriptEngine m_scriptEngine; 100 public ScriptEngineBase.ScriptEngine m_scriptEngine;
101 101
102 public ScriptManager(ScriptEngineBase.ScriptEngine scriptEngine) 102 public ScriptManager(ScriptEngineBase.ScriptEngine scriptEngine)
103 { 103 {
104 m_scriptEngine = scriptEngine; 104 m_scriptEngine = scriptEngine;
105 AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve); 105 AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(CurrentDomain_AssemblyResolve);
106 scriptLoadUnloadThread = new Thread(ScriptLoadUnloadThreadLoop); 106 scriptLoadUnloadThread = new Thread(ScriptLoadUnloadThreadLoop);
107 scriptLoadUnloadThread.Name = "ScriptLoadUnloadThread"; 107 scriptLoadUnloadThread.Name = "ScriptLoadUnloadThread";
108 scriptLoadUnloadThread.IsBackground = true; 108 scriptLoadUnloadThread.IsBackground = true;
109 scriptLoadUnloadThread.Priority = ThreadPriority.BelowNormal; 109 scriptLoadUnloadThread.Priority = ThreadPriority.BelowNormal;
110 scriptLoadUnloadThread.Start(); 110 scriptLoadUnloadThread.Start();
111 } 111 }
112 112
113 ~ScriptManager() 113 ~ScriptManager()
114 { 114 {
115 // Abort load/unload thread 115 // Abort load/unload thread
116 try 116 try
117 { 117 {
118 if (scriptLoadUnloadThread != null) 118 if (scriptLoadUnloadThread != null)
119 { 119 {
120 if (scriptLoadUnloadThread.IsAlive == true) 120 if (scriptLoadUnloadThread.IsAlive == true)
121 { 121 {
122 scriptLoadUnloadThread.Abort(); 122 scriptLoadUnloadThread.Abort();
123 scriptLoadUnloadThread.Join(); 123 scriptLoadUnloadThread.Join();
124 } 124 }
125 } 125 }
126 } 126 }
127 catch 127 catch
128 { 128 {
129 } 129 }
130 } 130 }
131 131
132 #endregion 132 #endregion
133 133
134 #region Load / Unload scripts (Thread loop) 134 #region Load / Unload scripts (Thread loop)
135 135
136 private void ScriptLoadUnloadThreadLoop() 136 private void ScriptLoadUnloadThreadLoop()
137 { 137 {
138 try 138 try
139 { 139 {
140 while (true) 140 while (true)
141 { 141 {
142 if (LUQueue.Count == 0) 142 if (LUQueue.Count == 0)
143 Thread.Sleep(scriptLoadUnloadThread_IdleSleepms); 143 Thread.Sleep(scriptLoadUnloadThread_IdleSleepms);
144 if (LUQueue.Count > 0) 144 if (LUQueue.Count > 0)
145 { 145 {
146 LUStruct item = LUQueue.Dequeue(); 146 LUStruct item = LUQueue.Dequeue();
147 lock (startStopLock) // Lock so we have only 1 thread working on loading/unloading of scripts 147 lock (startStopLock) // Lock so we have only 1 thread working on loading/unloading of scripts
148 { 148 {
149 if (item.Action == LUType.Unload) 149 if (item.Action == LUType.Unload)
150 { 150 {
151 _StopScript(item.localID, item.itemID); 151 _StopScript(item.localID, item.itemID);
152 } 152 }
153 if (item.Action == LUType.Load) 153 if (item.Action == LUType.Load)
154 { 154 {
155 _StartScript(item.localID, item.itemID, item.script); 155 _StartScript(item.localID, item.itemID, item.script);
156 } 156 }
157 } 157 }
158 } 158 }
159 } 159 }
160 } 160 }
161 catch (ThreadAbortException tae) 161 catch (ThreadAbortException tae)
162 { 162 {
163 string a = tae.ToString(); 163 string a = tae.ToString();
164 a = ""; 164 a = "";
165 // Expected 165 // Expected
166 } 166 }
167 } 167 }
168 168
169 #endregion 169 #endregion
170 170
171 #region Helper functions 171 #region Helper functions
172 172
173 private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) 173 private static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args)
174 { 174 {
175 //Console.WriteLine("ScriptManager.CurrentDomain_AssemblyResolve: " + args.Name); 175 //Console.WriteLine("ScriptManager.CurrentDomain_AssemblyResolve: " + args.Name);
176 return Assembly.GetExecutingAssembly().FullName == args.Name ? Assembly.GetExecutingAssembly() : null; 176 return Assembly.GetExecutingAssembly().FullName == args.Name ? Assembly.GetExecutingAssembly() : null;
177 } 177 }
178 178
179 #endregion 179 #endregion
180 180
181 181
182 182
183 #region Start/Stop/Reset script 183 #region Start/Stop/Reset script
184 184
185 private readonly Object startStopLock = new Object(); 185 private readonly Object startStopLock = new Object();
186 186
187 /// <summary> 187 /// <summary>
188 /// Fetches, loads and hooks up a script to an objects events 188 /// Fetches, loads and hooks up a script to an objects events
189 /// </summary> 189 /// </summary>
190 /// <param name="itemID"></param> 190 /// <param name="itemID"></param>
191 /// <param name="localID"></param> 191 /// <param name="localID"></param>
192 public void StartScript(uint localID, LLUUID itemID, string Script) 192 public void StartScript(uint localID, LLUUID itemID, string Script)
193 { 193 {
194 LUStruct ls = new LUStruct(); 194 LUStruct ls = new LUStruct();
195 ls.localID = localID; 195 ls.localID = localID;
196 ls.itemID = itemID; 196 ls.itemID = itemID;
197 ls.script = Script; 197 ls.script = Script;
198 ls.Action = LUType.Load; 198 ls.Action = LUType.Load;
199 LUQueue.Enqueue(ls); 199 LUQueue.Enqueue(ls);
200 } 200 }
201 201
202 /// <summary> 202 /// <summary>
203 /// Disables and unloads a script 203 /// Disables and unloads a script
204 /// </summary> 204 /// </summary>
205 /// <param name="localID"></param> 205 /// <param name="localID"></param>
206 /// <param name="itemID"></param> 206 /// <param name="itemID"></param>
207 public void StopScript(uint localID, LLUUID itemID) 207 public void StopScript(uint localID, LLUUID itemID)
208 { 208 {
209 LUStruct ls = new LUStruct(); 209 LUStruct ls = new LUStruct();
210 ls.localID = localID; 210 ls.localID = localID;
211 ls.itemID = itemID; 211 ls.itemID = itemID;
212 ls.Action = LUType.Unload; 212 ls.Action = LUType.Unload;
213 LUQueue.Enqueue(ls); 213 LUQueue.Enqueue(ls);
214 } 214 }
215 215
216 // Create a new instance of the compiler (reuse) 216 // Create a new instance of the compiler (reuse)
217 //private Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler(); 217 //private Compiler.LSL.Compiler LSLCompiler = new Compiler.LSL.Compiler();
218 218
219 public abstract void _StartScript(uint localID, LLUUID itemID, string Script); 219 public abstract void _StartScript(uint localID, LLUUID itemID, string Script);
220 220
221 public abstract void _StopScript(uint localID, LLUUID itemID); 221 public abstract void _StopScript(uint localID, LLUUID itemID);
222 222
223 223
224 #endregion 224 #endregion
225 225
226 #region Perform event execution in script 226 #region Perform event execution in script
227 227
228 /// <summary> 228 /// <summary>
229 /// Execute a LL-event-function in Script 229 /// Execute a LL-event-function in Script
230 /// </summary> 230 /// </summary>
231 /// <param name="localID">Object the script is located in</param> 231 /// <param name="localID">Object the script is located in</param>
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, 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);
239#endif 239#endif
240 // Execute a function in the script 240 // Execute a function in the script
241 //m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName); 241 //m_scriptEngine.Log.Verbose("ScriptEngine", "Executing Function localID: " + localID + ", itemID: " + itemID + ", FunctionName: " + FunctionName);
242 //ScriptBaseInterface Script = (ScriptBaseInterface)GetScript(localID, itemID); 242 //ScriptBaseInterface Script = (ScriptBaseInterface)GetScript(localID, itemID);
243 IScript Script = GetScript(localID, itemID); 243 IScript Script = GetScript(localID, itemID);
244 if (Script == null) 244 if (Script == null)
245 return; 245 return;
246#if DEBUG 246#if DEBUG
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.Exec.ExecuteEvent(FunctionName, args); 250 Script.Exec.ExecuteEvent(FunctionName, args);
251 } 251 }
252 252
253 #endregion 253 #endregion
254 254
255 #region Internal functions to keep track of script 255 #region Internal functions to keep track of script
256 256
257 public Dictionary<LLUUID, IScript>.KeyCollection GetScriptKeys(uint localID) 257 public Dictionary<LLUUID, IScript>.KeyCollection GetScriptKeys(uint localID)
258 { 258 {
259 if (Scripts.ContainsKey(localID) == false) 259 if (Scripts.ContainsKey(localID) == false)
260 return null; 260 return null;
261 261
262 Dictionary<LLUUID, IScript> Obj; 262 Dictionary<LLUUID, IScript> Obj;
263 Scripts.TryGetValue(localID, out Obj); 263 Scripts.TryGetValue(localID, out Obj);
264 264
265 return Obj.Keys; 265 return Obj.Keys;
266 } 266 }
267 267
268 public IScript GetScript(uint localID, LLUUID itemID) 268 public IScript GetScript(uint localID, LLUUID itemID)
269 { 269 {
270 if (Scripts.ContainsKey(localID) == false) 270 if (Scripts.ContainsKey(localID) == false)
271 return null; 271 return null;
272 272
273 Dictionary<LLUUID, IScript> Obj; 273 Dictionary<LLUUID, IScript> Obj;
274 Scripts.TryGetValue(localID, out Obj); 274 Scripts.TryGetValue(localID, out Obj);
275 if (Obj.ContainsKey(itemID) == false) 275 if (Obj.ContainsKey(itemID) == false)
276 return null; 276 return null;
277 277
278 // Get script 278 // Get script
279 IScript Script; 279 IScript Script;
280 Obj.TryGetValue(itemID, out Script); 280 Obj.TryGetValue(itemID, out Script);
281 281
282 return Script; 282 return Script;
283 } 283 }
284 284
285 public void SetScript(uint localID, LLUUID itemID, IScript Script) 285 public void SetScript(uint localID, LLUUID itemID, IScript Script)
286 { 286 {
287 // Create object if it doesn't exist 287 // Create object if it doesn't exist
288 if (Scripts.ContainsKey(localID) == false) 288 if (Scripts.ContainsKey(localID) == false)
289 { 289 {
290 Scripts.Add(localID, new Dictionary<LLUUID, IScript>()); 290 Scripts.Add(localID, new Dictionary<LLUUID, IScript>());
291 } 291 }
292 292
293 // Delete script if it exists 293 // Delete script if it exists
294 Dictionary<LLUUID, IScript> Obj; 294 Dictionary<LLUUID, IScript> Obj;
295 Scripts.TryGetValue(localID, out Obj); 295 Scripts.TryGetValue(localID, out Obj);
296 if (Obj.ContainsKey(itemID) == true) 296 if (Obj.ContainsKey(itemID) == true)
297 Obj.Remove(itemID); 297 Obj.Remove(itemID);
298 298
299 // Add to object 299 // Add to object
300 Obj.Add(itemID, Script); 300 Obj.Add(itemID, Script);
301 } 301 }
302 302
303 public void RemoveScript(uint localID, LLUUID itemID) 303 public void RemoveScript(uint localID, LLUUID itemID)
304 { 304 {
305 // Don't have that object? 305 // Don't have that object?
306 if (Scripts.ContainsKey(localID) == false) 306 if (Scripts.ContainsKey(localID) == false)
307 return; 307 return;
308 308
309 // Delete script if it exists 309 // Delete script if it exists
310 Dictionary<LLUUID, IScript> Obj; 310 Dictionary<LLUUID, IScript> Obj;
311 Scripts.TryGetValue(localID, out Obj); 311 Scripts.TryGetValue(localID, out Obj);
312 if (Obj.ContainsKey(itemID) == true) 312 if (Obj.ContainsKey(itemID) == true)
313 Obj.Remove(itemID); 313 Obj.Remove(itemID);
314 } 314 }
315 315
316 #endregion 316 #endregion
317 317
318 318
319 public void ResetScript(uint localID, LLUUID itemID) 319 public void ResetScript(uint localID, LLUUID itemID)
320 { 320 {
321 string script = GetScript(localID, itemID).Source; 321 string script = GetScript(localID, itemID).Source;
322 StopScript(localID, itemID); 322 StopScript(localID, itemID);
323 StartScript(localID, itemID, script); 323 StartScript(localID, itemID, script);
324 } 324 }
325 325
326 326
327 #region Script serialization/deserialization 327 #region Script serialization/deserialization
328 328
329 public void GetSerializedScript(uint localID, LLUUID itemID) 329 public void GetSerializedScript(uint localID, LLUUID itemID)
330 { 330 {
331 // Serialize the script and return it 331 // Serialize the script and return it
332 // Should not be a problem 332 // Should not be a problem
333 FileStream fs = File.Create("SERIALIZED_SCRIPT_" + itemID); 333 FileStream fs = File.Create("SERIALIZED_SCRIPT_" + itemID);
334 BinaryFormatter b = new BinaryFormatter(); 334 BinaryFormatter b = new BinaryFormatter();
335 b.Serialize(fs, GetScript(localID, itemID)); 335 b.Serialize(fs, GetScript(localID, itemID));
336 fs.Close(); 336 fs.Close();
337 } 337 }
338 338
339 public void PutSerializedScript(uint localID, LLUUID itemID) 339 public void PutSerializedScript(uint localID, LLUUID itemID)
340 { 340 {
341 // Deserialize the script and inject it into an AppDomain 341 // Deserialize the script and inject it into an AppDomain
342 342
343 // How to inject into an AppDomain? 343 // How to inject into an AppDomain?
344 } 344 }
345 345
346 #endregion 346 #endregion
347 } 347 }
348} \ No newline at end of file 348} \ No newline at end of file