Need to add the grid portion next to test this thing

zircon^2
gareth 2007-05-20 16:17:19 +00:00
parent 7073286008
commit 3b1eba2ffc
2 changed files with 18 additions and 3 deletions

View File

@ -49,9 +49,11 @@ namespace OpenGridServices.Manager
System.Net.WebClient mapdownloader = new WebClient();
Stream regionliststream = mapdownloader.OpenRead(ServerURL + "/regionlist");
RegionBlock TempRegionData;
XmlDocument doc = new XmlDocument();
doc.Load(regionliststream);
regionliststream.Close();
XmlNode rootnode = doc.FirstChild;
if (rootnode.Name != "regions")
{
@ -63,6 +65,9 @@ namespace OpenGridServices.Manager
if(rootnode.ChildNodes.Item(i).Name != "region") {
// TODO - ERROR!
} else {
TempRegionData = new RegionBlock();
}
}
}

View File

@ -1,4 +1,5 @@
using System;
using System.Xml;
using libsecondlife;
using OpenSim.Framework.Utilities;
@ -8,11 +9,12 @@ namespace OpenGridServices.Manager
public class RegionBlock
{
private uint regloc_x;
private uint regloc_y;
public uint regloc_x;
public uint regloc_y;
public string httpd_url;
public string region_name;
public ulong regionhandle {
get { return Util.UIntsToLong(regloc_x*256,regloc_y*256); }
@ -23,5 +25,13 @@ namespace OpenGridServices.Manager
public RegionBlock()
{
}
public void LoadFromXmlNode(XmlNode sourcenode)
{
this.regloc_x=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_x").Value);
this.regloc_y=Convert.ToUInt32(sourcenode.Attributes.GetNamedItem("loc_y").Value);
this.region_name=sourcenode.Attributes.GetNamedItem("region_name").Value;
this.httpd_url=sourcenode.Attributes.GetNamedItem("httpd_url").Value;
}
}
}