aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs')
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs22
1 files changed, 11 insertions, 11 deletions
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
index c0c776d..ffde7ac 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/OSSL_Api.cs
@@ -755,18 +755,18 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
755 { 755 {
756 756
757 // Console.WriteLine(""+JSON[i]); 757 // Console.WriteLine(""+JSON[i]);
758 switch(JSON[i]) 758 switch (JSON[i])
759 { 759 {
760 case '{': 760 case '{':
761 // create hashtable and add it to the stack or array if we are populating one, we can have a lot of nested objects in JSON 761 // create hashtable and add it to the stack or array if we are populating one, we can have a lot of nested objects in JSON
762 762
763 Hashtable currentObject = new Hashtable(); 763 Hashtable currentObject = new Hashtable();
764 if(objectStack.Count==0) // the stack should only be empty for the first outer object 764 if (objectStack.Count==0) // the stack should only be empty for the first outer object
765 { 765 {
766 766
767 objectStack.Push(jsondata); 767 objectStack.Push(jsondata);
768 } 768 }
769 else if(objectStack.Peek().ToString()=="System.Collections.ArrayList") 769 else if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
770 { 770 {
771 // add it to the parent array 771 // add it to the parent array
772 ((ArrayList)objectStack.Peek()).Add(currentObject); 772 ((ArrayList)objectStack.Peek()).Add(currentObject);
@@ -792,17 +792,17 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
792 i++; // move to next char 792 i++; // move to next char
793 793
794 // just loop through until the next quote mark storing the string 794 // just loop through until the next quote mark storing the string
795 while(JSON[i]!='"') 795 while (JSON[i]!='"')
796 { 796 {
797 tokenValue+=JSON[i++]; 797 tokenValue+=JSON[i++];
798 } 798 }
799 799
800 // ok we've got a string, if we've got an array on the top of the stack then we store it 800 // ok we've got a string, if we've got an array on the top of the stack then we store it
801 if(objectStack.Peek().ToString()=="System.Collections.ArrayList") 801 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
802 { 802 {
803 ((ArrayList)objectStack.Peek()).Add(tokenValue); 803 ((ArrayList)objectStack.Peek()).Add(tokenValue);
804 } 804 }
805 else if(currentKey==null) // no key stored and its not an array this must be a key so store it 805 else if (currentKey==null) // no key stored and its not an array this must be a key so store it
806 { 806 {
807 currentKey = tokenValue; 807 currentKey = tokenValue;
808 } 808 }
@@ -824,7 +824,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
824 case '[': // array start 824 case '[': // array start
825 ArrayList currentArray = new ArrayList(); 825 ArrayList currentArray = new ArrayList();
826 826
827 if(objectStack.Peek().ToString()=="System.Collections.ArrayList") 827 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
828 { 828 {
829 ((ArrayList)objectStack.Peek()).Add(currentArray); 829 ((ArrayList)objectStack.Peek()).Add(currentArray);
830 } 830 }
@@ -846,7 +846,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
846 break; 846 break;
847 case 't': // we've found a character start not in quotes, it must be a boolean true 847 case 't': // we've found a character start not in quotes, it must be a boolean true
848 848
849 if(objectStack.Peek().ToString()=="System.Collections.ArrayList") 849 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
850 { 850 {
851 ((ArrayList)objectStack.Peek()).Add(true); 851 ((ArrayList)objectStack.Peek()).Add(true);
852 } 852 }
@@ -860,7 +860,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
860 break; 860 break;
861 case 'f': // we've found a character start not in quotes, it must be a boolean false 861 case 'f': // we've found a character start not in quotes, it must be a boolean false
862 862
863 if(objectStack.Peek().ToString()=="System.Collections.ArrayList") 863 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
864 { 864 {
865 ((ArrayList)objectStack.Peek()).Add(false); 865 ((ArrayList)objectStack.Peek()).Add(false);
866 } 866 }
@@ -879,7 +879,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
879 string numberValue=""; 879 string numberValue="";
880 880
881 // just loop through until the next known marker quote mark storing the string 881 // just loop through until the next known marker quote mark storing the string
882 while(JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') 882 while (JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ')
883 { 883 {
884 numberValue+=""+JSON[i++]; 884 numberValue+=""+JSON[i++];
885 } 885 }
@@ -887,7 +887,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
887 i--; // we want to process this caracter that marked the end of this string in the main loop 887 i--; // we want to process this caracter that marked the end of this string in the main loop
888 888
889 // ok we've got a string, if we've got an array on the top of the stack then we store it 889 // ok we've got a string, if we've got an array on the top of the stack then we store it
890 if(objectStack.Peek().ToString()=="System.Collections.ArrayList") 890 if (objectStack.Peek().ToString()=="System.Collections.ArrayList")
891 { 891 {
892 ((ArrayList)objectStack.Peek()).Add(numberValue); 892 ((ArrayList)objectStack.Peek()).Add(numberValue);
893 } 893 }