aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
diff options
context:
space:
mode:
authorTedd Hansen2007-09-16 03:36:13 +0000
committerTedd Hansen2007-09-16 03:36:13 +0000
commitc654506b18947a40cc7ef5da37a9a57ebcf4811d (patch)
tree57b807ffb5f19856883a6aa7dfcdc8fb9d179fa5 /OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs
parentImplemented: llStringToBase64, llBase64ToString, llXorBase64Strings, llXorBas... (diff)
downloadopensim-SC_OLD-c654506b18947a40cc7ef5da37a9a57ebcf4811d.zip
opensim-SC_OLD-c654506b18947a40cc7ef5da37a9a57ebcf4811d.tar.gz
opensim-SC_OLD-c654506b18947a40cc7ef5da37a9a57ebcf4811d.tar.bz2
opensim-SC_OLD-c654506b18947a40cc7ef5da37a9a57ebcf4811d.tar.xz
Implemented: llSetText, llResetScript
Implemented: llHTTPRequest (queue, thread, etc -- but not actuall call)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/DotNetEngine/Compiler/Server_API/LSL_BuiltIn_Commands.cs60
1 files changed, 40 insertions, 20 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 064ed4f..20f5d51 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
@@ -327,7 +327,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
327 return src.Substring(start, end); 327 return src.Substring(start, end);
328 } 328 }
329 329
330 public string llDeleteSubString(string src, int start, int end) 330 public string llDeleteSubString(string src, int start, int end)
331 { 331 {
332 return src.Remove(start, end - start); 332 return src.Remove(start, end - start);
333 } 333 }
@@ -431,7 +431,12 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
431 public void llGiveInventory(string destination, string inventory) { NotImplemented("llGiveInventory"); } 431 public void llGiveInventory(string destination, string inventory) { NotImplemented("llGiveInventory"); }
432 public void llRemoveInventory(string item) { NotImplemented("llRemoveInventory"); } 432 public void llRemoveInventory(string item) { NotImplemented("llRemoveInventory"); }
433 433
434 public void llSetText(string text, LSL_Types.Vector3 color, double alpha) { NotImplemented("llSetText"); } 434 public void llSetText(string text, LSL_Types.Vector3 color, double alpha)
435 {
436 Axiom.Math.Vector3 av3 = new Axiom.Math.Vector3((float)color.X, (float)color.Y, (float)color.Z);
437 m_host.SetText(text, av3, alpha);
438 }
439
435 440
436 public double llWater(LSL_Types.Vector3 offset) { NotImplemented("llWater"); return 0; } 441 public double llWater(LSL_Types.Vector3 offset) { NotImplemented("llWater"); return 0; }
437 public void llPassTouches(int pass) { NotImplemented("llPassTouches"); } 442 public void llPassTouches(int pass) { NotImplemented("llPassTouches"); }
@@ -443,7 +448,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
443 public void llCollisionSound(string impact_sound, double impact_volume) { NotImplemented("llCollisionSound"); } 448 public void llCollisionSound(string impact_sound, double impact_volume) { NotImplemented("llCollisionSound"); }
444 public void llCollisionSprite(string impact_sprite) { NotImplemented("llCollisionSprite"); } 449 public void llCollisionSprite(string impact_sprite) { NotImplemented("llCollisionSprite"); }
445 public string llGetAnimation(string id) { NotImplemented("llGetAnimation"); return ""; } 450 public string llGetAnimation(string id) { NotImplemented("llGetAnimation"); return ""; }
446 public void llResetScript() { } 451 public void llResetScript()
452 {
453 m_ScriptEngine.m_ScriptManager.ResetScript(m_localID, m_itemID);
454 }
447 public void llMessageLinked(int linknum, int num, string str, string id) { } 455 public void llMessageLinked(int linknum, int num, string str, string id) { }
448 public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { } 456 public void llPushObject(string target, LSL_Types.Vector3 impulse, LSL_Types.Vector3 ang_impulse, int local) { }
449 public void llPassCollisions(int pass) { } 457 public void llPassCollisions(int pass) { }
@@ -482,7 +490,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
482 490
483 public LSL_Types.Vector3 llGetCenterOfMass() { NotImplemented("llGetCenterOfMass"); return new LSL_Types.Vector3(); } 491 public LSL_Types.Vector3 llGetCenterOfMass() { NotImplemented("llGetCenterOfMass"); return new LSL_Types.Vector3(); }
484 492
485 public List<string> llListSort(List<string> src, int stride, int ascending) { 493 public List<string> llListSort(List<string> src, int stride, int ascending)
494 {
486 SortedList<string, List<string>> sorted = new SortedList<string, List<string>>(); 495 SortedList<string, List<string>> sorted = new SortedList<string, List<string>>();
487 // Add chunks to an array 496 // Add chunks to an array
488 int s = stride; 497 int s = stride;
@@ -497,7 +506,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
497 if (c > s) 506 if (c > s)
498 { 507 {
499 sorted.Add(chunkString, chunk); 508 sorted.Add(chunkString, chunk);
500 chunkString = ""; 509 chunkString = "";
501 chunk = new List<string>(); 510 chunk = new List<string>();
502 c = 0; 511 c = 0;
503 } 512 }
@@ -554,7 +563,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
554 { 563 {
555 return new LSL_Types.Vector3(double.Parse(src[index]), double.Parse(src[index + 1]), double.Parse(src[index + 2])); 564 return new LSL_Types.Vector3(double.Parse(src[index]), double.Parse(src[index + 1]), double.Parse(src[index + 2]));
556 } 565 }
557 public LSL_Types.Quaternion llList2Rot(List<string> src, int index) { 566 public LSL_Types.Quaternion llList2Rot(List<string> src, int index)
567 {
558 return new LSL_Types.Quaternion(double.Parse(src[index]), double.Parse(src[index + 1]), double.Parse(src[index + 2]), double.Parse(src[index + 3])); 568 return new LSL_Types.Quaternion(double.Parse(src[index]), double.Parse(src[index + 1]), double.Parse(src[index + 2]), double.Parse(src[index + 3]));
559 } 569 }
560 public List<string> llList2List(List<string> src, int start, int end) 570 public List<string> llList2List(List<string> src, int start, int end)
@@ -632,7 +642,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
632 if (chunk.Count > 0) 642 if (chunk.Count > 0)
633 tmp.Add(chunk); 643 tmp.Add(chunk);
634 644
635 // Decreate array back into a list 645 // Decreate (<- what kind of word is that? :D ) array back into a list
636 int rnd; 646 int rnd;
637 List<string> ret = new List<string>(); 647 List<string> ret = new List<string>();
638 while (tmp.Count > 0) 648 while (tmp.Count > 0)
@@ -649,7 +659,7 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
649 659
650 660
651 } 661 }
652 public List<string> llList2ListStrided(List<string> src, int start, int end, int stride) 662 public List<string> llList2ListStrided(List<string> src, int start, int end, int stride)
653 { 663 {
654 List<string> ret = new List<string>(); 664 List<string> ret = new List<string>();
655 int s = stride; 665 int s = stride;
@@ -657,9 +667,11 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
657 s = 1; 667 s = 1;
658 668
659 int sc = s; 669 int sc = s;
660 for (int i = start; i < src.Count; i++) { 670 for (int i = start; i < src.Count; i++)
671 {
661 sc--; 672 sc--;
662 if (sc ==0) { 673 if (sc == 0)
674 {
663 sc = s; 675 sc = s;
664 // Addthis 676 // Addthis
665 ret.Add(src[i]); 677 ret.Add(src[i]);
@@ -795,7 +807,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
795 } 807 }
796 808
797 public void llSetPrimitiveParams(List<string> rules) { NotImplemented("llSetPrimitiveParams"); } 809 public void llSetPrimitiveParams(List<string> rules) { NotImplemented("llSetPrimitiveParams"); }
798 public string llStringToBase64(string str) { 810 public string llStringToBase64(string str)
811 {
799 812
800 try 813 try
801 { 814 {
@@ -808,14 +821,15 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
808 { 821 {
809 throw new Exception("Error in base64Encode" + e.Message); 822 throw new Exception("Error in base64Encode" + e.Message);
810 } 823 }
811} 824 }
812 825
813 public string llBase64ToString(string str) { 826 public string llBase64ToString(string str)
827 {
814 System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding(); 828 System.Text.UTF8Encoding encoder = new System.Text.UTF8Encoding();
815 System.Text.Decoder utf8Decode = encoder.GetDecoder(); 829 System.Text.Decoder utf8Decode = encoder.GetDecoder();
816 try 830 try
817 { 831 {
818 832
819 byte[] todecode_byte = Convert.FromBase64String(str); 833 byte[] todecode_byte = Convert.FromBase64String(str);
820 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length); 834 int charCount = utf8Decode.GetCharCount(todecode_byte, 0, todecode_byte.Length);
821 char[] decoded_char = new char[charCount]; 835 char[] decoded_char = new char[charCount];
@@ -861,11 +875,13 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
861 public List<string> llGetBoundingBox(string obj) { NotImplemented("llGetBoundingBox"); return new List<string>(); } 875 public List<string> llGetBoundingBox(string obj) { NotImplemented("llGetBoundingBox"); return new List<string>(); }
862 public LSL_Types.Vector3 llGetGeometricCenter() { NotImplemented("llGetGeometricCenter"); return new LSL_Types.Vector3(); } 876 public LSL_Types.Vector3 llGetGeometricCenter() { NotImplemented("llGetGeometricCenter"); return new LSL_Types.Vector3(); }
863 public void llGetPrimitiveParams() { NotImplemented("llGetPrimitiveParams"); } 877 public void llGetPrimitiveParams() { NotImplemented("llGetPrimitiveParams"); }
864 public string llIntegerToBase64(int number) { 878 public string llIntegerToBase64(int number)
865 NotImplemented("llIntegerToBase64"); return ""; 879 {
880 NotImplemented("llIntegerToBase64"); return "";
866 } 881 }
867 public int llBase64ToInteger(string str) { 882 public int llBase64ToInteger(string str)
868 NotImplemented("llBase64ToInteger"); return 0; 883 {
884 NotImplemented("llBase64ToInteger"); return 0;
869 } 885 }
870 886
871 public double llGetGMTclock() 887 public double llGetGMTclock()
@@ -957,7 +973,8 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
957 973
958 public int llGetParcelFlags(LSL_Types.Vector3 pos) { NotImplemented("llGetParcelFlags"); return 0; } 974 public int llGetParcelFlags(LSL_Types.Vector3 pos) { NotImplemented("llGetParcelFlags"); return 0; }
959 public int llGetRegionFlags() { NotImplemented("llGetRegionFlags"); return 0; } 975 public int llGetRegionFlags() { NotImplemented("llGetRegionFlags"); return 0; }
960 public string llXorBase64StringsCorrect(string str1, string str2) { 976 public string llXorBase64StringsCorrect(string str1, string str2)
977 {
961 string ret = ""; 978 string ret = "";
962 string src1 = llBase64ToString(str1); 979 string src1 = llBase64ToString(str1);
963 string src2 = llBase64ToString(str2); 980 string src2 = llBase64ToString(str2);
@@ -972,7 +989,10 @@ namespace OpenSim.Region.ScriptEngine.DotNetEngine.Compiler
972 } 989 }
973 return llStringToBase64(ret); 990 return llStringToBase64(ret);
974 } 991 }
975 public void llHTTPRequest() { NotImplemented("llHTTPRequest"); } 992 public void llHTTPRequest(string url, List<string> parameters, string body)
993 {
994 m_ScriptEngine.m_LSLLongCmdHandler.StartHttpRequest(m_localID, m_itemID, url, parameters, body);
995 }
976 public void llResetLandBanList() { NotImplemented("llResetLandBanList"); } 996 public void llResetLandBanList() { NotImplemented("llResetLandBanList"); }
977 public void llResetLandPassList() { NotImplemented("llResetLandPassList"); } 997 public void llResetLandPassList() { NotImplemented("llResetLandPassList"); }
978 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { NotImplemented("llGetParcelPrimCount"); return 0; } 998 public int llGetParcelPrimCount(LSL_Types.Vector3 pos, int category, int sim_wide) { NotImplemented("llGetParcelPrimCount"); return 0; }