From 15d6bb4ce55092d2ee0a27bbb3ec5e7760a05dcc Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Fri, 18 Sep 2009 20:09:43 -0700 Subject: Reverted the order of reading configs in GridServiceBase. --- OpenSim/Services/GridService/GridServiceBase.cs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'OpenSim/Services/GridService') diff --git a/OpenSim/Services/GridService/GridServiceBase.cs b/OpenSim/Services/GridService/GridServiceBase.cs index 7b69290..7522e64 100644 --- a/OpenSim/Services/GridService/GridServiceBase.cs +++ b/OpenSim/Services/GridService/GridServiceBase.cs @@ -47,17 +47,6 @@ namespace OpenSim.Services.GridService string realm = "regions"; // - // Try reading the [AssetService] section first, if it exists - // - IConfig gridConfig = config.Configs["GridService"]; - if (gridConfig != null) - { - dllName = gridConfig.GetString("StorageProvider", dllName); - connString = gridConfig.GetString("ConnectionString", connString); - realm = gridConfig.GetString("Realm", realm); - } - - // // Try reading the [DatabaseService] section, if it exists // IConfig dbConfig = config.Configs["DatabaseService"]; @@ -70,6 +59,17 @@ namespace OpenSim.Services.GridService } // + // [GridService] section overrides [DatabaseService], if it exists + // + IConfig gridConfig = config.Configs["GridService"]; + if (gridConfig != null) + { + dllName = gridConfig.GetString("StorageProvider", dllName); + connString = gridConfig.GetString("ConnectionString", connString); + realm = gridConfig.GetString("Realm", realm); + } + + // // We tried, but this doesn't exist. We can't proceed. // if (dllName.Equals(String.Empty)) -- cgit v1.1 From 390137d540b9ae39eba3ba9136bd49d5e992bc5f Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Mon, 21 Sep 2009 11:05:01 -0700 Subject: Added grid handler and grid remote connector. --- OpenSim/Services/GridService/GridService.cs | 65 +++++------------------------ 1 file changed, 11 insertions(+), 54 deletions(-) (limited to 'OpenSim/Services/GridService') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 6aa1c4f..2229421 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -88,13 +88,18 @@ namespace OpenSim.Services.GridService return m_Database.Delete(regionID); } - public List GetNeighbours(UUID scopeID, int x, int y) + public List GetNeighbours(UUID scopeID, UUID regionID) { - List rdatas = m_Database.Get(x - 1, y - 1, x + 1, y + 1, scopeID); List rinfos = new List(); - foreach (RegionData rdata in rdatas) - rinfos.Add(RegionData2RegionInfo(rdata)); + RegionData region = m_Database.Get(regionID, scopeID); + if (region != null) + { + // Not really? Maybe? + List rdatas = m_Database.Get(region.posX - 1, region.posY - 1, region.posX + 1, region.posY + 1, scopeID); + foreach (RegionData rdata in rdatas) + rinfos.Add(RegionData2RegionInfo(rdata)); + } return rinfos; } @@ -164,68 +169,20 @@ namespace OpenSim.Services.GridService rdata.posX = (int)rinfo.RegionLocX; rdata.posY = (int)rinfo.RegionLocY; rdata.RegionID = rinfo.RegionID; + rdata.Data = rinfo.ToKeyValuePairs(); //rdata.RegionName = rinfo.RegionName; - rdata.Data["external_ip_address"] = rinfo.ExternalEndPoint.Address.ToString(); - rdata.Data["external_port"] = rinfo.ExternalEndPoint.Port.ToString(); - rdata.Data["external_host_name"] = rinfo.ExternalHostName; - rdata.Data["http_port"] = rinfo.HttpPort.ToString(); - rdata.Data["internal_ip_address"] = rinfo.InternalEndPoint.Address.ToString(); - rdata.Data["internal_port"] = rinfo.InternalEndPoint.Port.ToString(); - rdata.Data["alternate_ports"] = rinfo.m_allow_alternate_ports.ToString(); - rdata.Data["server_uri"] = rinfo.ServerURI; return rdata; } protected SimpleRegionInfo RegionData2RegionInfo(RegionData rdata) { - SimpleRegionInfo rinfo = new SimpleRegionInfo(); + SimpleRegionInfo rinfo = new SimpleRegionInfo(rdata.Data); rinfo.RegionLocX = (uint)rdata.posX; rinfo.RegionLocY = (uint)rdata.posY; rinfo.RegionID = rdata.RegionID; //rinfo.RegionName = rdata.RegionName; - // Now for the variable data - if ((rdata.Data["external_ip_address"] != null) && (rdata.Data["external_port"] != null)) - { - int port = 0; - Int32.TryParse((string)rdata.Data["external_port"], out port); - IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)rdata.Data["external_ip_address"]), port); - rinfo.ExternalEndPoint = ep; - } - else - rinfo.ExternalEndPoint = new IPEndPoint(new IPAddress(0), 0); - - if (rdata.Data["external_host_name"] != null) - rinfo.ExternalHostName = (string)rdata.Data["external_host_name"] ; - - if (rdata.Data["http_port"] != null) - { - UInt32 port = 0; - UInt32.TryParse((string)rdata.Data["http_port"], out port); - rinfo.HttpPort = port; - } - - if ((rdata.Data["internal_ip_address"] != null) && (rdata.Data["internal_port"] != null)) - { - int port = 0; - Int32.TryParse((string)rdata.Data["internal_port"], out port); - IPEndPoint ep = new IPEndPoint(IPAddress.Parse((string)rdata.Data["internal_ip_address"]), port); - rinfo.InternalEndPoint = ep; - } - else - rinfo.InternalEndPoint = new IPEndPoint(new IPAddress(0), 0); - - if (rdata.Data["alternate_ports"] != null) - { - bool alts = false; - Boolean.TryParse((string)rdata.Data["alternate_ports"], out alts); - rinfo.m_allow_alternate_ports = alts; - } - - if (rdata.Data["server_uri"] != null) - rinfo.ServerURI = (string)rdata.Data["server_uri"]; - return rinfo; } -- cgit v1.1