aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs97
1 files changed, 83 insertions, 14 deletions
diff --git a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
index bfee3e5..757813b 100644
--- a/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
+++ b/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
@@ -37,7 +37,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
37 37
38 38
39 private string m_state = "default"; 39 private string m_state = "default";
40 public string State() { 40
41 public string State()
42 {
41 return m_state; 43 return m_state;
42 } 44 }
43 45
@@ -81,12 +83,17 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
81 return OpenSim.Framework.Utilities.Util.RandomClass.Next((int)mag); 83 return OpenSim.Framework.Utilities.Util.RandomClass.Next((int)mag);
82 } 84 }
83 } 85 }
86
84 public int llFloor(double f) { return (int)Math.Floor(f); } 87 public int llFloor(double f) { return (int)Math.Floor(f); }
85 public int llCeil(double f) { return (int)Math.Ceiling(f); } 88 public int llCeil(double f) { return (int)Math.Ceiling(f); }
86 public int llRound(double f) { return (int)Math.Round(f, 3); } 89 public int llRound(double f) { return (int)Math.Round(f, 3); }
87 90
88 //This next group are vector operations involving squaring and square root. ckrinke 91 //This next group are vector operations involving squaring and square root. ckrinke
89 public double llVecMag(LSL_Types.Vector3 v) { return (v.X*v.X + v.Y*v.Y + v.Z*v.Z); } 92 public double llVecMag(LSL_Types.Vector3 v)
93 {
94 return (v.X*v.X + v.Y*v.Y + v.Z*v.Z);
95 }
96
90 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v) 97 public LSL_Types.Vector3 llVecNorm(LSL_Types.Vector3 v)
91 { 98 {
92 double mag = v.X * v.X + v.Y * v.Y + v.Z * v.Z; 99 double mag = v.X * v.X + v.Y * v.Y + v.Z * v.Z;
@@ -120,8 +127,9 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
120 } 127 }
121 128
122 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v) 129 public LSL_Types.Quaternion llEuler2Rot(LSL_Types.Vector3 v)
123 { //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07 130 {
124 float err = 0.00001f; 131 //this comes from from http://lslwiki.net/lslwiki/wakka.php?wakka=LibraryRotationFunctions but is incomplete as of 8/19/07
132 float err = 0.00001f;
125 double ax = Math.Sin(v.X / 2); double aw = Math.Cos(v.X / 2); 133 double ax = Math.Sin(v.X / 2); double aw = Math.Cos(v.X / 2);
126 double by = Math.Sin(v.Y / 2); double bw = Math.Cos(v.Y / 2); 134 double by = Math.Sin(v.Y / 2); double bw = Math.Cos(v.Y / 2);
127 double cz = Math.Sin(v.Z / 2); double cw = Math.Cos(v.Z / 2); 135 double cz = Math.Sin(v.Z / 2); double cw = Math.Cos(v.Z / 2);
@@ -160,6 +168,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
160 World.SimChat(Helpers.StringToField(text), 168 World.SimChat(Helpers.StringToField(text),
161 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID); 169 0, m_host.AbsolutePosition, m_host.Name, m_host.UUID);
162 } 170 }
171
163 public void llSay(int channelID, string text) 172 public void llSay(int channelID, string text)
164 { 173 {
165 //type for say is 1 174 //type for say is 1
@@ -237,7 +246,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
237 public LSL_Types.Vector3 llGetAccel() { return new LSL_Types.Vector3(); } 246 public LSL_Types.Vector3 llGetAccel() { return new LSL_Types.Vector3(); }
238 public LSL_Types.Vector3 llGetOmega() { return new LSL_Types.Vector3(); } 247 public LSL_Types.Vector3 llGetOmega() { return new LSL_Types.Vector3(); }
239 public double llGetTimeOfDay() { return 0; } 248 public double llGetTimeOfDay() { return 0; }
240 public double llGetWallclock() { return DateTime.Now.TimeOfDay.TotalSeconds; } 249
250 public double llGetWallclock()
251 {
252 return DateTime.Now.TimeOfDay.TotalSeconds;
253 }
254
241 public double llGetTime() { return 0; } 255 public double llGetTime() { return 0; }
242 public void llResetTime() { } 256 public void llResetTime() { }
243 public double llGetAndResetTime() { return 0; } 257 public double llGetAndResetTime() { return 0; }
@@ -263,11 +277,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
263 public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { } 277 public void llRezObject(string inventory, LSL_Types.Vector3 pos, LSL_Types.Quaternion rot, int param) { }
264 public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { } 278 public void llLookAt(LSL_Types.Vector3 target, double strength, double damping) { }
265 public void llStopLookAt() { } 279 public void llStopLookAt() { }
280
266 public void llSetTimerEvent(double sec) 281 public void llSetTimerEvent(double sec)
267 { 282 {
268 // Setting timer repeat 283 // Setting timer repeat
269 m_ScriptEngine.myLSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec); 284 m_ScriptEngine.myLSLLongCmdHandler.SetTimerEvent(m_localID, m_itemID, sec);
270 } 285 }
286
271 public void llSleep(double sec) { System.Threading.Thread.Sleep((int)(sec * 1000)); } 287 public void llSleep(double sec) { System.Threading.Thread.Sleep((int)(sec * 1000)); }
272 public double llGetMass() { return 0; } 288 public double llGetMass() { return 0; }
273 public void llCollisionFilter(string name, string id, int accept) { } 289 public void llCollisionFilter(string name, string id, int accept) { }
@@ -281,10 +297,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
281 public void llInstantMessage(string user, string message) { } 297 public void llInstantMessage(string user, string message) { }
282 public void llEmail(string address, string subject, string message) { } 298 public void llEmail(string address, string subject, string message) { }
283 public void llGetNextEmail(string address, string subject) { } 299 public void llGetNextEmail(string address, string subject) { }
300
284 public string llGetKey() 301 public string llGetKey()
285 { 302 {
286 return m_host.UUID.ToStringHyphenated(); 303 return m_host.UUID.ToStringHyphenated();
287 } 304 }
305
288 public void llSetBuoyancy(double buoyancy) { } 306 public void llSetBuoyancy(double buoyancy) { }
289 public void llSetHoverHeight(double height, int water, double tau) { } 307 public void llSetHoverHeight(double height, int water, double tau) { }
290 public void llStopHover() { } 308 public void llStopHover() { }
@@ -362,19 +380,59 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
362 public LSL_Types.Vector3 llGetTextureOffset(int face) { return new LSL_Types.Vector3(); } 380 public LSL_Types.Vector3 llGetTextureOffset(int face) { return new LSL_Types.Vector3(); }
363 public LSL_Types.Vector3 llGetTextureScale(int side) { return new LSL_Types.Vector3(); } 381 public LSL_Types.Vector3 llGetTextureScale(int side) { return new LSL_Types.Vector3(); }
364 public double llGetTextureRot(int side) { return 0; } 382 public double llGetTextureRot(int side) { return 0; }
383
365 public int llSubStringIndex(string source, string pattern) 384 public int llSubStringIndex(string source, string pattern)
366 { 385 {
367 return source.IndexOf(pattern); 386 return source.IndexOf(pattern);
368 } 387 }
388
369 public string llGetOwnerKey(string id) { return ""; } 389 public string llGetOwnerKey(string id) { return ""; }
370 public LSL_Types.Vector3 llGetCenterOfMass() { return new LSL_Types.Vector3(); } 390 public LSL_Types.Vector3 llGetCenterOfMass() { return new LSL_Types.Vector3(); }
391
371 public List<string> llListSort(List<string> src, int stride, int ascending) 392 public List<string> llListSort(List<string> src, int stride, int ascending)
372 { return new List<string>(); } 393 {
373 public int llGetListLength(List<string> src) { return 0; } 394 //List<string> nlist = src.Sort();
374 public int llList2Integer(List<string> src, int index) { return 0; } 395
375 public double llList2double(List<string> src, int index) { return 0; } 396 //if (ascending == 0)
376 public string llList2String(List<string> src, int index) { return ""; } 397 //{
377 public string llList2Key(List<string> src, int index) { return ""; } 398 //nlist.Reverse();
399 //}
400
401 //return nlist;
402 return new List<string>(); ;
403 }
404
405 public int llGetListLength(List<string> src)
406 {
407 return src.Count;
408 }
409
410 public int llList2Integer(List<string> src, int index)
411 {
412 return Convert.ToInt32(src[index]);
413 }
414
415 public double llList2Double(List<string> src, int index)
416 {
417 return Convert.ToDouble(src[index]);
418 }
419
420 public float llList2Float(List<string> src, int index)
421 {
422 return Convert.ToSingle(src[index]);
423 }
424
425 public string llList2String(List<string> src, int index)
426 {
427 return src[index];
428 }
429
430 public string llList2Key(List<string> src, int index)
431 {
432 //return OpenSim.Framework.Types.ToStringHyphenated(src[index]);
433 return "";
434 }
435
378 public LSL_Types.Vector3 llList2Vector(List<string> src, int index) 436 public LSL_Types.Vector3 llList2Vector(List<string> src, int index)
379 { return new LSL_Types.Vector3(); } 437 { return new LSL_Types.Vector3(); }
380 public LSL_Types.Quaternion llList2Rot(List<string> src, int index) 438 public LSL_Types.Quaternion llList2Rot(List<string> src, int index)
@@ -391,19 +449,25 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
391 { return new List<string>(); } 449 { return new List<string>(); }
392 public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) 450 public List<string> llList2ListStrided(List<string> src, int start, int end, int stride)
393 { return new List<string>(); } 451 { return new List<string>(); }
452
394 public LSL_Types.Vector3 llGetRegionCorner() 453 public LSL_Types.Vector3 llGetRegionCorner()
395 { return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0); } 454 {
455 return new LSL_Types.Vector3(World.RegionInfo.RegionLocX * 256, World.RegionInfo.RegionLocY * 256, 0);
456 }
457
396 public List<string> llListInsertList(List<string> dest, List<string> src, int start) 458 public List<string> llListInsertList(List<string> dest, List<string> src, int start)
397 { return new List<string>(); } 459 { return new List<string>(); }
398 public int llListFindList(List<string> src, List<string> test) { return 0; } 460 public int llListFindList(List<string> src, List<string> test) { return 0; }
399 public string llGetObjectName() { return ""; } 461 public string llGetObjectName() { return ""; }
400 public void llSetObjectName(string name) { } 462 public void llSetObjectName(string name) { }
463
401 public string llGetDate() 464 public string llGetDate()
402 { 465 {
403 DateTime date = DateTime.Now.ToUniversalTime(); 466 DateTime date = DateTime.Now.ToUniversalTime();
404 string result = date.ToString("yyyy-MM-dd"); 467 string result = date.ToString("yyyy-MM-dd");
405 return result; 468 return result;
406 } 469 }
470
407 public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return 0; } 471 public int llEdgeOfWorld(LSL_Types.Vector3 pos, LSL_Types.Vector3 dir) { return 0; }
408 public int llGetAgentInfo(string id) { return 0; } 472 public int llGetAgentInfo(string id) { return 0; }
409 public void llAdjustSoundVolume(double volume) { } 473 public void llAdjustSoundVolume(double volume) { }
@@ -454,7 +518,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
454 public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) { } 518 public void llDialog(string avatar, string message, List<string> buttons, int chat_channel) { }
455 public void llVolumeDetect(int detect) { } 519 public void llVolumeDetect(int detect) { }
456 public void llResetOtherScript(string name) { } 520 public void llResetOtherScript(string name) { }
457 public int llGetScriptState(string name) { return 0; } 521
522 public int llGetScriptState(string name)
523 {
524 return 0;
525 }
526
458 public void llRemoteLoadScript() { } 527 public void llRemoteLoadScript() { }
459 public void llSetRemoteScriptAccessPin(int pin) { } 528 public void llSetRemoteScriptAccessPin(int pin) { }
460 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { } 529 public void llRemoteLoadScriptPin(string target, string name, int pin, int running, int start_param) { }