From b2433d2b99cc7f610ad03fc2ad8ce76494940d35 Mon Sep 17 00:00:00 2001
From: Justin Clarke Casey
Date: Thu, 14 May 2009 18:24:52 +0000
Subject: * Improve loadregions so that all region configs are checked for
clashes (e.g. same uuid) rather than just one
---
.../LoadRegions/LoadRegionsPlugin.cs | 35 ++++++++++------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
index 9416fe5..c37c2e8 100644
--- a/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
+++ b/OpenSim/ApplicationPlugins/LoadRegions/LoadRegionsPlugin.cs
@@ -68,7 +68,7 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
public void Initialise()
{
- m_log.Info("[LOADREGIONS]: " + Name + " cannot be default-initialized!");
+ m_log.Error("[LOADREGIONS]: " + Name + " cannot be default-initialized!");
throw new PluginNotInitialisedException(Name);
}
@@ -80,17 +80,17 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
public void PostInitialise()
{
- m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
+ //m_log.Info("[LOADREGIONS]: Load Regions addin being initialised");
IRegionLoader regionLoader;
if (m_openSim.ConfigSource.Source.Configs["Startup"].GetString("region_info_source", "filesystem") == "filesystem")
{
- m_log.Info("[LOADREGIONS]: Loading Region Info from filesystem");
+ m_log.Info("[LOADREGIONS]: Loading region configurations from filesystem");
regionLoader = new RegionLoaderFileSystem();
}
else
{
- m_log.Info("[LOADREGIONSPLUGIN]: Loading Region Info from web");
+ m_log.Info("[LOADREGIONSPLUGIN]: Loading region configurations from web");
regionLoader = new RegionLoaderWebServer();
}
@@ -142,38 +142,33 @@ namespace OpenSim.ApplicationPlugins.LoadRegions
/// True if we're sane, false if we're insane
private bool CheckRegionsForSanity(RegionInfo[] regions)
{
- if (regions.Length <= 0)
+ if (regions.Length <= 1)
return true;
- List checkedRegions = new List();
- checkedRegions.Add(regions[0]);
-
- for (int i = 1; i < regions.Length; i++)
+ for (int i = 0; i < regions.Length - 1; i++)
{
- RegionInfo region = regions[i];
-
- foreach (RegionInfo checkedRegion in checkedRegions)
+ for (int j = i + 1; j < regions.Length; j++)
{
- if (region.RegionID == checkedRegion.RegionID)
+ if (regions[i].RegionID == regions[j].RegionID)
{
m_log.ErrorFormat(
"[LOADREGIONS]: Regions {0} and {1} have the same UUID {2}",
- region.RegionName, checkedRegion.RegionName, region.RegionID);
+ regions[i].RegionName, regions[j].RegionName, regions[i].RegionID);
return false;
}
- else if (region.RegionLocX == checkedRegion.RegionLocX &&
- region.RegionLocY == checkedRegion.RegionLocY)
+ else if (
+ regions[i].RegionLocX == regions[j].RegionLocX && regions[i].RegionLocY == regions[j].RegionLocY)
{
m_log.ErrorFormat(
- "[LOADREGIONS]: Regions {0} and {1} have the same location {2} {3}",
- region.RegionName, checkedRegion.RegionName, region.RegionLocX, region.RegionLocY);
+ "[LOADREGIONS]: Regions {0} and {1} have the same grid location ({2}, {3})",
+ regions[i].RegionName, regions[j].RegionName, regions[i].RegionLocX, regions[i].RegionLocY);
return false;
}
- else if (region.InternalEndPoint.Port == checkedRegion.InternalEndPoint.Port)
+ else if (regions[i].InternalEndPoint.Port == regions[j].InternalEndPoint.Port)
{
m_log.ErrorFormat(
"[LOADREGIONS]: Regions {0} and {1} have the same internal IP port {2}",
- region.RegionName, checkedRegion.RegionName, region.InternalEndPoint.Port);
+ regions[i].RegionName, regions[j].RegionName, regions[i].InternalEndPoint.Port);
return false;
}
}
--
cgit v1.1