Added Check4096 config var under [GridService], at the request of many. Changed the iteration that Marck had on the Hyperlinker.
ATTENTION! CONFIGURATION CHANGE AFFECTING Robust.HG.ini.example and StandaloneCommon.ini.example.prebuild-update
parent
7e47ab746e
commit
0090534793
|
@ -233,10 +233,10 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid
|
||||||
return m_GridService.GetFallbackRegions(scopeID, x, y);
|
return m_GridService.GetFallbackRegions(scopeID, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||||
{
|
{
|
||||||
return m_GridService.GetHyperlinks(scopeID);
|
return m_GridService.GetHyperlinks(scopeID);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -136,9 +136,9 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid.Tests
|
||||||
900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
|
900 * (int)Constants.RegionSize, 1100 * (int)Constants.RegionSize);
|
||||||
Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
|
Assert.IsNotNull(results, "Retrieved GetRegionRange list is null");
|
||||||
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
|
Assert.That(results.Count, Is.EqualTo(2), "Retrieved neighbour collection is not the number expected");
|
||||||
|
|
||||||
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
|
results = m_LocalConnector.GetHyperlinks(UUID.Zero);
|
||||||
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
|
Assert.IsNotNull(results, "Retrieved GetHyperlinks list is null");
|
||||||
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
|
Assert.That(results.Count, Is.EqualTo(0), "Retrieved linked regions collection is not the number expected");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -556,55 +556,55 @@ namespace OpenSim.Services.Connectors
|
||||||
return rinfos;
|
return rinfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||||
{
|
{
|
||||||
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
Dictionary<string, object> sendData = new Dictionary<string, object>();
|
||||||
|
|
||||||
sendData["SCOPEID"] = scopeID.ToString();
|
sendData["SCOPEID"] = scopeID.ToString();
|
||||||
|
|
||||||
sendData["METHOD"] = "get_hyperlinks";
|
sendData["METHOD"] = "get_hyperlinks";
|
||||||
|
|
||||||
List<GridRegion> rinfos = new List<GridRegion>();
|
List<GridRegion> rinfos = new List<GridRegion>();
|
||||||
string reply = string.Empty;
|
string reply = string.Empty;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
reply = SynchronousRestFormsRequester.MakeRequest("POST",
|
||||||
m_ServerURI + "/grid",
|
m_ServerURI + "/grid",
|
||||||
ServerUtils.BuildQueryString(sendData));
|
ServerUtils.BuildQueryString(sendData));
|
||||||
|
|
||||||
//m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
|
//m_log.DebugFormat("[GRID CONNECTOR]: reply was {0}", reply);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
|
m_log.DebugFormat("[GRID CONNECTOR]: Exception when contacting grid server: {0}", e.Message);
|
||||||
return rinfos;
|
return rinfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reply != string.Empty)
|
if (reply != string.Empty)
|
||||||
{
|
{
|
||||||
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
Dictionary<string, object> replyData = ServerUtils.ParseXmlResponse(reply);
|
||||||
|
|
||||||
if (replyData != null)
|
if (replyData != null)
|
||||||
{
|
{
|
||||||
Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
|
Dictionary<string, object>.ValueCollection rinfosList = replyData.Values;
|
||||||
foreach (object r in rinfosList)
|
foreach (object r in rinfosList)
|
||||||
{
|
{
|
||||||
if (r is Dictionary<string, object>)
|
if (r is Dictionary<string, object>)
|
||||||
{
|
{
|
||||||
GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
|
GridRegion rinfo = new GridRegion((Dictionary<string, object>)r);
|
||||||
rinfos.Add(rinfo);
|
rinfos.Add(rinfo);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
|
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks {0} received null response",
|
||||||
scopeID);
|
scopeID);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
|
m_log.DebugFormat("[GRID CONNECTOR]: GetHyperlinks received null reply");
|
||||||
|
|
||||||
return rinfos;
|
return rinfos;
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
|
public virtual int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -357,11 +357,11 @@ namespace OpenSim.Services.Connectors.SimianGrid
|
||||||
return new List<GridRegion>(0);
|
return new List<GridRegion>(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||||
{
|
{
|
||||||
// Hypergrid/linked regions are not supported
|
// Hypergrid/linked regions are not supported
|
||||||
return new List<GridRegion>();
|
return new List<GridRegion>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -426,21 +426,21 @@ namespace OpenSim.Services.GridService
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
public List<GridRegion> GetHyperlinks(UUID scopeID)
|
||||||
{
|
{
|
||||||
List<GridRegion> ret = new List<GridRegion>();
|
List<GridRegion> ret = new List<GridRegion>();
|
||||||
|
|
||||||
List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
|
List<RegionData> regions = m_Database.GetHyperlinks(scopeID);
|
||||||
|
|
||||||
foreach (RegionData r in regions)
|
foreach (RegionData r in regions)
|
||||||
{
|
{
|
||||||
if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
|
if ((Convert.ToInt32(r.Data["flags"]) & (int)OpenSim.Data.RegionFlags.RegionOnline) != 0)
|
||||||
ret.Add(RegionData2RegionInfo(r));
|
ret.Add(RegionData2RegionInfo(r));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
|
m_log.DebugFormat("[GRID SERVICE]: Hyperlinks returned {0} regions", ret.Count);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
public int GetRegionFlags(UUID scopeID, UUID regionID)
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,7 +27,6 @@
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using System.Net;
|
using System.Net;
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
using System.Xml;
|
using System.Xml;
|
||||||
|
@ -63,6 +62,7 @@ namespace OpenSim.Services.GridService
|
||||||
protected GatekeeperServiceConnector m_GatekeeperConnector;
|
protected GatekeeperServiceConnector m_GatekeeperConnector;
|
||||||
|
|
||||||
protected UUID m_ScopeID = UUID.Zero;
|
protected UUID m_ScopeID = UUID.Zero;
|
||||||
|
protected bool m_Check4096 = true;
|
||||||
|
|
||||||
// Hyperlink regions are hyperlinks on the map
|
// Hyperlink regions are hyperlinks on the map
|
||||||
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
|
public readonly Dictionary<UUID, GridRegion> m_HyperlinkRegions = new Dictionary<UUID, GridRegion>();
|
||||||
|
@ -117,6 +117,8 @@ namespace OpenSim.Services.GridService
|
||||||
if (scope != string.Empty)
|
if (scope != string.Empty)
|
||||||
UUID.TryParse(scope, out m_ScopeID);
|
UUID.TryParse(scope, out m_ScopeID);
|
||||||
|
|
||||||
|
m_Check4096 = gridConfig.GetBoolean("Check4096", true);
|
||||||
|
|
||||||
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
m_GatekeeperConnector = new GatekeeperServiceConnector(m_AssetService);
|
||||||
|
|
||||||
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
|
m_log.DebugFormat("[HYPERGRID LINKER]: Loaded all services...");
|
||||||
|
@ -278,7 +280,7 @@ namespace OpenSim.Services.GridService
|
||||||
}
|
}
|
||||||
|
|
||||||
uint x, y;
|
uint x, y;
|
||||||
if (!Check4096(handle, out x, out y))
|
if (m_Check4096 && !Check4096(handle, out x, out y))
|
||||||
{
|
{
|
||||||
RemoveHyperlinkRegion(regInfo.RegionID);
|
RemoveHyperlinkRegion(regInfo.RegionID);
|
||||||
reason = "Region is too far (" + x + ", " + y + ")";
|
reason = "Region is too far (" + x + ", " + y + ")";
|
||||||
|
@ -363,11 +365,18 @@ namespace OpenSim.Services.GridService
|
||||||
{
|
{
|
||||||
// Check for regions which are not linked regions
|
// Check for regions which are not linked regions
|
||||||
List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
|
List<GridRegion> hyperlinks = m_GridService.GetHyperlinks(m_ScopeID);
|
||||||
IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
|
// would like to use .Except, but doesn't seem to exist
|
||||||
if (availableRegions.Count() == 0)
|
//IEnumerable<GridRegion> availableRegions = regions.Except(hyperlinks);
|
||||||
{
|
List<GridRegion> availableRegions = regions.FindAll(delegate(GridRegion region)
|
||||||
return false;
|
{
|
||||||
}
|
// Ewww! n^2
|
||||||
|
if (hyperlinks.Find(delegate(GridRegion r) { return r.RegionID == region.RegionID; }) == null) // not hyperlink. good.
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
if (availableRegions.Count == 0)
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -54,6 +54,8 @@ ServiceConnectors = "8003/OpenSim.Server.Handlers.dll:AssetServiceConnector,8003
|
||||||
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
|
LocalServiceModule = "OpenSim.Services.GridService.dll:GridService"
|
||||||
Realm = "regions"
|
Realm = "regions"
|
||||||
; AllowDuplicateNames = "True"
|
; AllowDuplicateNames = "True"
|
||||||
|
; Check4096 = "False"
|
||||||
|
|
||||||
;; Next, we can specify properties of regions, including default and fallback regions
|
;; Next, we can specify properties of regions, including default and fallback regions
|
||||||
;; The syntax is: Region_<RegionName> = "<flags>"
|
;; The syntax is: Region_<RegionName> = "<flags>"
|
||||||
;; or: Region_<RegionID> = "<flags>"
|
;; or: Region_<RegionID> = "<flags>"
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
;;--- For MySql region storage (alternative)
|
;;--- For MySql region storage (alternative)
|
||||||
;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
|
;StorageProvider = "OpenSim.Data.MySQL.dll:MySqlRegionData"
|
||||||
|
|
||||||
|
; If HG, do you want this check on the distance to be performed?
|
||||||
|
; Check4096 = "False"
|
||||||
|
|
||||||
;; Next, we can specify properties of regions, including default and fallback regions
|
;; Next, we can specify properties of regions, including default and fallback regions
|
||||||
;; The syntax is: Region_<RegioName> = "<flags>"
|
;; The syntax is: Region_<RegioName> = "<flags>"
|
||||||
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
;; where <flags> can be DefaultRegion, FallbackRegion, NoDirectLogin, Persistent, LockedOut
|
||||||
|
|
Loading…
Reference in New Issue