diff options
author | Jeff Ames | 2008-09-13 22:07:07 +0000 |
---|---|---|
committer | Jeff Ames | 2008-09-13 22:07:07 +0000 |
commit | b4141f9e56a85a6df871a60921761a4848e297d1 (patch) | |
tree | 8f7139531274570b58a02d62f2acc6a6876e218c /OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | |
parent | Fixing a bug in DNE which caused the face-colors to be inverted when set via ... (diff) | |
download | opensim-SC-b4141f9e56a85a6df871a60921761a4848e297d1.zip opensim-SC-b4141f9e56a85a6df871a60921761a4848e297d1.tar.gz opensim-SC-b4141f9e56a85a6df871a60921761a4848e297d1.tar.bz2 opensim-SC-b4141f9e56a85a6df871a60921761a4848e297d1.tar.xz |
Formatting cleanup.
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | 230 |
1 files changed, 115 insertions, 115 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs index efe40a3..c6ded79 100644 --- a/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs +++ b/OpenSim/Region/ScriptEngine/Common/OSSL_BuilIn_Commands.cs | |||
@@ -603,64 +603,64 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
603 | { | 603 | { |
604 | 604 | ||
605 | // Console.WriteLine(""+JSON[i]); | 605 | // Console.WriteLine(""+JSON[i]); |
606 | switch(JSON[i]) | 606 | switch (JSON[i]) |
607 | { | 607 | { |
608 | case '{': | 608 | case '{': |
609 | // 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 | 609 | // 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 |
610 | 610 | ||
611 | Hashtable currentObject = new Hashtable(); | 611 | Hashtable currentObject = new Hashtable(); |
612 | if(objectStack.Count==0) // the stack should only be empty for the first outer object | 612 | if (objectStack.Count==0) // the stack should only be empty for the first outer object |
613 | { | 613 | { |
614 | 614 | ||
615 | objectStack.Push(jsondata); | 615 | objectStack.Push(jsondata); |
616 | } | 616 | } |
617 | else if(objectStack.Peek().ToString()=="System.Collections.ArrayList") | 617 | else if (objectStack.Peek().ToString()=="System.Collections.ArrayList") |
618 | { | 618 | { |
619 | // add it to the parent array | 619 | // add it to the parent array |
620 | ((ArrayList)objectStack.Peek()).Add(currentObject); | 620 | ((ArrayList)objectStack.Peek()).Add(currentObject); |
621 | objectStack.Push(currentObject); | 621 | objectStack.Push(currentObject); |
622 | } | 622 | } |
623 | else | 623 | else |
624 | { | 624 | { |
625 | // add it to the parent hashtable | 625 | // add it to the parent hashtable |
626 | ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject); | 626 | ((Hashtable)objectStack.Peek()).Add(currentKey,currentObject); |
627 | objectStack.Push(currentObject); | 627 | objectStack.Push(currentObject); |
628 | } | 628 | } |
629 | 629 | ||
630 | // clear the key | 630 | // clear the key |
631 | currentKey=null; | 631 | currentKey=null; |
632 | break; | 632 | break; |
633 | case '}': | 633 | case '}': |
634 | // pop the hashtable off the stack | 634 | // pop the hashtable off the stack |
635 | objectStack.Pop(); | 635 | objectStack.Pop(); |
636 | break; | 636 | break; |
637 | case '"':// string boundary | 637 | case '"':// string boundary |
638 | 638 | ||
639 | string tokenValue=""; | 639 | string tokenValue=""; |
640 | i++; // move to next char | 640 | i++; // move to next char |
641 | 641 | ||
642 | // just loop through until the next quote mark storing the string | 642 | // just loop through until the next quote mark storing the string |
643 | while(JSON[i]!='"') | 643 | while (JSON[i]!='"') |
644 | { | 644 | { |
645 | tokenValue+=JSON[i++]; | 645 | tokenValue+=JSON[i++]; |
646 | } | 646 | } |
647 | 647 | ||
648 | // ok we've got a string, if we've got an array on the top of the stack then we store it | 648 | // ok we've got a string, if we've got an array on the top of the stack then we store it |
649 | if(objectStack.Peek().ToString()=="System.Collections.ArrayList") | 649 | if (objectStack.Peek().ToString()=="System.Collections.ArrayList") |
650 | { | 650 | { |
651 | ((ArrayList)objectStack.Peek()).Add(tokenValue); | 651 | ((ArrayList)objectStack.Peek()).Add(tokenValue); |
652 | } | 652 | } |
653 | else if(currentKey==null) // no key stored and its not an array this must be a key so store it | 653 | else if (currentKey==null) // no key stored and its not an array this must be a key so store it |
654 | { | 654 | { |
655 | currentKey = tokenValue; | 655 | currentKey = tokenValue; |
656 | } | 656 | } |
657 | else | 657 | else |
658 | { | 658 | { |
659 | // we have a key so lets store this value | 659 | // we have a key so lets store this value |
660 | ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue); | 660 | ((Hashtable)objectStack.Peek()).Add(currentKey,tokenValue); |
661 | // now lets clear the key, we're done with it and moving on | 661 | // now lets clear the key, we're done with it and moving on |
662 | currentKey=null; | 662 | currentKey=null; |
663 | } | 663 | } |
664 | 664 | ||
665 | break; | 665 | break; |
666 | case ':':// key : value separator | 666 | case ':':// key : value separator |
@@ -670,83 +670,83 @@ namespace OpenSim.Region.ScriptEngine.Common | |||
670 | // just ignore | 670 | // just ignore |
671 | break; | 671 | break; |
672 | case '[': // array start | 672 | case '[': // array start |
673 | ArrayList currentArray = new ArrayList(); | 673 | ArrayList currentArray = new ArrayList(); |
674 | 674 | ||
675 | if(objectStack.Peek().ToString()=="System.Collections.ArrayList") | 675 | if (objectStack.Peek().ToString()=="System.Collections.ArrayList") |
676 | { | 676 | { |
677 | ((ArrayList)objectStack.Peek()).Add(currentArray); | 677 | ((ArrayList)objectStack.Peek()).Add(currentArray); |
678 | } | 678 | } |
679 | else | 679 | else |
680 | { | 680 | { |
681 | ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray); | 681 | ((Hashtable)objectStack.Peek()).Add(currentKey,currentArray); |
682 | // clear the key | 682 | // clear the key |
683 | currentKey=null; | 683 | currentKey=null; |
684 | } | 684 | } |
685 | objectStack.Push(currentArray); | 685 | objectStack.Push(currentArray); |
686 | 686 | ||
687 | break; | 687 | break; |
688 | case ',':// seperator | 688 | case ',':// seperator |
689 | // just ignore | 689 | // just ignore |
690 | break; | 690 | break; |
691 | case ']'://Array end | 691 | case ']'://Array end |
692 | // pop the array off the stack | 692 | // pop the array off the stack |
693 | objectStack.Pop(); | 693 | objectStack.Pop(); |
694 | break; | 694 | break; |
695 | case 't': // we've found a character start not in quotes, it must be a boolean true | 695 | case 't': // we've found a character start not in quotes, it must be a boolean true |
696 | 696 | ||
697 | if(objectStack.Peek().ToString()=="System.Collections.ArrayList") | 697 | if (objectStack.Peek().ToString()=="System.Collections.ArrayList") |
698 | { | 698 | { |
699 | ((ArrayList)objectStack.Peek()).Add(true); | 699 | ((ArrayList)objectStack.Peek()).Add(true); |
700 | } | 700 | } |
701 | else | 701 | else |
702 | { | 702 | { |
703 | ((Hashtable)objectStack.Peek()).Add(currentKey,true); | 703 | ((Hashtable)objectStack.Peek()).Add(currentKey,true); |
704 | } | 704 | } |
705 | 705 | ||
706 | //advance the counter to the letter 'e' | 706 | //advance the counter to the letter 'e' |
707 | i = i+3; | 707 | i = i+3; |
708 | break; | 708 | break; |
709 | case 'f': // we've found a character start not in quotes, it must be a boolean false | 709 | case 'f': // we've found a character start not in quotes, it must be a boolean false |
710 | 710 | ||
711 | if(objectStack.Peek().ToString()=="System.Collections.ArrayList") | 711 | if (objectStack.Peek().ToString()=="System.Collections.ArrayList") |
712 | { | 712 | { |
713 | ((ArrayList)objectStack.Peek()).Add(false); | 713 | ((ArrayList)objectStack.Peek()).Add(false); |
714 | } | 714 | } |
715 | else | 715 | else |
716 | { | 716 | { |
717 | ((Hashtable)objectStack.Peek()).Add(currentKey,false); | 717 | ((Hashtable)objectStack.Peek()).Add(currentKey,false); |
718 | } | 718 | } |
719 | //advance the counter to the letter 'e' | 719 | //advance the counter to the letter 'e' |
720 | i = i+4; | 720 | i = i+4; |
721 | break; | 721 | break; |
722 | 722 | ||
723 | default: | 723 | default: |
724 | // ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately | 724 | // ok here we're catching all numeric types int,double,long we might want to spit these up mr accurately |
725 | // but for now we'll just do them as strings | 725 | // but for now we'll just do them as strings |
726 | 726 | ||
727 | string numberValue=""; | 727 | string numberValue=""; |
728 | 728 | ||
729 | // just loop through until the next known marker quote mark storing the string | 729 | // just loop through until the next known marker quote mark storing the string |
730 | while(JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') | 730 | while (JSON[i] != '"' && JSON[i] != ',' && JSON[i] != ']' && JSON[i] != '}' && JSON[i] != ' ') |
731 | { | 731 | { |
732 | numberValue+=""+JSON[i++]; | 732 | numberValue+=""+JSON[i++]; |
733 | } | 733 | } |
734 | 734 | ||
735 | i--; // we want to process this caracter that marked the end of this string in the main loop | 735 | i--; // we want to process this caracter that marked the end of this string in the main loop |
736 | 736 | ||
737 | // ok we've got a string, if we've got an array on the top of the stack then we store it | 737 | // ok we've got a string, if we've got an array on the top of the stack then we store it |
738 | if(objectStack.Peek().ToString()=="System.Collections.ArrayList") | 738 | if (objectStack.Peek().ToString()=="System.Collections.ArrayList") |
739 | { | 739 | { |
740 | ((ArrayList)objectStack.Peek()).Add(numberValue); | 740 | ((ArrayList)objectStack.Peek()).Add(numberValue); |
741 | } | 741 | } |
742 | else | 742 | else |
743 | { | 743 | { |
744 | // we have a key so lets store this value | 744 | // we have a key so lets store this value |
745 | ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue); | 745 | ((Hashtable)objectStack.Peek()).Add(currentKey,numberValue); |
746 | // now lets clear the key, we're done with it and moving on | 746 | // now lets clear the key, we're done with it and moving on |
747 | currentKey=null; | 747 | currentKey=null; |
748 | } | 748 | } |
749 | 749 | ||
750 | break; | 750 | break; |
751 | } | 751 | } |
752 | } | 752 | } |