From 4e93228e25a941dde4b01c4ec934cd1907096a6f Mon Sep 17 00:00:00 2001
From: Dr Scofield
Date: Mon, 19 May 2008 11:52:51 +0000
Subject: fixing exception when RestPlugin not configured. refactors
RestRegionPlugin, adds error checking.
---
.../Rest/Regions/RegionDetails.cs | 34 ++++++++++++++++++++--
1 file changed, 32 insertions(+), 2 deletions(-)
(limited to 'OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs')
diff --git a/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs b/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs
index 5102e3f..c86c67f 100644
--- a/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs
+++ b/OpenSim/ApplicationPlugins/Rest/Regions/RegionDetails.cs
@@ -23,7 +23,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*
+*
*/
using libsecondlife;
@@ -65,8 +65,38 @@ namespace OpenSim.ApplicationPlugins.Rest.Regions
region_external_hostname = regInfo.ExternalHostName;
if (!String.IsNullOrEmpty(regInfo.MasterAvatarFirstName))
- region_owner = String.Format("{0} {1}", regInfo.MasterAvatarFirstName,
+ region_owner = String.Format("{0} {1}", regInfo.MasterAvatarFirstName,
regInfo.MasterAvatarLastName);
}
+
+ public string this[string idx]
+ {
+ get
+ {
+ switch(idx.ToLower())
+ {
+ case "name":
+ return region_name;
+ case "id":
+ return region_id;
+ case "location":
+ return String.Format("{0}{1}", region_x, region_y);
+ case "owner":
+ return region_owner;
+ case "owner_id":
+ return region_owner_id;
+ case "http_port":
+ return region_http_port.ToString();
+ case "server_uri":
+ return region_server_uri;
+ case "external_hostname":
+ case "hostname":
+ return region_external_hostname;
+
+ default:
+ return null;
+ }
+ }
+ }
}
}
\ No newline at end of file
--
cgit v1.1