aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Services/GridService/GridService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Services/GridService/GridService.cs')
-rw-r--r--OpenSim/Services/GridService/GridService.cs33
1 files changed, 19 insertions, 14 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 8807397..8059275 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);
@@ -492,10 +488,16 @@ namespace OpenSim.Services.GridService
492 if (region != null) 488 if (region != null)
493 { 489 {
494 // Not really? Maybe? 490 // Not really? Maybe?
495 // The adjacent regions are presumed to be the same size as the current region 491
492/* this fails wiht var regions. My_sql db should now handle var regions
496 List<RegionData> rdatas = m_Database.Get( 493 List<RegionData> rdatas = m_Database.Get(
497 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1, 494 region.posX - region.sizeX - 1, region.posY - region.sizeY - 1,
498 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID); 495 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
496*/
497 // so send normal search area
498 List<RegionData> rdatas = m_Database.Get(
499 region.posX - 1, region.posY - 1,
500 region.posX + region.sizeX + 1, region.posY + region.sizeY + 1, scopeID);
499 501
500 foreach (RegionData rdata in rdatas) 502 foreach (RegionData rdata in rdatas)
501 { 503 {
@@ -537,6 +539,7 @@ namespace OpenSim.Services.GridService
537 // be the base coordinate of the region. 539 // be the base coordinate of the region.
538 // The snapping is technically unnecessary but is harmless because regions are always 540 // The snapping is technically unnecessary but is harmless because regions are always
539 // multiples of the legacy region size (256). 541 // multiples of the legacy region size (256).
542
540 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y) 543 public GridRegion GetRegionByPosition(UUID scopeID, int x, int y)
541 { 544 {
542 uint regionX = Util.WorldToRegionLoc((uint)x); 545 uint regionX = Util.WorldToRegionLoc((uint)x);
@@ -872,7 +875,9 @@ namespace OpenSim.Services.GridService
872 return; 875 return;
873 } 876 }
874 877
878
875 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero); 879 RegionData region = m_Database.Get((int)Util.RegionToWorldLoc(x), (int)Util.RegionToWorldLoc(y), UUID.Zero);
880
876 if (region == null) 881 if (region == null)
877 { 882 {
878 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y); 883 MainConsole.Instance.OutputFormat("No region found at {0},{1}", x, y);
@@ -889,7 +894,7 @@ namespace OpenSim.Services.GridService
889 ConsoleDisplayList dispList = new ConsoleDisplayList(); 894 ConsoleDisplayList dispList = new ConsoleDisplayList();
890 dispList.AddRow("Region Name", r.RegionName); 895 dispList.AddRow("Region Name", r.RegionName);
891 dispList.AddRow("Region ID", r.RegionID); 896 dispList.AddRow("Region ID", r.RegionID);
892 dispList.AddRow("Position", string.Format("{0},{1}", r.coordX, r.coordY)); 897 dispList.AddRow("Location", string.Format("{0},{1}", r.coordX, r.coordY));
893 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY)); 898 dispList.AddRow("Size", string.Format("{0}x{1}", r.sizeX, r.sizeY));
894 dispList.AddRow("URI", r.Data["serverURI"]); 899 dispList.AddRow("URI", r.Data["serverURI"]);
895 dispList.AddRow("Owner ID", r.Data["owner_uuid"]); 900 dispList.AddRow("Owner ID", r.Data["owner_uuid"]);