diff options
author | Dr Scofield | 2009-05-18 09:34:30 +0000 |
---|---|---|
committer | Dr Scofield | 2009-05-18 09:34:30 +0000 |
commit | 2ad8710e190b7543989cdb96a5268d21d2b5cefb (patch) | |
tree | 1ebf5e7463f04201459ff2fcd8f81b32a23d6ab2 /OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs | |
parent | Thank you kindly, StrawberryFride, for a patch that: (diff) | |
download | opensim-SC-2ad8710e190b7543989cdb96a5268d21d2b5cefb.zip opensim-SC-2ad8710e190b7543989cdb96a5268d21d2b5cefb.tar.gz opensim-SC-2ad8710e190b7543989cdb96a5268d21d2b5cefb.tar.bz2 opensim-SC-2ad8710e190b7543989cdb96a5268d21d2b5cefb.tar.xz |
fixing XmlWriter problem
Diffstat (limited to '')
-rw-r--r-- | OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs b/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs index b49c5e9..5f83885 100644 --- a/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs +++ b/OpenSim/ApplicationPlugins/Rest/Regions/GETRegionInfoHandler.cs | |||
@@ -66,78 +66,78 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions | |||
66 | 66 | ||
67 | public string GetRegionInfoHandlerRegions(OSHttpResponse httpResponse) | 67 | public string GetRegionInfoHandlerRegions(OSHttpResponse httpResponse) |
68 | { | 68 | { |
69 | RestXmlWriter rxw = new RestXmlWriter(new StringWriter()); | ||
70 | |||
69 | // regions info | 71 | // regions info |
70 | XmlWriter.WriteStartElement(String.Empty, "regions", String.Empty); | 72 | rxw.WriteStartElement(String.Empty, "regions", String.Empty); |
71 | { | 73 | { |
72 | // regions info: number of regions | 74 | // regions info: number of regions |
73 | XmlWriter.WriteStartAttribute(String.Empty, "number", String.Empty); | 75 | rxw.WriteStartAttribute(String.Empty, "number", String.Empty); |
74 | XmlWriter.WriteValue(App.SceneManager.Scenes.Count); | 76 | rxw.WriteValue(App.SceneManager.Scenes.Count); |
75 | XmlWriter.WriteEndAttribute(); | 77 | rxw.WriteEndAttribute(); |
76 | 78 | ||
77 | // regions info: max number of regions | 79 | // regions info: max number of regions |
78 | XmlWriter.WriteStartAttribute(String.Empty, "max", String.Empty); | 80 | rxw.WriteStartAttribute(String.Empty, "max", String.Empty); |
79 | if (App.ConfigSource.Source.Configs["RemoteAdmin"] != null) | 81 | if (App.ConfigSource.Source.Configs["RemoteAdmin"] != null) |
80 | { | 82 | { |
81 | XmlWriter.WriteValue(App.ConfigSource.Source.Configs["RemoteAdmin"].GetInt("region_limit", -1)); | 83 | rxw.WriteValue(App.ConfigSource.Source.Configs["RemoteAdmin"].GetInt("region_limit", -1)); |
82 | } | 84 | } |
83 | else | 85 | else |
84 | { | 86 | { |
85 | XmlWriter.WriteValue(-1); | 87 | rxw.WriteValue(-1); |
86 | } | 88 | } |
87 | XmlWriter.WriteEndAttribute(); | 89 | rxw.WriteEndAttribute(); |
88 | 90 | ||
89 | // regions info: region | 91 | // regions info: region |
90 | foreach (Scene s in App.SceneManager.Scenes) | 92 | foreach (Scene s in App.SceneManager.Scenes) |
91 | { | 93 | { |
92 | XmlWriter.WriteStartElement(String.Empty, "region", String.Empty); | 94 | rxw.WriteStartElement(String.Empty, "region", String.Empty); |
93 | 95 | ||
94 | XmlWriter.WriteStartAttribute(String.Empty, "uuid", String.Empty); | 96 | rxw.WriteStartAttribute(String.Empty, "uuid", String.Empty); |
95 | XmlWriter.WriteString(s.RegionInfo.RegionID.ToString()); | 97 | rxw.WriteString(s.RegionInfo.RegionID.ToString()); |
96 | XmlWriter.WriteEndAttribute(); | 98 | rxw.WriteEndAttribute(); |
97 | 99 | ||
98 | XmlWriter.WriteStartAttribute(String.Empty, "name", String.Empty); | 100 | rxw.WriteStartAttribute(String.Empty, "name", String.Empty); |
99 | XmlWriter.WriteString(s.RegionInfo.RegionName); | 101 | rxw.WriteString(s.RegionInfo.RegionName); |
100 | XmlWriter.WriteEndAttribute(); | 102 | rxw.WriteEndAttribute(); |
101 | 103 | ||
102 | XmlWriter.WriteStartAttribute(String.Empty, "x", String.Empty); | 104 | rxw.WriteStartAttribute(String.Empty, "x", String.Empty); |
103 | XmlWriter.WriteValue(s.RegionInfo.RegionLocX); | 105 | rxw.WriteValue(s.RegionInfo.RegionLocX); |
104 | XmlWriter.WriteEndAttribute(); | 106 | rxw.WriteEndAttribute(); |
105 | 107 | ||
106 | XmlWriter.WriteStartAttribute(String.Empty, "y", String.Empty); | 108 | rxw.WriteStartAttribute(String.Empty, "y", String.Empty); |
107 | XmlWriter.WriteValue(s.RegionInfo.RegionLocY); | 109 | rxw.WriteValue(s.RegionInfo.RegionLocY); |
108 | XmlWriter.WriteEndAttribute(); | 110 | rxw.WriteEndAttribute(); |
109 | 111 | ||
110 | XmlWriter.WriteStartAttribute(String.Empty, "external_hostname", String.Empty); | 112 | rxw.WriteStartAttribute(String.Empty, "external_hostname", String.Empty); |
111 | XmlWriter.WriteString(s.RegionInfo.ExternalHostName); | 113 | rxw.WriteString(s.RegionInfo.ExternalHostName); |
112 | XmlWriter.WriteEndAttribute(); | 114 | rxw.WriteEndAttribute(); |
113 | 115 | ||
114 | XmlWriter.WriteStartAttribute(String.Empty, "master_name", String.Empty); | 116 | rxw.WriteStartAttribute(String.Empty, "master_name", String.Empty); |
115 | XmlWriter.WriteString(String.Format("{0} {1}", s.RegionInfo.MasterAvatarFirstName, s.RegionInfo.MasterAvatarLastName)); | 117 | rxw.WriteString(String.Format("{0} {1}", s.RegionInfo.MasterAvatarFirstName, s.RegionInfo.MasterAvatarLastName)); |
116 | XmlWriter.WriteEndAttribute(); | 118 | rxw.WriteEndAttribute(); |
117 | 119 | ||
118 | XmlWriter.WriteStartAttribute(String.Empty, "master_uuid", String.Empty); | 120 | rxw.WriteStartAttribute(String.Empty, "master_uuid", String.Empty); |
119 | XmlWriter.WriteString(s.RegionInfo.MasterAvatarAssignedUUID.ToString()); | 121 | rxw.WriteString(s.RegionInfo.MasterAvatarAssignedUUID.ToString()); |
120 | XmlWriter.WriteEndAttribute(); | 122 | rxw.WriteEndAttribute(); |
121 | 123 | ||
122 | XmlWriter.WriteStartAttribute(String.Empty, "ip", String.Empty); | 124 | rxw.WriteStartAttribute(String.Empty, "ip", String.Empty); |
123 | XmlWriter.WriteString(s.RegionInfo.InternalEndPoint.ToString()); | 125 | rxw.WriteString(s.RegionInfo.InternalEndPoint.ToString()); |
124 | XmlWriter.WriteEndAttribute(); | 126 | rxw.WriteEndAttribute(); |
125 | 127 | ||
126 | int users = s.GetAvatars().Count; | 128 | int users = s.GetAvatars().Count; |
127 | XmlWriter.WriteStartAttribute(String.Empty, "avatars", String.Empty); | 129 | rxw.WriteStartAttribute(String.Empty, "avatars", String.Empty); |
128 | XmlWriter.WriteValue(users); | 130 | rxw.WriteValue(users); |
129 | XmlWriter.WriteEndAttribute(); | 131 | rxw.WriteEndAttribute(); |
130 | 132 | ||
131 | XmlWriter.WriteStartAttribute(String.Empty, "objects", String.Empty); | 133 | rxw.WriteStartAttribute(String.Empty, "objects", String.Empty); |
132 | XmlWriter.WriteValue(s.Entities.Count - users); | 134 | rxw.WriteValue(s.Entities.Count - users); |
133 | XmlWriter.WriteEndAttribute(); | 135 | rxw.WriteEndAttribute(); |
134 | 136 | ||
135 | XmlWriter.WriteEndElement(); | 137 | rxw.WriteEndElement(); |
136 | } | 138 | } |
137 | } | 139 | } |
138 | XmlWriter.WriteEndElement(); | 140 | return rxw.ToString(); |
139 | |||
140 | return XmlWriterResult; | ||
141 | } | 141 | } |
142 | #endregion GET methods | 142 | #endregion GET methods |
143 | } | 143 | } |