From f9807884a425c2d91e8f2035993a0ca5e210eb43 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 25 Nov 2009 15:28:43 +0000 Subject: [PATCH 1/5] Add MIT/X11 licensed NDesk.Options (http://www.ndesk.org/Options) DLL to aid command line parsing --- CONTRIBUTORS.txt | 1 + .../World/Archiver/ArchiverModule.cs | 10 +++++++++- bin/NDesk.Options.dll | Bin 0 -> 22016 bytes prebuild.xml | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 bin/NDesk.Options.dll 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/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 181f4c66ce..98fdec3db6 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,7 +93,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public void HandleLoadOarConsoleCommand(string module, string[] cmdparams) { - if (cmdparams.Length > 2) + OptionSet options = new OptionSet() {}; + List mainParams = options.Parse(cmdparams); + + foreach (string param in mainParams) + m_log.DebugFormat("Found param [{0}]", param); + + if (mainParams.Count > 2) { DearchiveRegion(cmdparams[2]); } diff --git a/bin/NDesk.Options.dll b/bin/NDesk.Options.dll new file mode 100644 index 0000000000000000000000000000000000000000..df458789570622f8283493ab3e6e5282b87398c6 GIT binary patch literal 22016 zcmeHvdvsi9k!RgU-+TLZtD|l`jb*9*Ok1`U`H{FK%a&xxj+OYONQobLI4!9yx82f} zyIYB6M~O@zke5kvfD;0lJRr+tfhDt$0cKzpW=sy52?HF4*KPt~$pUA{Oqdz6%xp68 z{;Iy)57|!O9M0K4cDJ3b`&E7QRn=EjUwz-bx0PK7A0UH>OnlFsBl;q){OJ++&R`DR zk(NJ;(C35ST>M3C=QkG*AIaq7Q#o%umzs!=rY0x7LVP40&rMIpGn4WDJwx#cZ!Fzb zRpl=8Mep54v{N(a6OaGPj-s}gDY7`ESwy=*VZ-^m2ERjlQbrfHE(l zYWc5x^-*TPr!h{nhZ}Q5Np{5fpT~*9=hJ=8uAvvGs9uvaDfzD?U9$TPsj$o?BiW z2fg&^iL2&8|H{~Iw0S-k{~YS`a{bxtu2g1{Ci0_RE}d>0%Vw!4NzI$hxp@=Ok#$6x zFNpE~lb^$S9;)4008>xEB3CzNaWPwoI`vabHcZb2y_MD}+-nkyO87z_-|qJZf!_xi z3nAkQUxtUkLqr+3&%=@0++Wri5JG7@Vmxm=@{)14zLl2fh6fugpcUg6%^x39{KYvS zCwO?-o+?Es>yOMIf64sub^dtP|BmyjfF1-}Su)eW;Dfh<90)wEwiE8#=_DD{Sl%@geUIP5xUaKzkB1e|iuf|`@ACEOLL z?~*wE12d~Q8MAPZsT&RVBhj?w^)0tO>cQ#mEKpN7XOWMl9+-tR%rJ2|jF?3Vn))fG zbRym1TqbmgzMuwuB3<;Uu1>Tm(6EJ>bAJhrzFWO;R!xpikA0jGd&Fkx6V{v|)A6?$i()s8d5*~3{*dC*k z=!e4Sw-JDai4~Z90txB5G2^W|CIv%!2i!oG?j=BfifN&j*toFal~eaWL#s;NvLJ6I z1{my6iv#F4oqQJvCtrdDvRk8E<9c}#`0&h-hlEm0tN}sNkOv$i&IgVLU)ke)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d)x8AJ*&l zzN!HjI~&x90IfLNets8ZF1~1+UGg-8Zi-OM(b9V^W-B`bSg!3!rYj5#yyVOweoY1>{IlOCCh!tu-pa!XYhTe{K z&L>hn?D@ zIO>cl; zhPm=@@pv~Pc!hQC@qNMfkUZC-{fw~%?__TqV#s%~{Qr^Rc$NLEGKlXFc>l=3U-Bne Z5;w5_-|>m7|7WDm&iwzM|K~jLzX3<;8NmPm literal 0 HcmV?d00001 diff --git a/prebuild.xml b/prebuild.xml index 26535fb606..ad0693847a 100644 --- a/prebuild.xml +++ b/prebuild.xml @@ -1596,6 +1596,7 @@ + From c18422ad3a09cfabd86eb86403a77a6c720980f0 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 25 Nov 2009 16:02:47 +0000 Subject: [PATCH 2/5] Implement oar merging An oar can now be merged with existing region contents by using the --merge option For example, load oar --merge my.oar Existing terrain, region settings and parcel data is left in place when an oar is merged. See http://opensimulator.org/wiki/OpenSim_Archives#Usage for more information --- .../CoreModules/World/Archiver/ArchiverModule.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 98fdec3db6..27763bb7f3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -93,19 +93,23 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// public void HandleLoadOarConsoleCommand(string module, string[] cmdparams) { - OptionSet options = new OptionSet() {}; + bool mergeOar = false; + + OptionSet options = new OptionSet().Add("m|merge", delegate (string v) { mergeOar = v != null; }); List mainParams = options.Parse(cmdparams); - - foreach (string param in mainParams) - m_log.DebugFormat("Found param [{0}]", param); + +// 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); } } From a4d2a97bc6ead3aeba4e1be419d976925e5ee470 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 25 Nov 2009 16:14:08 +0000 Subject: [PATCH 3/5] minor: remove some mono compiler warnings, add --merge load oar switch to help information --- OpenSim/Framework/Tests/CacheTests.cs | 8 +++++--- OpenSim/Region/Application/HGCommands.cs | 2 +- OpenSim/Region/Application/OpenSim.cs | 2 +- OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 1 - 4 files changed, 7 insertions(+), 6 deletions(-) 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 cd59bdb613..f4da910db4 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -57,7 +57,6 @@ namespace OpenSim.Region.CoreModules.Avatar.Chat #region ISharedRegionModule Members public virtual void Initialise(IConfigSource config) { - m_config = config.Configs["Chat"]; if (null == m_config) From 40464f6cc6ffc04bb5e4ede3d832e1cde75e9b5b Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 25 Nov 2009 16:23:37 +0000 Subject: [PATCH 4/5] Change chat config code so that enabled = false actually does disable the chat module --- OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs index f4da910db4..6dacbba0df 100644 --- a/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Chat/ChatModule.cs @@ -62,15 +62,16 @@ namespace OpenSim.Region.CoreModules.Avatar.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); From 59caa68e08691d8fac221e2bd42c712d5bcf69aa Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Wed, 25 Nov 2009 17:49:38 +0000 Subject: [PATCH 5/5] minor: add doc to a few parcel methods --- .../ArchiveWriteRequestPreparation.cs | 10 ++++++++ .../CoreModules/World/Land/LandChannel.cs | 3 ++- .../World/Land/LandManagementModule.cs | 12 ++++++++- .../Framework/Interfaces/ILandChannel.cs | 25 +++++++++++++++---- .../RegionCombinerLargeLandChannel.cs | 1 + 5 files changed, 44 insertions(+), 7 deletions(-) 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/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;