aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/ApplicationPlugins
diff options
context:
space:
mode:
authorDr Scofield2008-09-24 12:04:58 +0000
committerDr Scofield2008-09-24 12:04:58 +0000
commit578748065556f359feab4068317d736aaa60483c (patch)
tree50cf109d98a5fc708dff35a114f5d15a8812a1a5 /OpenSim/ApplicationPlugins
parentcleanups, fixing REST appearance services. (diff)
downloadopensim-SC_OLD-578748065556f359feab4068317d736aaa60483c.zip
opensim-SC_OLD-578748065556f359feab4068317d736aaa60483c.tar.gz
opensim-SC_OLD-578748065556f359feab4068317d736aaa60483c.tar.bz2
opensim-SC_OLD-578748065556f359feab4068317d736aaa60483c.tar.xz
From: alan webb (alan_webb@us.ibm.com)
cleanups.
Diffstat (limited to 'OpenSim/ApplicationPlugins')
-rw-r--r--OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs120
1 files changed, 60 insertions, 60 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
index c375ade..4a44321 100644
--- a/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Inventory/RestAppearanceServices.cs
@@ -721,18 +721,19 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
721 721
722 private void FormatPart(AppearanceRequestData rdata, string part, UUID item, UUID asset) 722 private void FormatPart(AppearanceRequestData rdata, string part, UUID item, UUID asset)
723 { 723 {
724 if(item != UUID.Zero || asset != UUID.Zero) 724 if (item != UUID.Zero || asset != UUID.Zero)
725 { 725 {
726 rdata.writer.WriteStartElement(part); 726 rdata.writer.WriteStartElement(part);
727 if(item != UUID.Zero) 727 if (item != UUID.Zero)
728 { 728 {
729 rdata.writer.WriteAttributeString("Item",item.ToString()); 729 rdata.writer.WriteAttributeString("Item",item.ToString());
730 } 730 }
731 if(asset != UUID.Zero) 731
732 if (asset != UUID.Zero)
732 { 733 {
733 rdata.writer.WriteAttributeString("Item",asset.ToString()); 734 rdata.writer.WriteAttributeString("Item",asset.ToString());
734 } 735 }
735 rdata.writer.WriteEndElement(); 736 rdata.writer.WriteEndElement();
736 } 737 }
737 } 738 }
738 739
@@ -741,16 +742,16 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
741 742
742 Rest.Log.DebugFormat("{0} FormatUserAppearance", MsgId); 743 Rest.Log.DebugFormat("{0} FormatUserAppearance", MsgId);
743 744
744 if(rdata.userAppearance != null) 745 if (rdata.userAppearance != null)
745 { 746 {
746 747
747 Rest.Log.DebugFormat("{0} FormatUserAppearance: appearance object exists", MsgId); 748 Rest.Log.DebugFormat("{0} FormatUserAppearance: appearance object exists", MsgId);
748 rdata.writer.WriteStartElement("Appearance"); 749 rdata.writer.WriteStartElement("Appearance");
749 750
750 rdata.writer.WriteAttributeString("Height", rdata.userAppearance.AvatarHeight.ToString()); 751 rdata.writer.WriteAttributeString("Height", rdata.userAppearance.AvatarHeight.ToString());
751 if(rdata.userAppearance.Owner != null) 752 if (rdata.userAppearance.Owner != null)
752 rdata.writer.WriteAttributeString("Owner", rdata.userAppearance.Owner.ToString()); 753 rdata.writer.WriteAttributeString("Owner", rdata.userAppearance.Owner.ToString());
753 rdata.writer.WriteAttributeString("Serial", rdata.userAppearance.Serial.ToString()); 754 rdata.writer.WriteAttributeString("Serial", rdata.userAppearance.Serial.ToString());
754 755
755 FormatPart(rdata, "Body", rdata.userAppearance.BodyItem, rdata.userAppearance.BodyAsset); 756 FormatPart(rdata, "Body", rdata.userAppearance.BodyItem, rdata.userAppearance.BodyAsset);
756 FormatPart(rdata, "Skin", rdata.userAppearance.SkinItem, rdata.userAppearance.SkinAsset); 757 FormatPart(rdata, "Skin", rdata.userAppearance.SkinItem, rdata.userAppearance.SkinAsset);
@@ -769,73 +770,72 @@ namespace OpenSim.ApplicationPlugins.Rest.Inventory
769 FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset); 770 FormatPart(rdata, "UnderShirt", rdata.userAppearance.UnderShirtItem, rdata.userAppearance.UnderShirtAsset);
770 FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset); 771 FormatPart(rdata, "UnderPants", rdata.userAppearance.UnderPantsItem, rdata.userAppearance.UnderPantsAsset);
771 772
772 Hashtable attachments = rdata.userAppearance.GetAttachments(); 773 Hashtable attachments = rdata.userAppearance.GetAttachments();
773
774 if(attachments != null)
775 {
776 774
777 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId); 775 if (attachments != null)
776 {
778 777
779 rdata.writer.WriteStartElement("Attachments"); 778 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting attachments", MsgId);
780 for (int i=0; i<attachments.Count;i++)
781 {
782 Hashtable attachment = attachments[i] as Hashtable;
783 rdata.writer.WriteStartElement("Attachment");
784 rdata.writer.WriteAttributeString("AtPoint", i.ToString());
785 rdata.writer.WriteAttributeString("Item", (string) attachment["item"]);
786 rdata.writer.WriteAttributeString("Asset", (string) attachment["asset"]);
787 rdata.writer.WriteEndElement();
788 }
789 rdata.writer.WriteEndElement();
790 }
791 779
792 Primitive.TextureEntry texture = rdata.userAppearance.Texture; 780 rdata.writer.WriteStartElement("Attachments");
781 for (int i = 0; i < attachments.Count; i++)
782 {
783 Hashtable attachment = attachments[i] as Hashtable;
784 rdata.writer.WriteStartElement("Attachment");
785 rdata.writer.WriteAttributeString("AtPoint", i.ToString());
786 rdata.writer.WriteAttributeString("Item", (string) attachment["item"]);
787 rdata.writer.WriteAttributeString("Asset", (string) attachment["asset"]);
788 rdata.writer.WriteEndElement();
789 }
790 rdata.writer.WriteEndElement();
791 }
793 792
794 if (texture != null && (texture.DefaultTexture != null || texture.FaceTextures != null)) 793 Primitive.TextureEntry texture = rdata.userAppearance.Texture;
795 {
796 794
797 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting textures", MsgId); 795 if (texture != null && (texture.DefaultTexture != null || texture.FaceTextures != null))
796 {
797 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting textures", MsgId);
798 798
799 rdata.writer.WriteStartElement("Texture"); 799 rdata.writer.WriteStartElement("Texture");
800 800
801 if(texture.DefaultTexture != null) 801 if (texture.DefaultTexture != null)
802 { 802 {
803 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting default texture", MsgId); 803 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting default texture", MsgId);
804 rdata.writer.WriteAttributeString("Default", 804 rdata.writer.WriteAttributeString("Default",
805 texture.DefaultTexture.TextureID.ToString()); 805 texture.DefaultTexture.TextureID.ToString());
806 } 806 }
807 807
808 if(texture.FaceTextures != null) 808 if (texture.FaceTextures != null)
809 { 809 {
810 810
811 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting face textures", MsgId); 811 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting face textures", MsgId);
812 812
813 for (int i=0; i<texture.FaceTextures.Length;i++) 813 for (int i=0; i<texture.FaceTextures.Length;i++)
814 { 814 {
815 if (texture.FaceTextures[i] != null) 815 if (texture.FaceTextures[i] != null)
816 { 816 {
817 rdata.writer.WriteStartElement("Face"); 817 rdata.writer.WriteStartElement("Face");
818 rdata.writer.WriteAttributeString("Index", i.ToString()); 818 rdata.writer.WriteAttributeString("Index", i.ToString());
819 rdata.writer.WriteAttributeString("Id", 819 rdata.writer.WriteAttributeString("Id",
820 texture.FaceTextures[i].TextureID.ToString()); 820 texture.FaceTextures[i].TextureID.ToString());
821 rdata.writer.WriteEndElement(); 821 rdata.writer.WriteEndElement();
822 } 822 }
823 } 823 }
824 } 824 }
825 825
826 rdata.writer.WriteEndElement(); 826 rdata.writer.WriteEndElement();
827 } 827 }
828 828
829 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting visual parameters", MsgId); 829 Rest.Log.DebugFormat("{0} FormatUserAppearance: Formatting visual parameters", MsgId);
830 830
831 rdata.writer.WriteStartElement("VisualParameters"); 831 rdata.writer.WriteStartElement("VisualParameters");
832 rdata.writer.WriteBase64(rdata.userAppearance.VisualParams,0, 832 rdata.writer.WriteBase64(rdata.userAppearance.VisualParams,0,
833 rdata.userAppearance.VisualParams.Length); 833 rdata.userAppearance.VisualParams.Length);
834 rdata.writer.WriteEndElement(); 834 rdata.writer.WriteEndElement();
835 rdata.writer.WriteFullEndElement(); 835 rdata.writer.WriteFullEndElement();
836 } 836 }
837 837
838 Rest.Log.DebugFormat("{0} FormatUserAppearance: completed", MsgId); 838 Rest.Log.DebugFormat("{0} FormatUserAppearance: completed", MsgId);
839 839
840 return; 840 return;
841 } 841 }