diff options
Diffstat (limited to 'OpenSim/Services/GridService')
-rw-r--r-- | OpenSim/Services/GridService/GridService.cs | 29 | ||||
-rw-r--r-- | OpenSim/Services/GridService/HypergridLinker.cs | 6 |
2 files changed, 15 insertions, 20 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs index 8807397..53805d0 100644 --- a/OpenSim/Services/GridService/GridService.cs +++ b/OpenSim/Services/GridService/GridService.cs | |||
@@ -57,6 +57,7 @@ namespace OpenSim.Services.GridService | |||
57 | protected bool m_AllowDuplicateNames = false; | 57 | protected bool m_AllowDuplicateNames = false; |
58 | protected bool m_AllowHypergridMapSearch = false; | 58 | protected bool m_AllowHypergridMapSearch = false; |
59 | 59 | ||
60 | |||
60 | protected bool m_SuppressVarregionOverlapCheckOnRegistration = false; | 61 | protected bool m_SuppressVarregionOverlapCheckOnRegistration = false; |
61 | 62 | ||
62 | private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>(); | 63 | private static Dictionary<string,object> m_ExtraFeatures = new Dictionary<string, object>(); |
@@ -155,9 +156,9 @@ namespace OpenSim.Services.GridService | |||
155 | 156 | ||
156 | if (loginConfig == null || gridConfig == null) | 157 | if (loginConfig == null || gridConfig == null) |
157 | return; | 158 | return; |
158 | 159 | ||
159 | string configVal; | 160 | string configVal; |
160 | 161 | ||
161 | configVal = loginConfig.GetString("SearchURL", string.Empty); | 162 | configVal = loginConfig.GetString("SearchURL", string.Empty); |
162 | if (!string.IsNullOrEmpty(configVal)) | 163 | if (!string.IsNullOrEmpty(configVal)) |
163 | m_ExtraFeatures["search-server-url"] = configVal; | 164 | m_ExtraFeatures["search-server-url"] = configVal; |
@@ -202,14 +203,10 @@ namespace OpenSim.Services.GridService | |||
202 | return "Invalid RegionID - cannot be zero UUID"; | 203 | return "Invalid RegionID - cannot be zero UUID"; |
203 | 204 | ||
204 | String reason = "Region overlaps another region"; | 205 | String reason = "Region overlaps another region"; |
205 | RegionData region = FindAnyConflictingRegion(regionInfos, scopeID, out reason); | 206 | // we should not need to check for overlaps |
206 | // If there is a conflicting region, if it has the same ID and same coordinates | 207 | |
207 | // then it is a region re-registering (permissions and ownership checked later). | 208 | RegionData region = m_Database.Get(regionInfos.RegionLocX, regionInfos.RegionLocY, scopeID); |
208 | if ((region != null) | 209 | if ((region != null) && (region.RegionID != regionInfos.RegionID)) |
209 | && ( (region.coordX != regionInfos.RegionCoordX) | ||
210 | || (region.coordY != regionInfos.RegionCoordY) | ||
211 | || (region.RegionID != regionInfos.RegionID) ) | ||
212 | ) | ||
213 | { | 210 | { |
214 | // If not same ID and same coordinates, this new region has conflicts and can't be registered. | 211 | // If not same ID and same coordinates, this new region has conflicts and can't be registered. |
215 | m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason); | 212 | m_log.WarnFormat("{0} Register region conflict in scope {1}. {2}", LogHeader, scopeID, reason); |
@@ -463,7 +460,7 @@ namespace OpenSim.Services.GridService | |||
463 | 460 | ||
464 | int flags = Convert.ToInt32(region.Data["flags"]); | 461 | int flags = Convert.ToInt32(region.Data["flags"]); |
465 | 462 | ||
466 | if (!m_DeleteOnUnregister || (flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0) | 463 | if ((!m_DeleteOnUnregister) || ((flags & (int)OpenSim.Framework.RegionFlags.Persistent) != 0)) |
467 | { | 464 | { |
468 | flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; | 465 | flags &= ~(int)OpenSim.Framework.RegionFlags.RegionOnline; |
469 | region.Data["flags"] = flags.ToString(); | 466 | region.Data["flags"] = flags.ToString(); |
@@ -478,7 +475,6 @@ namespace OpenSim.Services.GridService | |||
478 | } | 475 | } |
479 | 476 | ||
480 | return true; | 477 | return true; |
481 | |||
482 | } | 478 | } |
483 | 479 | ||
484 | return m_Database.Delete(regionID); | 480 | return m_Database.Delete(regionID); |
@@ -491,10 +487,8 @@ namespace OpenSim.Services.GridService | |||
491 | 487 | ||
492 | if (region != null) | 488 | if (region != null) |
493 | { | 489 | { |
494 | // Not really? Maybe? | ||
495 | // The adjacent regions are presumed to be the same size as the current region | ||
496 | List<RegionData> rdatas = m_Database.Get( | 490 | List<RegionData> rdatas = m_Database.Get( |
497 | region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, | 491 | region.posX - 1, region.posY - 1, |
498 | region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); | 492 | region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); |
499 | 493 | ||
500 | foreach (RegionData rdata in rdatas) | 494 | foreach (RegionData rdata in rdatas) |
@@ -537,6 +531,7 @@ namespace OpenSim.Services.GridService | |||
537 | // be the base coordinate of the region. | 531 | // be the base coordinate of the region. |
538 | // The snapping is technically unnecessary but is harmless because regions are always | 532 | // The snapping is technically unnecessary but is harmless because regions are always |
539 | // multiples of the legacy region size (256). | 533 | // multiples of the legacy region size (256). |
534 | |||
540 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) | 535 | public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) |
541 | { | 536 | { |
542 | uint regionX = Util.WorldToRegionLoc((uint)x); | 537 | uint regionX = Util.WorldToRegionLoc((uint)x); |
@@ -872,7 +867,9 @@ namespace OpenSim.Services.GridService | |||
872 | return; | 867 | return; |
873 | } | 868 | } |
874 | 869 | ||
870 | |||
875 | RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); | 871 | RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); |
872 | |||
876 | if (region == null) | 873 | if (region == null) |
877 | { | 874 | { |
878 | MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); | 875 | MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); |
@@ -889,7 +886,7 @@ namespace OpenSim.Services.GridService | |||
889 | ConsoleDisplayList dispList = new ConsoleDisplayList(); | 886 | ConsoleDisplayList dispList = new ConsoleDisplayList(); |
890 | dispList.AddRow("Region Name", r.RegionName); | 887 | dispList.AddRow("Region Name", r.RegionName); |
891 | dispList.AddRow("Region ID", r.RegionID); | 888 | dispList.AddRow("Region ID", r.RegionID); |
892 | dispList.AddRow("Position", string.Format("{0},{1}", r.coordX, r.coordY)); | 889 | dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY)); |
893 | dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); | 890 | dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); |
894 | dispList.AddRow("URI", r.Data["serverURI"]); | 891 | dispList.AddRow("URI", r.Data["serverURI"]); |
895 | dispList.AddRow("Owner ID", r.Data["owner_uuid"]); | 892 | dispList.AddRow("Owner ID", r.Data["owner_uuid"]); |
diff --git a/OpenSim/Services/GridService/HypergridLinker.cs b/OpenSim/Services/GridService/HypergridLinker.cs index 9d016fc..2af617a 100644 --- a/OpenSim/Services/GridService/HypergridLinker.cs +++ b/OpenSim/Services/GridService/HypergridLinker.cs | |||
@@ -231,8 +231,7 @@ namespace OpenSim.Services.GridService | |||
231 | { | 231 | { |
232 | regionName = parts[2]; | 232 | regionName = parts[2]; |
233 | } | 233 | } |
234 | 234 | ||
235 | |||
236 | bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason); | 235 | bool success = TryCreateLink(scopeID, xloc, yloc, regionName, port, host, ownerID, out regInfo, out reason); |
237 | if (success) | 236 | if (success) |
238 | { | 237 | { |
@@ -379,8 +378,7 @@ namespace OpenSim.Services.GridService | |||
379 | region = m_GridService.GetRegionByUUID(scopeID, regionID); | 378 | region = m_GridService.GetRegionByUUID(scopeID, regionID); |
380 | if (region != null) | 379 | if (region != null) |
381 | { | 380 | { |
382 | m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates <{0},{1}>", | 381 | m_log.DebugFormat("[HYPERGRID LINKER]: Region already exists in coordinates <{0},{1}>", Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY)); |
383 | Util.WorldToRegionLoc((uint)region.RegionLocX), Util.WorldToRegionLoc((uint)region.RegionLocY)); | ||
384 | regInfo = region; | 382 | regInfo = region; |
385 | return true; | 383 | return true; |
386 | } | 384 | } |