diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index ee263a118c..8744a08f58 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -158,6 +158,7 @@ This software uses components from the following developers: * Nini (http://nini.sourceforge.net/) * log4net (http://logging.apache.org/log4net/) * GlynnTucker.Cache (http://gtcache.sourceforge.net/) +* NDesk.Options 0.2.1 (http://www.ndesk.org/Options) Some plugins are based on Cable Beach Cable Beach is Copyright (c) 2008 Intel Corporation diff --git a/OpenSim/Framework/Tests/CacheTests.cs b/OpenSim/Framework/Tests/CacheTests.cs index e2afd2a65a..32c0c9510a 100644 --- a/OpenSim/Framework/Tests/CacheTests.cs +++ b/OpenSim/Framework/Tests/CacheTests.cs @@ -78,8 +78,9 @@ namespace OpenSim.Framework.Tests foo[0] = 1; cachedItem.Store(foo); cache.Store(cacheItemUUID.ToString(), cachedItem); - - object citem = cache.Get(cacheItemUUID.ToString()); + + cache.Get(cacheItemUUID.ToString()); + //object citem = cache.Get(cacheItemUUID.ToString()); //Assert.That(citem == null, "Item should not be in Cache because the expiry time was before now"); } @@ -94,7 +95,8 @@ namespace OpenSim.Framework.Tests cachedItem.Store(foo); cache.Store(cacheItemUUID.ToString(), cachedItem); cache.Invalidate(ImmediateExpiryUUID.ToString()); - object citem = cache.Get(cacheItemUUID.ToString()); + cache.Get(cacheItemUUID.ToString()); + //object citem = cache.Get(cacheItemUUID.ToString()); //Assert.That(citem == null, "Item should not be in Cache because we manually invalidated it"); } diff --git a/OpenSim/Region/Application/HGCommands.cs b/OpenSim/Region/Application/HGCommands.cs index f503db75c1..7ae161da3e 100644 --- a/OpenSim/Region/Application/HGCommands.cs +++ b/OpenSim/Region/Application/HGCommands.cs @@ -42,7 +42,7 @@ namespace OpenSim { public class HGCommands { - private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public static Scene CreateScene(RegionInfo regionInfo, AgentCircuitManager circuitManager, CommunicationsManager m_commsManager, StorageManager storageManager, ModuleLoader m_moduleLoader, ConfigSettings m_configSettings, OpenSimConfigSource m_config, string m_version) diff --git a/OpenSim/Region/Application/OpenSim.cs b/OpenSim/Region/Application/OpenSim.cs index f9be1e24a3..5228e4b30a 100644 --- a/OpenSim/Region/Application/OpenSim.cs +++ b/OpenSim/Region/Application/OpenSim.cs @@ -232,7 +232,7 @@ namespace OpenSim "Save named prim to XML2", SavePrimsXml2); m_console.Commands.AddCommand("region", false, "load oar", - "load oar ", + "load oar [--merge] ", "Load a region's data from OAR archive", LoadOar); m_console.Commands.AddCommand("region", false, "save oar", diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index 1e63e3ee22..e3e87186ef 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -57,21 +57,21 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat #region ISharedRegionModule Members public virtual void Initialise(IConfigSource config) { - m_config = config.Configs["Chat"]; if (null == m_config) { m_log.Info("[CHAT]: no config found, plugin disabled"); + m_enabled = false; return; } - if (!m_config.GetBoolean("enabled", false)) + if (!m_config.GetBoolean("enabled", true)) { m_log.Info("[CHAT]: plugin disabled by configuration"); + m_enabled = false; return; } - m_enabled = true; m_whisperdistance = config.Configs["Chat"].GetInt("whisper_distance", m_whisperdistance); m_saydistance = config.Configs["Chat"].GetInt("say_distance", m_saydistance); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs index f08d8eced5..71bfe57db9 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequestPreparation.cs @@ -93,6 +93,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver List entities = m_scene.GetEntities(); List sceneObjects = new List(); + /* + foreach (ILandObject lo in m_scene.LandChannel.AllParcels()) + { + if (name == lo.LandData.Name) + { + // This is the parcel we want + } + } + */ + // Filter entities so that we only have scene objects. // FIXME: Would be nicer to have this as a proper list in SceneGraph, since lots of methods // end up having to do this diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 181f4c66ce..27763bb7f3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -26,9 +26,11 @@ */ using System; +using System.Collections.Generic; using System.IO; using System.Reflection; using log4net; +using NDesk.Options; using Nini.Config; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.Framework.Scenes; @@ -91,13 +93,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public void HandleLoadOarConsoleCommand(string module, string[] cmdparams) { - if (cmdparams.Length > 2) + bool mergeOar = false; + + OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; }); + List mainParams = options.Parse(cmdparams); + +// m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar); +// +// foreach (string param in mainParams) +// m_log.DebugFormat("GOT PARAM [{0}]", param); + + if (mainParams.Count > 2) { - DearchiveRegion(cmdparams[2]); + DearchiveRegion(mainParams[2], mergeOar, Guid.Empty); } else { - DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME); + DearchiveRegion(DEFAULT_OAR_BACKUP_FILENAME, mergeOar, Guid.Empty); } } diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 4ed23bb8ba..81024db979 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -105,7 +105,7 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject obj = new LandObject(UUID.Zero, false, m_scene); obj.LandData.Name = "NO LAND"; return obj; - } + } public List AllParcels() { @@ -154,6 +154,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landManagementModule.UpdateLandObject(localID, data); } } + public void ReturnObjectsInParcel(int localID, uint returnType, UUID[] agentIDs, UUID[] taskIDs, IClientAPI remoteClient) { if (m_landManagementModule != null) diff --git a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs index 968f46a50f..9a2ef5003d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -67,7 +67,14 @@ namespace OpenSim.Region.CoreModules.World.Land private const int landArrayMax = ((int)((int)Constants.RegionSize / 4) >= 64) ? (int)((int)Constants.RegionSize / 4) : 64; #pragma warning restore 0429 + /// + /// Local land ids at specified region co-ordinates (region size / 4) + /// private readonly int[,] m_landIDList = new int[landArrayMax, landArrayMax]; + + /// + /// Land objects keyed by local id + /// private readonly Dictionary m_landList = new Dictionary(); private bool m_landPrimCountTainted; @@ -570,6 +577,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (x_float > Constants.RegionSize || x_float <= 0 || y_float > Constants.RegionSize || y_float <= 0) return null; + try { x = Convert.ToInt32(Math.Floor(Convert.ToDouble(x_float) / 4.0)); @@ -584,6 +592,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return null; } + lock (m_landList) { // Corner case. If an autoreturn happens during sim startup @@ -603,6 +612,7 @@ namespace OpenSim.Region.CoreModules.World.Land // they happen every time at border crossings throw new Exception("Error: Parcel not found at point " + x + ", " + y); } + lock (m_landIDList) { try @@ -617,7 +627,7 @@ namespace OpenSim.Region.CoreModules.World.Land return null; } } - } + } #endregion diff --git a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs index 74f404fc6b..6fe6118179 100644 --- a/OpenSim/Region/Framework/Interfaces/ILandChannel.cs +++ b/OpenSim/Region/Framework/Interfaces/ILandChannel.cs @@ -33,26 +33,41 @@ namespace OpenSim.Region.Framework.Interfaces { public interface ILandChannel { - List ParcelsNearPoint(Vector3 position); + /// + /// Get all parcels + /// + /// List AllParcels(); /// - /// Get the land object at the specified point + /// Get the parcel at the specified point /// /// Value between 0 - 256 on the x axis of the point /// Value between 0 - 256 on the y axis of the point /// Land object at the point supplied ILandObject GetLandObject(int x, int y); - ILandObject GetLandObject(int localID); - /// - /// Get the land object at the specified point + /// Get the parcel at the specified point /// /// Value between 0 - 256 on the x axis of the point /// Value between 0 - 256 on the y axis of the point /// Land object at the point supplied ILandObject GetLandObject(float x, float y); + + /// + /// Get the parcels near the specified point + /// + /// + /// + List ParcelsNearPoint(Vector3 position); + + /// + /// Get the parcel given the land's local id. + /// + /// + /// + ILandObject GetLandObject(int localID); bool IsLandPrimCountTainted(); bool IsForcefulBansAllowed(); diff --git a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs index 146ec660c5..9da818a7eb 100644 --- a/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs +++ b/OpenSim/Region/RegionCombinerModule/RegionCombinerLargeLandChannel.cs @@ -118,6 +118,7 @@ public class RegionCombinerLargeLandChannel : ILandChannel return regionData.RegionScene.LandChannel.GetLandObject(x - offsetX, y - offsetY); } } + ILandObject obj = new LandObject(UUID.Zero, false, RegData.RegionScene); obj.LandData.Name = "NO LAND"; return obj; diff --git a/bin/NDesk.Options.dll b/bin/NDesk.Options.dll new file mode 100644 index 0000000000..df45878957 Binary files /dev/null and b/bin/NDesk.Options.dll differ diff --git a/prebuild.xml b/prebuild.xml index 26535fb606..ad0693847a 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1596,6 +1596,7 @@ +