From 8ddf787cfd090fc8f2715a6f2a5329348a12e28b Mon Sep 17 00:00:00 2001 From: Diva Canto Date: Sun, 24 Jan 2010 16:00:28 -0800 Subject: Hypergrid map search back on, this time with a config var in the grid service. --- OpenSim/Services/GridService/GridService.cs | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services/GridService/GridService.cs') diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index b86fd4d..515d620 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs @@ -54,6 +54,7 @@ namespace OpenSim.Services.GridService protected IAuthenticationService m_AuthenticationService = null; protected bool m_AllowDuplicateNames = false; + protected bool m_AllowHypergridMapSearch = false; public GridService(IConfigSource config) : base(config) @@ -74,6 +75,7 @@ namespace OpenSim.Services.GridService m_AuthenticationService = ServerUtils.LoadPlugin(authService, args); } m_AllowDuplicateNames = gridConfig.GetBoolean("AllowDuplicateNames", m_AllowDuplicateNames); + m_AllowHypergridMapSearch = gridConfig.GetBoolean("AllowHypergridMapSearch", m_AllowHypergridMapSearch); } if (m_RootInstance == null) @@ -327,6 +329,13 @@ namespace OpenSim.Services.GridService } } + if (m_AllowHypergridMapSearch && rdatas.Count == 0 && name.Contains(".")) + { + GridRegion r = m_HypergridLinker.LinkRegion(scopeID, name); + if (r != null) + rinfos.Add(r); + } + return rinfos; } @@ -410,9 +419,14 @@ namespace OpenSim.Services.GridService { RegionData region = m_Database.Get(regionID, scopeID); - int flags = Convert.ToInt32(region.Data["flags"]); - //m_log.DebugFormat("[GRID SERVICE]: Request for flags of {0}: {1}", regionID, flags); - return flags; + if (region != null) + { + int flags = Convert.ToInt32(region.Data["flags"]); + //m_log.DebugFormat("[GRID SERVICE]: Request for flags of {0}: {1}", regionID, flags); + return flags; + } + else + return -1; } private void HandleShowRegion(string module, string[] cmd) -- cgit v1.1