From b16abc8166c29585cb76cc55c3bdd76e5833cb4f Mon Sep 17 00:00:00 2001 From: Melanie Thielker Date: Thu, 5 Jan 2017 19:07:37 +0000 Subject: Massive tab and trailing space cleanup --- .../CoreModules/World/Access/AccessModule.cs | 2 +- .../World/Archiver/ArchiveReadRequest.cs | 46 ++-- .../World/Archiver/ArchiveScenesGroup.cs | 4 +- .../World/Archiver/ArchiveWriteRequest.cs | 52 ++--- .../CoreModules/World/Archiver/ArchiverModule.cs | 22 +- .../CoreModules/World/Archiver/AssetsArchiver.cs | 6 +- .../CoreModules/World/Archiver/AssetsRequest.cs | 46 ++-- .../World/Archiver/DearchiveScenesGroup.cs | 2 +- .../World/Archiver/Tests/ArchiverTests.cs | 98 ++++---- .../Region/CoreModules/World/Cloud/CloudModule.cs | 24 +- .../CoreModules/World/Estate/EstateConnector.cs | 2 +- .../World/Estate/EstateManagementCommands.cs | 38 ++-- .../World/Estate/EstateManagementModule.cs | 60 ++--- .../CoreModules/World/Estate/EstateModule.cs | 30 +-- .../Region/CoreModules/World/Land/LandChannel.cs | 12 +- .../CoreModules/World/Land/LandManagementModule.cs | 74 +++--- .../Region/CoreModules/World/Land/LandObject.cs | 50 ++-- .../CoreModules/World/Land/PrimCountModule.cs | 138 +++++------ .../World/Land/Tests/LandManagementModuleTests.cs | 40 ++-- .../World/Land/Tests/PrimCountModuleTests.cs | 224 +++++++++--------- .../CoreModules/World/LegacyMap/MapImageModule.cs | 14 +- .../World/LegacyMap/TexturedMapTileRenderer.cs | 4 +- .../CoreModules/World/Media/Moap/MoapModule.cs | 252 ++++++++++----------- .../World/Media/Moap/Tests/MoapTests.cs | 36 +-- .../World/Objects/BuySell/BuySellModule.cs | 18 +- .../World/Objects/Commands/ObjectCommandsModule.cs | 54 ++--- .../World/Permissions/PermissionsModule.cs | 214 ++++++++--------- .../World/Region/RegionCommandsModule.cs | 18 +- .../CoreModules/World/Region/RestartModule.cs | 16 +- .../World/Serialiser/SerialiserModule.cs | 10 +- .../World/Serialiser/Tests/SerialiserTests.cs | 24 +- .../Region/CoreModules/World/Sound/SoundModule.cs | 6 +- OpenSim/Region/CoreModules/World/Sun/SunModule.cs | 12 +- .../Terrain/FileLoaders/GenericSystemDrawing.cs | 2 +- .../CoreModules/World/Terrain/FileLoaders/JPEG.cs | 4 +- .../CoreModules/World/Terrain/FileLoaders/LLRAW.cs | 2 +- .../World/Terrain/ITerrainFloodEffect.cs | 2 +- .../CoreModules/World/Terrain/ITerrainLoader.cs | 2 +- .../World/Terrain/PaintBrushes/FlattenSphere.cs | 2 +- .../World/Terrain/PaintBrushes/LowerSphere.cs | 2 +- .../World/Terrain/PaintBrushes/RaiseSphere.cs | 2 +- .../World/Terrain/PaintBrushes/RevertSphere.cs | 2 +- .../World/Terrain/PaintBrushes/SmoothSphere.cs | 4 +- .../CoreModules/World/Terrain/TerrainModule.cs | 14 +- .../World/Terrain/Tests/TerrainModuleTests.cs | 4 +- .../World/Vegetation/VegetationModule.cs | 22 +- .../CoreModules/World/Warp3DMap/TerrainSplat.cs | 4 +- .../World/Warp3DMap/Warp3DImageModule.cs | 22 +- .../World/Wind/Plugins/ConfigurableWind.cs | 12 +- .../Region/CoreModules/World/Wind/WindModule.cs | 10 +- .../CoreModules/World/WorldMap/MapSearchModule.cs | 4 +- .../CoreModules/World/WorldMap/WorldMapModule.cs | 12 +- 52 files changed, 888 insertions(+), 888 deletions(-) (limited to 'OpenSim/Region/CoreModules/World') diff --git a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs index f567cab..081439a 100644 --- a/OpenSim/Region/CoreModules/World/Access/AccessModule.cs +++ b/OpenSim/Region/CoreModules/World/Access/AccessModule.cs @@ -44,7 +44,7 @@ namespace OpenSim.Region.CoreModules.World public class AccessModule : ISharedRegionModule { // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + private List m_SceneList = new List(); public void Initialise(IConfigSource config) diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs index f523af1..6ba8cec 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveReadRequest.cs @@ -77,14 +77,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver SceneObjects = new List(); } } - + /// /// The maximum major version of OAR that we can read. Minor versions shouldn't need a max number since version /// bumps here should be compatible. /// public static int MAX_MAJOR_VERSION = 1; - + /// /// Has the control file been loaded for this archive? /// @@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_boundingOrigin = Vector3.Zero; m_boundingSize = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, float.MaxValue); - + if (options.ContainsKey("bounding-origin")) { Vector3 boOption = (Vector3)options["bounding-origin"]; @@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver { //m_log.DebugFormat( // "[ARCHIVER]: Successfully read {0} ({1} bytes)", filePath, data.Length); - + if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) continue; @@ -354,11 +354,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver else if (!m_merge && filePath.StartsWith(ArchiveConstants.SETTINGS_PATH)) { LoadRegionSettings(scene, filePath, data, dearchivedScenes); - } + } else if (filePath.StartsWith(ArchiveConstants.LANDDATA_PATH) && (!m_merge || m_forceParcels)) { sceneContext.SerialisedParcels.Add(Encoding.UTF8.GetString(data)); - } + } else if (filePath == ArchiveConstants.CONTROL_FILE_PATH) { // Ignore, because we already read the control file @@ -406,7 +406,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver { LoadParcels(sceneContext.Scene, sceneContext.SerialisedParcels); LoadObjects(sceneContext.Scene, sceneContext.SerialisedSceneObjects, sceneContext.SceneObjects); - + // Inform any interested parties that the region has changed. We waited until now so that all // of the region's objects will be loaded when we send this notification. IEstateModule estateModule = sceneContext.Scene.RequestModuleInterface(); @@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver { if (TarArchiveReader.TarEntryType.TYPE_DIRECTORY == entryType) continue; - + if (filePath == ArchiveConstants.CONTROL_FILE_PATH) { LoadControlFile(filePath, data, dearchivedScenes); @@ -517,7 +517,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver throw new Exception("[ARCHIVER]: Control file not found"); } - + /// /// Load serialized scene objects. /// @@ -545,7 +545,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Really large xml files (multi megabyte) appear to cause // memory problems // when loading the xml. But don't enable this check yet - + if (serialisedSceneObject.Length > 5000000) { m_log.Error("[ARCHIVER]: Ignoring xml since size > 5000000);"); @@ -745,7 +745,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver Vector3 AABBMax; // create a new LandObject that we can use to manipulate the incoming source parcel data - // this is ok, but just beware that some of the LandObject functions (that we haven't used here) still + // this is ok, but just beware that some of the LandObject functions (that we haven't used here) still // assume we're always using the destination region size LandData ld = new LandData(); landObject = new LandObject(ld, scene); @@ -839,7 +839,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } parcel.ParcelAccessList = accessList; - if (m_debug) m_log.DebugFormat("[ARCHIVER]: Adding parcel {0}, local id {1}, owner {2}, group {3}, isGroupOwned {4}, area {5}", + if (m_debug) m_log.DebugFormat("[ARCHIVER]: Adding parcel {0}, local id {1}, owner {2}, group {3}, isGroupOwned {4}, area {5}", parcel.Name, parcel.LocalID, parcel.OwnerID, parcel.GroupID, parcel.IsGroupOwned, parcel.Area); landData.Add(parcel); @@ -939,20 +939,20 @@ namespace OpenSim.Region.CoreModules.World.Archiver sbyte asype = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; if(asype == -2) { - + } // m_log.DebugFormat("[ARCHIVER]: found existing asset {0}",uuid); return true; } - + if (ArchiveConstants.EXTENSION_TO_ASSET_TYPE.ContainsKey(extension)) { sbyte assetType = ArchiveConstants.EXTENSION_TO_ASSET_TYPE[extension]; if(assetType == -2) { - + } if (assetType == (sbyte)AssetType.Unknown) { @@ -966,7 +966,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver ModifySceneObject(m_rootScene, sog); return true; }); - + if (data == null) return false; } @@ -1072,7 +1072,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver currentRegionSettings.Save(); scene.TriggerEstateSunUpdate(); - + IEstateModule estateModule = scene.RequestModuleInterface(); if (estateModule != null) estateModule.sendRegionHandshakeToAll(); @@ -1129,16 +1129,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver bool multiRegion = false; - while (xtr.Read()) + while (xtr.Read()) { - if (xtr.NodeType == XmlNodeType.Element) + if (xtr.NodeType == XmlNodeType.Element) { if (xtr.Name.ToString() == "archive") { int majorVersion = int.Parse(xtr["major_version"]); int minorVersion = int.Parse(xtr["minor_version"]); string version = string.Format("{0}.{1}", majorVersion, minorVersion); - + if (majorVersion > MAX_MAJOR_VERSION) { throw new Exception( @@ -1146,15 +1146,15 @@ namespace OpenSim.Region.CoreModules.World.Archiver "The OAR you are trying to load has major version number of {0} but this version of OpenSim can only load OARs with major version number {1} and below", majorVersion, MAX_MAJOR_VERSION)); } - + m_log.InfoFormat("[ARCHIVER]: Loading OAR with version {0}", version); } - else if (xtr.Name.ToString() == "datetime") + else if (xtr.Name.ToString() == "datetime") { int value; if (Int32.TryParse(xtr.ReadElementContentAsString(), out value)) dearchivedScenes.LoadedCreationDateTime = value; - } + } else if (xtr.Name.ToString() == "row") { multiRegion = true; diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs index d8dace2..2fb4426 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveScenesGroup.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// The inner dictionaries contain each row's regions (key: X coordinate). /// public SortedDictionary> Regions { get; set; } - + /// /// The subdirectory where each region is stored in the archive. /// @@ -152,7 +152,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } } } - + /// /// Returns the scene at position 'location'. /// diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs index 6c8f37b..8dabcee 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiveWriteRequest.cs @@ -60,8 +60,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// /// The minimum major version of OAR that we can write. /// - public static int MIN_MAJOR_VERSION = 0; - + public static int MIN_MAJOR_VERSION = 0; + /// /// The maximum major version of OAR that we can write. /// @@ -112,7 +112,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_log.ErrorFormat("{0} {1}", e.Message, e.StackTrace); } } - + /// /// Constructor. /// @@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver List sceneObjects = new List(); int numObjectsSkippedPermissions = 0; - + // 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 @@ -256,7 +256,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver { UuidGatherer assetGatherer = new UuidGatherer(scene.AssetService, assetUuids); int prevAssets = assetUuids.Count; - + foreach (SceneObjectGroup sceneObject in sceneObjects) assetGatherer.AddForInspection(sceneObject); @@ -276,16 +276,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver // Make sure that we also request terrain texture assets RegionSettings regionSettings = scene.RegionInfo.RegionSettings; - + if (regionSettings.TerrainTexture1 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_1) assetUuids[regionSettings.TerrainTexture1] = (sbyte)AssetType.Texture; - + if (regionSettings.TerrainTexture2 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_2) assetUuids[regionSettings.TerrainTexture2] = (sbyte)AssetType.Texture; - + if (regionSettings.TerrainTexture3 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_3) assetUuids[regionSettings.TerrainTexture3] = (sbyte)AssetType.Texture; - + if (regionSettings.TerrainTexture4 != RegionSettings.DEFAULT_TERRAIN_TEXTURE_4) assetUuids[regionSettings.TerrainTexture4] = (sbyte)AssetType.Texture; @@ -398,18 +398,18 @@ namespace OpenSim.Region.CoreModules.World.Archiver // string[] parts = m_options["version"].ToString().Split('.'); // if (parts.Length >= 1) // { -// majorVersion = Int32.Parse(parts[0]); -// +// majorVersion = Int32.Parse(parts[0]); +// // if (parts.Length >= 2) // minorVersion = Int32.Parse(parts[1]); // } // } -// +// // if (majorVersion < MIN_MAJOR_VERSION || majorVersion > MAX_MAJOR_VERSION) // { // throw new Exception( // string.Format( -// "OAR version number for save must be between {0} and {1}", +// "OAR version number for save must be between {0} and {1}", // MIN_MAJOR_VERSION, MAX_MAJOR_VERSION)); // } // else if (majorVersion == MAX_MAJOR_VERSION) @@ -420,9 +420,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver // else if (majorVersion == MIN_MAJOR_VERSION) // { // // Force 0.4 -// minorVersion = 4; +// minorVersion = 4; // } - + m_log.InfoFormat("[ARCHIVER]: Creating version {0}.{1} OAR", majorVersion, minorVersion); if (majorVersion == 1) { @@ -430,7 +430,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } String s; - + using (StringWriter sw = new StringWriter()) { using (XmlTextWriter xtw = new XmlTextWriter(sw)) @@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver xtw.WriteStartElement("archive"); xtw.WriteAttributeString("major_version", majorVersion.ToString()); xtw.WriteAttributeString("minor_version", minorVersion.ToString()); - + xtw.WriteStartElement("creation_info"); DateTime now = DateTime.UtcNow; TimeSpan t = now - new DateTime(1970, 1, 1); @@ -448,7 +448,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (!MultiRegionFormat) xtw.WriteElementString("id", m_rootScene.RegionInfo.RegionID.ToString()); xtw.WriteEndElement(); - + xtw.WriteElementString("assets_included", SaveAssets.ToString()); if (MultiRegionFormat) @@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver } xtw.WriteEndElement(); - + xtw.Flush(); } @@ -525,7 +525,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver Vector2 size; size = new Vector2((float)scene.RegionInfo.RegionSizeX, (float)scene.RegionInfo.RegionSizeY); - + xtw.WriteElementString("size_in_meters", string.Format("{0},{1}", size.X, size.Y)); } @@ -548,7 +548,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver foreach (ILandObject lo in landObjects) { LandData landData = lo.LandData; - string landDataPath + string landDataPath = String.Format("{0}{1}", regionDir, ArchiveConstants.CreateOarLandDataPath(landData)); m_archiveWriter.WriteFile(landDataPath, LandDataSerializer.Serialize(landData, m_options)); } @@ -578,11 +578,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_archiveWriter.WriteFile(objectPath, serializedObject); } } - + protected void ReceivedAllAssets(ICollection assetsFoundUuids, ICollection assetsNotFoundUuids, bool timedOut) { string errorMessage; - + if (timedOut) { errorMessage = "Loading assets timed out"; @@ -600,10 +600,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver errorMessage = String.Empty; } - + CloseArchive(errorMessage); } - + /// /// Closes the archive and notifies that we're done. /// @@ -622,7 +622,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver if (errorMessage == string.Empty) errorMessage = e.Message; } - + m_log.InfoFormat("[ARCHIVER]: Finished writing out OAR for {0}", m_rootScene.RegionInfo.RegionName); m_rootScene.EventManager.TriggerOarFileSaved(m_requestId, errorMessage); diff --git a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs index 150d4ec..1305545 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/ArchiverModule.cs @@ -49,7 +49,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ArchiverModule")] public class ArchiverModule : INonSharedRegionModule, IRegionArchiverModule { - private static readonly ILog m_log = + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public Scene Scene { get; private set; } @@ -59,13 +59,13 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// protected const string DEFAULT_OAR_BACKUP_FILENAME = "region.oar"; - public string Name - { - get { return "RegionArchiverModule"; } + public string Name + { + get { return "RegionArchiverModule"; } } - public Type ReplaceableInterface - { + public Type ReplaceableInterface + { get { return null; } } @@ -201,9 +201,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver rready.OarLoadingAlert("load"); } */ - + List mainParams = options.Parse(cmdparams); - + // m_log.DebugFormat("MERGE OAR IS [{0}]", mergeOar); // // foreach (string param in mainParams) @@ -288,7 +288,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver ArchiveRegion(path, options); } - + public void ArchiveRegion(string savePath, Dictionary options) { ArchiveRegion(savePath, Guid.Empty, options); @@ -298,7 +298,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver { m_log.InfoFormat( "[ARCHIVER]: Writing archive for region {0} to {1}", Scene.RegionInfo.RegionName, savePath); - + new ArchiveWriteRequest(Scene, savePath, requestId).ArchiveRegion(options); } @@ -330,7 +330,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver new ArchiveReadRequest(Scene, loadPath, requestId, options).DearchiveRegion(); } - + public void DearchiveRegion(Stream loadStream) { Dictionary archiveOptions = new Dictionary(); diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs index c1ff94d..efacae3 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsArchiver.cs @@ -51,8 +51,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// /// Keep a count of the number of assets written so that we can provide status updates /// - protected int m_assetsWritten; - + protected int m_assetsWritten; + protected TarArchiveWriter m_archiveWriter; public AssetsArchiver(TarArchiveWriter archiveWriter) @@ -145,7 +145,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver m_assetsWritten++; //m_log.DebugFormat("[ARCHIVER]: Added asset {0}", m_assetsWritten); - + if (m_assetsWritten % LOG_ASSET_LOAD_NOTIFICATION_INTERVAL == 0) m_log.InfoFormat("[ARCHIVER]: Added {0} assets to archive", m_assetsWritten); } diff --git a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs index 1526b1c..d380da8 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/AssetsRequest.cs @@ -60,7 +60,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver Completed, Aborted }; - + /// /// Timeout threshold if we still need assets or missing asset notifications but have stopped receiving them /// from the asset service @@ -71,14 +71,14 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// If a timeout does occur, limit the amount of UUID information put to the console. /// protected const int MAX_UUID_DISPLAY_ON_TIMEOUT = 3; - + protected System.Timers.Timer m_requestCallbackTimer; /// /// State of this request /// private RequestState m_requestState = RequestState.Initial; - + /// /// uuids to request /// @@ -93,7 +93,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// List of assets that were found. This will be passed back to the requester. /// protected List m_foundAssetUuids = new List(); - + /// /// Maintain a list of assets that could not be found. This will be passed back to the requester. /// @@ -109,16 +109,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver /// protected IAssetService m_assetService; protected IUserAccountService m_userAccountService; - protected UUID m_scopeID; // the grid ID + protected UUID m_scopeID; // the grid ID protected AssetsArchiver m_assetsArchiver; protected Dictionary m_options; protected internal AssetsRequest( - AssetsArchiver assetsArchiver, IDictionary uuids, - IAssetService assetService, IUserAccountService userService, - UUID scope, Dictionary options, + AssetsArchiver assetsArchiver, IDictionary uuids, + IAssetService assetService, IUserAccountService userService, + UUID scope, Dictionary options, AssetsRequestCallback assetsRequestCallback) { m_assetsArchiver = assetsArchiver; @@ -142,7 +142,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver protected internal void Execute() { m_requestState = RequestState.Running; - + m_log.DebugFormat("[ARCHIVER]: AssetsRequest executed looking for {0} possible assets", m_repliesRequired); // We can stop here if there are no assets to fetch @@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver timedOut = false; return; } - + m_requestState = RequestState.Aborted; } @@ -196,24 +196,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver { uuids.Remove(uuid); } - + foreach (UUID uuid in m_notFoundAssetUuids) { uuids.Remove(uuid); } - + m_log.ErrorFormat( "[ARCHIVER]: Asset service failed to return information about {0} requested assets", uuids.Count); - + int i = 0; foreach (UUID uuid in uuids) { m_log.ErrorFormat("[ARCHIVER]: No information about asset {0} received", uuid); - + if (++i >= MAX_UUID_DISPLAY_ON_TIMEOUT) break; } - + if (uuids.Count > MAX_UUID_DISPLAY_ON_TIMEOUT) m_log.ErrorFormat( "[ARCHIVER]: (... {0} more not shown)", uuids.Count - MAX_UUID_DISPLAY_ON_TIMEOUT); @@ -251,24 +251,24 @@ namespace OpenSim.Region.CoreModules.World.Archiver public void AssetRequestCallback(string id, object sender, AssetBase asset) { Culture.SetCurrentCulture(); - + try { lock (this) { //m_log.DebugFormat("[ARCHIVER]: Received callback for asset {0}", id); - + m_requestCallbackTimer.Stop(); - + if ((m_requestState == RequestState.Aborted) || (m_requestState == RequestState.Completed)) { m_log.WarnFormat( - "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", + "[ARCHIVER]: Received information about asset {0} while in state {1}. Ignoring.", id, m_requestState); return; } - + if (asset != null) { // m_log.DebugFormat("[ARCHIVER]: Writing asset {0}", id); @@ -281,7 +281,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver // m_log.DebugFormat("[ARCHIVER]: Recording asset {0} as not found", id); m_notFoundAssetUuids.Add(new UUID(id)); } - + if (m_foundAssetUuids.Count + m_notFoundAssetUuids.Count >= m_repliesRequired) { m_requestState = RequestState.Completed; @@ -294,8 +294,8 @@ namespace OpenSim.Region.CoreModules.World.Archiver "[ARCHIVER]: Successfully added {0} assets ({1} assets not found but these may be expected invalid references)", m_foundAssetUuids.Count, m_notFoundAssetUuids.Count); - - // We want to stop using the asset cache thread asap + + // We want to stop using the asset cache thread asap // as we now need to do the work of producing the rest of the archive WorkManager.RunInThread(PerformAssetsRequestCallback, false, "Archive Assets Request Callback"); } diff --git a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs index e2222fe..809d863 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/DearchiveScenesGroup.cs @@ -214,7 +214,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver return false; string regionDirectory = parts[1]; relativePath = parts[2]; - + RegionInfo region; if (m_directory2region.TryGetValue(regionDirectory, out region)) { diff --git a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs index caa22f7..6885299 100644 --- a/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs +++ b/OpenSim/Region/CoreModules/World/Archiver/Tests/ArchiverTests.cs @@ -65,9 +65,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests protected SerialiserModule m_serialiserModule; protected TaskInventoryItem m_soundItem; - + private AutoResetEvent m_oarEvent = new AutoResetEvent(false); - + [SetUp] public override void SetUp() { @@ -89,10 +89,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_lastRequestId = requestId; m_lastErrorMessage = errorMessage; Console.WriteLine("About to pulse ArchiverTests on LoadCompleted"); - m_oarEvent.Set(); + m_oarEvent.Set(); } } - + private void SaveCompleted(Guid requestId, string errorMessage) { lock (this) @@ -100,7 +100,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_lastRequestId = requestId; m_lastErrorMessage = errorMessage; Console.WriteLine("About to pulse ArchiverTests on SaveCompleted"); - m_oarEvent.Set(); + m_oarEvent.Set(); } } @@ -129,7 +129,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests return new SceneObjectPart(ownerId, shape, groupPosition, rotationOffset, offsetPosition) { Name = partName }; } - + private void CreateTestObjects(Scene scene, out SceneObjectGroup sog1, out SceneObjectGroup sog2, out UUID ncAssetUuid) { SceneObjectPart part1 = CreateSceneObjectPart1(); @@ -200,10 +200,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_archiverModule.ArchiveRegion(archiveWriteStream, requestId); //AssetServerBase assetServer = (AssetServerBase)scene.CommsManager.AssetCache.AssetServer; //while (assetServer.HasWaitingRequests()) - // assetServer.ProcessNextRequest(); + // assetServer.ProcessNextRequest(); m_oarEvent.WaitOne(60000); - + Assert.That(m_lastRequestId, Is.EqualTo(requestId)); byte[] archive = archiveWriteStream.ToArray(); @@ -211,7 +211,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests TarArchiveReader tar = new TarArchiveReader(archiveReadStream); bool gotNcAssetFile = false; - + string expectedNcAssetFileName = string.Format("{0}_{1}", ncAssetUuid, "notecard.txt"); List foundPaths = new List(); @@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); string filePath; - TarArchiveReader.TarEntryType tarEntryType; + TarArchiveReader.TarEntryType tarEntryType; byte[] data = tar.ReadEntry(out filePath, out tarEntryType); Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); @@ -228,9 +228,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Dictionary archiveOptions = new Dictionary(); ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions); arr.LoadControlFile(filePath, data, new DearchiveScenesInfo()); - - Assert.That(arr.ControlFileLoaded, Is.True); - + + Assert.That(arr.ControlFileLoaded, Is.True); + while (tar.ReadEntry(out filePath, out tarEntryType) != null) { if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) @@ -266,7 +266,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.AddNewSceneObject(sog1, false); SceneObjectPart part2 = CreateSceneObjectPart2(); - + AssetNotecard nc = new AssetNotecard(); nc.BodyText = "Hello World!"; nc.Encode(); @@ -276,10 +276,10 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); m_scene.AssetService.Store(ncAsset); SceneObjectGroup sog2 = new SceneObjectGroup(part2); - TaskInventoryItem ncItem + TaskInventoryItem ncItem = new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid }; part2.Inventory.AddInventoryItem(ncItem, true); - + m_scene.AddNewSceneObject(sog2, false); MemoryStream archiveWriteStream = new MemoryStream(); @@ -306,7 +306,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests expectedPaths.Add(ArchiveHelpers.CreateObjectPath(sog2)); string filePath; - TarArchiveReader.TarEntryType tarEntryType; + TarArchiveReader.TarEntryType tarEntryType; byte[] data = tar.ReadEntry(out filePath, out tarEntryType); Assert.That(filePath, Is.EqualTo(ArchiveConstants.CONTROL_FILE_PATH)); @@ -314,9 +314,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Dictionary archiveOptions = new Dictionary(); ArchiveReadRequest arr = new ArchiveReadRequest(m_scene, (Stream)null, Guid.Empty, archiveOptions); arr.LoadControlFile(filePath, data, new DearchiveScenesInfo()); - - Assert.That(arr.ControlFileLoaded, Is.True); - + + Assert.That(arr.ControlFileLoaded, Is.True); + while (tar.ReadEntry(out filePath, out tarEntryType) != null) { if (filePath.StartsWith(ArchiveConstants.ASSETS_PATH)) @@ -345,11 +345,11 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests MemoryStream archiveWriteStream = new MemoryStream(); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); - + // Put in a random blank directory to check that this doesn't upset the load process tar.WriteDir("ignoreme"); - - // Also check that direct entries which will also have a file entry containing that directory doesn't + + // Also check that direct entries which will also have a file entry containing that directory doesn't // upset load tar.WriteDir(ArchiveConstants.TERRAINS_PATH); @@ -392,7 +392,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Math.Round(part1.GroupPosition.X), Math.Round(part1.GroupPosition.Y), Math.Round(part1.GroupPosition.Z), part1.UUID); tar.WriteFile(ArchiveConstants.OBJECTS_PATH + object1FileName, SceneObjectSerializer.ToXml2Format(object1)); - + tar.Close(); MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); @@ -400,9 +400,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.EventManager.OnOarFileLoaded += LoadCompleted; m_oarEvent.Reset(); m_archiverModule.DearchiveRegion(archiveReadStream); - + m_oarEvent.WaitOne(60000); - + Assert.That(m_lastErrorMessage, Is.Null); TestLoadedRegion(part1, soundItemName, soundData); @@ -475,31 +475,31 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.AddNewSceneObject(sog1, false); SceneObjectPart part2 = CreateSceneObjectPart2(); - + AssetNotecard nc = new AssetNotecard(); nc.BodyText = "Hello World!"; nc.Encode(); UUID ncAssetUuid = new UUID("00000000-0000-0000-1000-000000000000"); UUID ncItemUuid = new UUID("00000000-0000-0000-1100-000000000000"); - AssetBase ncAsset + AssetBase ncAsset = AssetHelpers.CreateAsset(ncAssetUuid, AssetType.Notecard, nc.AssetData, UUID.Zero); m_scene.AssetService.Store(ncAsset); SceneObjectGroup sog2 = new SceneObjectGroup(part2); - TaskInventoryItem ncItem + TaskInventoryItem ncItem = new TaskInventoryItem { Name = "ncItem", AssetID = ncAssetUuid, ItemID = ncItemUuid }; part2.Inventory.AddInventoryItem(ncItem, true); - + m_scene.AddNewSceneObject(sog2, false); MemoryStream archiveWriteStream = new MemoryStream(); m_scene.EventManager.OnOarFileSaved += SaveCompleted; Guid requestId = new Guid("00000000-0000-0000-0000-808080808080"); - + m_oarEvent.Reset(); m_archiverModule.ArchiveRegion( - archiveWriteStream, requestId, new Dictionary() { { "wipe-owners", Boolean.TrueString } }); - + archiveWriteStream, requestId, new Dictionary() { { "wipe-owners", Boolean.TrueString } }); + m_oarEvent.WaitOne(60000); Assert.That(m_lastRequestId, Is.EqualTo(requestId)); @@ -529,7 +529,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests scene2.EventManager.OnOarFileLoaded += LoadCompleted; m_oarEvent.Reset(); archiverModule.DearchiveRegion(archiveReadStream); - + m_oarEvent.WaitOne(60000); Assert.That(m_lastErrorMessage, Is.Null); @@ -557,16 +557,16 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests MockGroupsServicesConnector groupsService = new MockGroupsServicesConnector(); IConfigSource configSource = new IniConfigSource(); - IConfig config = configSource.AddConfig("Groups"); + IConfig config = configSource.AddConfig("Groups"); config.Set("Enabled", true); - config.Set("Module", "GroupsModule"); + config.Set("Module", "GroupsModule"); config.Set("DebugEnabled", true); SceneHelpers.SetupSceneModules( m_scene, configSource, new object[] { new GroupsModule(), groupsService, new LandManagementModule() }); // Create group in scene for loading // FIXME: For now we'll put up with the issue that we'll get a group ID that varies across tests. - UUID groupID + UUID groupID = groupsService.CreateGroup(UUID.Zero, "group1", "", true, UUID.Zero, 3, true, true, true, UUID.Zero); // Construct OAR @@ -594,7 +594,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.EventManager.OnOarFileLoaded += LoadCompleted; m_oarEvent.Reset(); m_archiverModule.DearchiveRegion(oarStream); - + m_oarEvent.WaitOne(60000); ILandObject rLo = m_scene.LandChannel.GetLandObject(16, 16); @@ -617,7 +617,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests MemoryStream archiveWriteStream = new MemoryStream(); TarArchiveWriter tar = new TarArchiveWriter(archiveWriteStream); - + tar.WriteDir(ArchiveConstants.TERRAINS_PATH); tar.WriteFile( ArchiveConstants.CONTROL_FILE_PATH, @@ -658,7 +658,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests rs.AddSpawnPoint(SpawnPoint.Parse("1,-2,0.33")); tar.WriteFile(ArchiveConstants.SETTINGS_PATH + "region1.xml", RegionSettingsSerializer.Serialize(rs)); - + tar.Close(); MemoryStream archiveReadStream = new MemoryStream(archiveWriteStream.ToArray()); @@ -666,9 +666,9 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.EventManager.OnOarFileLoaded += LoadCompleted; m_oarEvent.Reset(); m_archiverModule.DearchiveRegion(archiveReadStream); - + m_oarEvent.WaitOne(60000); - + Assert.That(m_lastErrorMessage, Is.Null); RegionSettings loadedRs = m_scene.RegionInfo.RegionSettings; @@ -705,7 +705,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests Assert.AreEqual(UUID.Zero, loadedRs.TelehubObject); // because no object was found with the original UUID Assert.AreEqual(0, loadedRs.SpawnPoints().Count); } - + /// /// Test merging an OpenSim Region Archive into an existing scene /// @@ -741,7 +741,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests scene.EventManager.OnOarFileSaved += SaveCompleted; m_oarEvent.Reset(); m_archiverModule.ArchiveRegion(archiveWriteStream); - + m_oarEvent.WaitOne(60000); } @@ -758,7 +758,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests archiveOptions.Add("merge", null); m_oarEvent.Reset(); m_archiverModule.DearchiveRegion(archiveReadStream, Guid.Empty, archiveOptions); - + m_oarEvent.WaitOne(60000); SceneObjectPart object1Existing = m_scene.GetSceneObjectPart(part1.Name); @@ -819,7 +819,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests SceneObjectGroup sog1; SceneObjectGroup sog2; UUID ncAssetUuid; - + CreateTestObjects(scene, out sog1, out sog2, out ncAssetUuid); expectedPaths[scene.RegionInfo.RegionID] = new List(); @@ -841,7 +841,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.EventManager.OnOarFileSaved += SaveCompleted; m_oarEvent.Reset(); m_archiverModule.ArchiveRegion(archiveWriteStream, requestId, options); - + m_oarEvent.WaitOne(60000); @@ -993,7 +993,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests tar.Close(); - + // Delete the current objects, to test that they're loaded from the OAR and didn't // just remain in the scene. m_sceneHelpers.SceneManager.ForEachScene(delegate(Scene scene) @@ -1012,7 +1012,7 @@ namespace OpenSim.Region.CoreModules.World.Archiver.Tests m_scene.EventManager.OnOarFileLoaded += LoadCompleted; m_oarEvent.Reset(); m_archiverModule.DearchiveRegion(archiveReadStream); - + m_oarEvent.WaitOne(60000); Assert.That(m_lastErrorMessage, Is.Null); diff --git a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs index 617c348..a450dd6 100644 --- a/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs +++ b/OpenSim/Region/CoreModules/World/Cloud/CloudModule.cs @@ -40,7 +40,7 @@ namespace OpenSim.Region.CoreModules.World [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "CloudModule")] public class CloudModule : ICloudModule, INonSharedRegionModule { -// private static readonly log4net.ILog m_log +// private static readonly log4net.ILog m_log // = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); private uint m_frame = 0; private int m_frameUpdateRate = 1000; @@ -163,7 +163,7 @@ namespace OpenSim.Region.CoreModules.World columnRight = 0; columnLeft = x - 1; } - else + else { columnRight = x + 1; columnLeft = x - 1; @@ -185,14 +185,14 @@ namespace OpenSim.Region.CoreModules.World rowAbove = y + 1; rowBelow = y - 1; } - float neighborAverage = (cloudCover[rowBelow * 16 + columnLeft] + - cloudCover[y * 16 + columnLeft] + - cloudCover[rowAbove * 16 + columnLeft] + - cloudCover[rowBelow * 16 + x] + - cloudCover[rowAbove * 16 + x] + - cloudCover[rowBelow * 16 + columnRight] + - cloudCover[y * 16 + columnRight] + - cloudCover[rowAbove * 16 + columnRight] + + float neighborAverage = (cloudCover[rowBelow * 16 + columnLeft] + + cloudCover[y * 16 + columnLeft] + + cloudCover[rowAbove * 16 + columnLeft] + + cloudCover[rowBelow * 16 + x] + + cloudCover[rowAbove * 16 + x] + + cloudCover[rowBelow * 16 + columnRight] + + cloudCover[y * 16 + columnRight] + + cloudCover[rowAbove * 16 + columnRight] + cloudCover[y * 16 + x]) / 9; newCover[y * 16 + x] = ((neighborAverage / m_cloudDensity) + 0.175f) % 1.0f; newCover[y * 16 + x] *= m_cloudDensity; @@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.World Array.Copy(newCover, cloudCover, 16 * 16); m_dataVersion++; } - + private void CloudUpdate() { if ((!m_ready || m_busy || m_cloudDensity == 0 || @@ -243,7 +243,7 @@ namespace OpenSim.Region.CoreModules.World } } - + /// /// Calculate the cloud cover over the region. /// diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs index ad561fd..051ff71 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateConnector.cs @@ -149,7 +149,7 @@ namespace OpenSim.Region.CoreModules.World.Estate { foreach (Scene s in m_EstateModule.Scenes) { - RegionInfo sreg = s.RegionInfo; + RegionInfo sreg = s.RegionInfo; if (regions.Contains(sreg.RegionID)) { string url = sreg.ExternalHostName + ":" + sreg.HttpPort; diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs index 702b503..7879f83 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementCommands.cs @@ -49,18 +49,18 @@ namespace OpenSim.Region.CoreModules.World.Estate public class EstateManagementCommands { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected EstateManagementModule m_module; public EstateManagementCommands(EstateManagementModule module) { m_module = module; } - + public void Initialise() - { + { // m_log.DebugFormat("[ESTATE MODULE]: Setting up estate commands for region {0}", m_module.Scene.RegionInfo.RegionName); - + m_module.Scene.AddCommand("Regions", m_module, "set terrain texture", "set terrain texture [] []", "Sets the terrain to , if or are specified, it will only " + @@ -77,14 +77,14 @@ namespace OpenSim.Region.CoreModules.World.Estate m_module.Scene.AddCommand("Regions", m_module, "set water height", "set water height [] []", - "Sets the water height in meters. If and are specified, it will only set it on regions with a matching coordinate. " + + "Sets the water height in meters. If and are specified, it will only set it on regions with a matching coordinate. " + "Specify -1 in or to wildcard that coordinate.", consoleSetWaterHeight); m_module.Scene.AddCommand( "Estates", m_module, "estate show", "estate show", "Shows all estates on the simulator.", ShowEstatesCommand); } - + public void Close() {} #region CommandHandlers @@ -120,7 +120,7 @@ namespace OpenSim.Region.CoreModules.World.Estate m_module.Scene.RegionInfo.RegionSettings.TerrainTexture4 = texture; break; } - + m_module.Scene.RegionInfo.RegionSettings.Save(); m_module.TriggerRegionInfoChange(); m_module.sendRegionHandshakeToAll(); @@ -130,7 +130,7 @@ namespace OpenSim.Region.CoreModules.World.Estate protected void consoleSetWaterHeight(string module, string[] args) { string heightstring = args[3]; - + int x = (args.Length > 4 ? int.Parse(args[4]) : -1); int y = (args.Length > 5 ? int.Parse(args[5]) : -1); @@ -143,13 +143,13 @@ namespace OpenSim.Region.CoreModules.World.Estate m_log.Debug("[ESTATEMODULE]: Setting water height in " + m_module.Scene.RegionInfo.RegionName + " to " + string.Format(" {0}", selectedheight)); m_module.Scene.RegionInfo.RegionSettings.WaterHeight = selectedheight; - + m_module.Scene.RegionInfo.RegionSettings.Save(); m_module.TriggerRegionInfoChange(); m_module.sendRegionHandshakeToAll(); } } - } + } protected void consoleSetTerrainHeights(string module, string[] args) { string num = args[3]; @@ -198,31 +198,31 @@ namespace OpenSim.Region.CoreModules.World.Estate m_module.Scene.RegionInfo.RegionSettings.Elevation2NE = highValue; break; } - + m_module.Scene.RegionInfo.RegionSettings.Save(); m_module.TriggerRegionInfoChange(); m_module.sendRegionHandshakeToAll(); } } - } - + } + protected void ShowEstatesCommand(string module, string[] cmd) { - StringBuilder report = new StringBuilder(); + StringBuilder report = new StringBuilder(); RegionInfo ri = m_module.Scene.RegionInfo; EstateSettings es = ri.EstateSettings; - - report.AppendFormat("Estate information for region {0}\n", ri.RegionName); + + report.AppendFormat("Estate information for region {0}\n", ri.RegionName); report.AppendFormat( "{0,-20} {1,-7} {2,-20}\n", "Estate Name", "ID", "Owner"); - + report.AppendFormat( - "{0,-20} {1,-7} {2,-20}\n", + "{0,-20} {1,-7} {2,-20}\n", es.EstateName, es.EstateID, m_module.UserManager.GetUserName(es.EstateOwner)); - + MainConsole.Instance.Output(report.ToString()); } #endregion diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs index efd4ca6..3c45b68 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateManagementModule.cs @@ -57,8 +57,8 @@ namespace OpenSim.Region.CoreModules.World.Estate private Timer m_regionChangeTimer = new Timer(); public Scene Scene { get; private set; } public IUserManagement UserManager { get; private set; } - - protected EstateManagementCommands m_commands; + + protected EstateManagementCommands m_commands; /// /// If false, region restart requests from the client are blocked even if they are otherwise legitimate. @@ -77,12 +77,12 @@ namespace OpenSim.Region.CoreModules.World.Estate private int m_delayCount = 0; #region Region Module interface - + public string Name { get { return "EstateManagementModule"; } } - - public Type ReplaceableInterface { get { return null; } } - public void Initialise(IConfigSource source) + public Type ReplaceableInterface { get { return null; } } + + public void Initialise(IConfigSource source) { AllowRegionRestartFromClient = true; @@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Estate if (config != null) AllowRegionRestartFromClient = config.GetBoolean("AllowRegionRestartFromClient", true); } - + public void AddRegion(Scene scene) { Scene = scene; @@ -108,19 +108,19 @@ namespace OpenSim.Region.CoreModules.World.Estate m_regionChangeTimer.Elapsed += RaiseRegionInfoChange; m_regionChangeTimer.AutoReset = false; } - - public void RemoveRegion(Scene scene) {} - + + public void RemoveRegion(Scene scene) {} + public void RegionLoaded(Scene scene) { // Sets up the sun module based no the saved Estate and Region Settings // DO NOT REMOVE or the sun will stop working scene.TriggerEstateSunUpdate(); - - UserManager = scene.RequestModuleInterface(); + + UserManager = scene.RequestModuleInterface(); } - public void Close() + public void Close() { m_commands.Close(); } @@ -486,7 +486,7 @@ namespace OpenSim.Region.CoreModules.World.Estate if((byte)maxAgents <= Scene.RegionInfo.AgentCapacity) Scene.RegionInfo.RegionSettings.AgentLimit = (byte) maxAgents; - else + else Scene.RegionInfo.RegionSettings.AgentLimit = Scene.RegionInfo.AgentCapacity; Scene.RegionInfo.RegionSettings.ObjectBonus = objectBonusFactor; @@ -640,7 +640,7 @@ namespace OpenSim.Region.CoreModules.World.Estate restartModule.ScheduleRestart(UUID.Zero, "Region will restart in {0}", times.ToArray(), false); m_log.InfoFormat( - "User {0} requested restart of region {1} in {2} seconds", + "User {0} requested restart of region {1} in {2} seconds", remoteClient.Name, Scene.Name, times.Count != 0 ? times[0] : 0); } } @@ -648,9 +648,9 @@ namespace OpenSim.Region.CoreModules.World.Estate private void handleChangeEstateCovenantRequest(IClientAPI remoteClient, UUID estateCovenantID) { // m_log.DebugFormat( -// "[ESTATE MANAGEMENT MODULE]: Handling request from {0} to change estate covenant to {1}", +// "[ESTATE MANAGEMENT MODULE]: Handling request from {0} to change estate covenant to {1}", // remoteClient.Name, estateCovenantID); - + Scene.RegionInfo.RegionSettings.Covenant = estateCovenantID; Scene.RegionInfo.RegionSettings.CovenantChangedDateTime = Util.UnixTimeSinceEpoch(); Scene.RegionInfo.RegionSettings.Save(); @@ -694,7 +694,7 @@ namespace OpenSim.Region.CoreModules.World.Estate } } } - + private void execDeltaRequests(object o) { IClientAPI remote_client; @@ -720,23 +720,23 @@ namespace OpenSim.Region.CoreModules.World.Estate if(!Scene.IsRunning) break; - if(req == null) + if(req == null) { if(changed.Count > 0) { foreach(EstateSettings est in changed.Values) Scene.EstateDataService.StoreEstateSettings(est); - + TriggerEstateInfoChange(); } - + EstateSettings es = Scene.RegionInfo.EstateSettings; foreach(KeyValuePair kvp in sendAllowedOrBanList) { IClientAPI cli = kvp.Key; UUID invoive = kvp.Value; cli.SendEstateList(invoive, (int)Constants.EstateAccessCodex.AllowedAccess, es.EstateAccess, es.EstateID); - cli.SendBannedUserList(invoive, es.EstateBans, es.EstateID); + cli.SendBannedUserList(invoive, es.EstateBans, es.EstateID); } sendAllowedOrBanList.Clear(); @@ -777,7 +777,7 @@ namespace OpenSim.Region.CoreModules.World.Estate bool doOtherEstates = ((estateAccessType & 3) != 0); EstateSettings thisSettings = Scene.RegionInfo.EstateSettings; - int thisEstateID =(int)thisSettings.EstateID; + int thisEstateID =(int)thisSettings.EstateID; UUID agentID = remote_client.AgentId; @@ -811,7 +811,7 @@ namespace OpenSim.Region.CoreModules.World.Estate } estateIDs.Clear(); } - + // the commands // first the ones allowed for estate managers on this region if ((estateAccessType & 4) != 0) // User add @@ -1020,7 +1020,7 @@ namespace OpenSim.Region.CoreModules.World.Estate break; } } - + if (alreadyInList && listitem != null) { if (doOtherEstates) // All estates @@ -1072,7 +1072,7 @@ namespace OpenSim.Region.CoreModules.World.Estate if(!isadmin && !estateSettings.IsEstateOwner(agentID)) // redundante check? continue; if(estateSettings.EstateManagersCount() >= (int)Constants.EstateAccessLimits.EstateManagers) - continue; + continue; estateSettings.AddEstateManager(user); changed[(int)estateSettings.EstateID] = estateSettings; } @@ -1158,7 +1158,7 @@ namespace OpenSim.Region.CoreModules.World.Estate IClientAPI remote_client, UUID invoice, UUID senderID, UUID sessionID, string senderName, string message) { IDialogModule dm = Scene.RequestModuleInterface(); - + if (dm != null) dm.SendNotificationToUsersInRegion(senderID, senderName, message); } @@ -1249,7 +1249,7 @@ namespace OpenSim.Region.CoreModules.World.Estate } }); } - + private void AbortTerrainXferHandler(IClientAPI remoteClient, ulong XferID) { lock (this) @@ -1332,7 +1332,7 @@ namespace OpenSim.Region.CoreModules.World.Estate if (TerrainUploader == null) { m_log.DebugFormat( - "[TERRAIN]: Started receiving terrain upload for region {0} from {1}", + "[TERRAIN]: Started receiving terrain upload for region {0} from {1}", Scene.Name, remote_client.Name); TerrainUploader = new EstateTerrainXferHandler(remote_client, clientFileName); @@ -1352,7 +1352,7 @@ namespace OpenSim.Region.CoreModules.World.Estate { // Save terrain here ITerrainModule terr = Scene.RequestModuleInterface(); - + if (terr != null) { // m_log.Warn("[CLIENT]: Got Request to Send Terrain in region " + Scene.RegionInfo.RegionName); diff --git a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs index fb4d04f..f3c8aa8 100644 --- a/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs +++ b/OpenSim/Region/CoreModules/World/Estate/EstateModule.cs @@ -52,7 +52,7 @@ namespace OpenSim.Region.CoreModules.World.Estate protected List m_Scenes = new List(); protected bool m_InInfoUpdate = false; private string token = "7db8eh2gvgg45jj"; - protected bool m_enabled = false; + protected bool m_enabled = false; public bool InInfoUpdate { @@ -74,19 +74,19 @@ namespace OpenSim.Region.CoreModules.World.Estate IConfig estateConfig = config.Configs["Estates"]; if (estateConfig != null) { - if (estateConfig.GetString("EstateCommunicationsHandler", Name) == Name) - m_enabled = true; - else - return; + if (estateConfig.GetString("EstateCommunicationsHandler", Name) == Name) + m_enabled = true; + else + return; port = (uint)estateConfig.GetInt("Port", 0); // this will need to came from somewhere else token = estateConfig.GetString("Token", token); } - else - { - m_enabled = true; - } + else + { + m_enabled = true; + } m_EstateConnector = new EstateConnector(this, token, port); @@ -108,8 +108,8 @@ namespace OpenSim.Region.CoreModules.World.Estate public void AddRegion(Scene scene) { - if (!m_enabled) - return; + if (!m_enabled) + return; lock (m_Scenes) m_Scenes.Add(scene); @@ -117,8 +117,8 @@ namespace OpenSim.Region.CoreModules.World.Estate public void RegionLoaded(Scene scene) { - if (!m_enabled) - return; + if (!m_enabled) + return; IEstateModule em = scene.RequestModuleInterface(); @@ -131,8 +131,8 @@ namespace OpenSim.Region.CoreModules.World.Estate public void RemoveRegion(Scene scene) { - if (!m_enabled) - return; + if (!m_enabled) + return; lock (m_Scenes) m_Scenes.Remove(scene); diff --git a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs index 9de88d9..e4c0373 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandChannel.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandChannel.cs @@ -51,7 +51,7 @@ namespace OpenSim.Region.CoreModules.World.Land public const int LAND_SELECT_OBJECTS_GROUP = 4; public const int LAND_SELECT_OBJECTS_OTHER = 8; - + public const byte LAND_TYPE_PUBLIC = 0; //Equals 00000000 // types 1 to 7 are exclusive public const byte LAND_TYPE_OWNED_BY_OTHER = 1; //Equals 00000001 @@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Land #endregion private readonly Scene m_scene; - private readonly LandManagementModule m_landManagementModule; + private readonly LandManagementModule m_landManagementModule; public LandChannel(Scene scene, LandManagementModule landManagementMod) { @@ -91,7 +91,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return m_landManagementModule.GetLandObject(x_float, y_float); } - + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); obj.LandData.Name = "NO LAND"; return obj; @@ -117,7 +117,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return m_landManagementModule.GetLandObject(x, y); } - + ILandObject obj = new LandObject(UUID.Zero, false, m_scene); obj.LandData.Name = "NO LAND"; return obj; @@ -132,7 +132,7 @@ namespace OpenSim.Region.CoreModules.World.Land return new List(); } - + public void Clear(bool setupDefaultParcel) { if (m_landManagementModule != null) @@ -182,7 +182,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landManagementModule.Subdivide(start_x, start_y, end_x, end_y, attempting_user_id); } } - + 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 22bc49e..63b8de0 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandManagementModule.cs @@ -52,7 +52,7 @@ using GridRegion = OpenSim.Services.Interfaces.GridRegion; namespace OpenSim.Region.CoreModules.World.Land { // used for caching - internal class ExtendedLandData + internal class ExtendedLandData { public LandData LandData; public ulong RegionHandle; @@ -151,9 +151,9 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.EventManager.OnParcelPrimCountAdd += EventManagerOnParcelPrimCountAdd; m_scene.EventManager.OnParcelPrimCountUpdate += EventManagerOnParcelPrimCountUpdate; - m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; + m_scene.EventManager.OnObjectBeingRemovedFromScene += EventManagerOnObjectBeingRemovedFromScene; m_scene.EventManager.OnRequestParcelPrimCountUpdate += EventManagerOnRequestParcelPrimCountUpdate; - + m_scene.EventManager.OnAvatarEnteringNewParcel += EventManagerOnAvatarEnteringNewParcel; m_scene.EventManager.OnClientMovement += EventManagerOnClientMovement; m_scene.EventManager.OnValidateLandBuy += EventManagerOnValidateLandBuy; @@ -163,14 +163,14 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.EventManager.OnSignificantClientMovement += EventManagerOnSignificantClientMovement; m_scene.EventManager.OnNoticeNoLandDataFromStorage += EventManagerOnNoLandDataFromStorage; m_scene.EventManager.OnIncomingLandDataFromStorage += EventManagerOnIncomingLandDataFromStorage; - m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; + m_scene.EventManager.OnSetAllowForcefulBan += EventManagerOnSetAllowedForcefulBan; m_scene.EventManager.OnRegisterCaps += EventManagerOnRegisterCaps; - + lock (m_scene) { m_scene.LandChannel = (ILandChannel)landChannel; } - + RegisterCommands(); } @@ -183,8 +183,8 @@ namespace OpenSim.Region.CoreModules.World.Land } public void RemoveRegion(Scene scene) - { - // TODO: Release event manager listeners here + { + // TODO: Release event manager listeners here } // private bool OnVerifyUserConnection(ScenePresence scenePresence, out string reason) @@ -192,7 +192,7 @@ namespace OpenSim.Region.CoreModules.World.Land // ILandObject nearestParcel = m_scene.GetNearestAllowedParcel(scenePresence.UUID, scenePresence.AbsolutePosition.X, scenePresence.AbsolutePosition.Y); // reason = "You are not allowed to enter this sim."; // return nearestParcel != null; -// } +// } void EventManagerOnNewClient(IClientAPI client) { @@ -274,7 +274,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landIDList = new int[m_scene.RegionInfo.RegionSizeX / LandUnit, m_scene.RegionInfo.RegionSizeY / LandUnit]; } } - + /// /// Create a default parcel that spans the entire region and is owned by the estate owner. /// @@ -360,7 +360,7 @@ namespace OpenSim.Region.CoreModules.World.Land return false; } } - + if(ban) { if (!forcedPosition.Contains(avatar.UUID)) @@ -581,13 +581,13 @@ namespace OpenSim.Region.CoreModules.World.Land /// Adds a land object to the stored list and adds them to the landIDList to what they own /// /// - /// The land object being added. + /// The land object being added. /// Will return null if this overlaps with an existing parcel that has not had its bitmap adjusted. /// public ILandObject AddLandObject(ILandObject land) { ILandObject new_land = land.Copy(); - + // Only now can we add the prim counts to the land object - we rely on the global ID which is generated // as a random UUID inside LandData initialization if (m_primCountModule != null) @@ -607,7 +607,7 @@ namespace OpenSim.Region.CoreModules.World.Land } else { - // If other land objects still believe that they occupy any parts of the same space, + // If other land objects still believe that they occupy any parts of the same space, // then do not allow the add to proceed. for (int x = 0; x < landBitmap.GetLength(0); x++) { @@ -642,7 +642,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (landBitmap[x, y]) { // m_log.DebugFormat( - // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", + // "[LAND MANAGEMENT MODULE]: Registering parcel {0} for land co-ord ({1}, {2}) on {3}", // new_land.LandData.Name, x, y, m_scene.RegionInfo.RegionName); m_landIDList[x, y] = newLandLocalID; @@ -690,10 +690,10 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.EventManager.TriggerLandObjectRemoved(land.LandData.GlobalID); } - + /// /// Clear the scene of all parcels - /// + /// public void Clear(bool setupDefaultParcel) { Dictionary landworkList; @@ -1077,7 +1077,7 @@ namespace OpenSim.Region.CoreModules.World.Land if(maxindex < 0 || selectedLandObjects.Count < 2) return; - + ILandObject masterLandObject = selectedLandObjects[maxindex]; selectedLandObjects.RemoveAt(maxindex); @@ -1146,7 +1146,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (currentParcelBlock != null) { - // types + // types if (currentParcelBlock.LandData.OwnerID == remote_client.AgentId) { //Owner Flag @@ -1165,7 +1165,7 @@ namespace OpenSim.Region.CoreModules.World.Land } else if (currentParcelBlock.LandData.OwnerID == UUID.Zero) { - //Public type + //Public type tempByte = (byte)LandChannel.LAND_TYPE_PUBLIC; // this does nothing, its zero } // LAND_TYPE_IS_BEING_AUCTIONED still unsuported @@ -1402,7 +1402,7 @@ namespace OpenSim.Region.CoreModules.World.Land land.LandData.GroupID = UUID.Zero; land.LandData.IsGroupOwned = false; land.LandData.Flags &= ~(uint) (ParcelFlags.ForSale | ParcelFlags.ForSaleObjects | ParcelFlags.SellParcelObjects | ParcelFlags.ShowDirectory); - + m_scene.ForEachClient(SendParcelOverlay); land.SendLandUpdateToClient(true, remote_client); UpdateLandObject(land.LandData.LocalID, land.LandData); @@ -1584,7 +1584,7 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject new_land = new LandObject(data.OwnerID, data.IsGroupOwned, m_scene); new_land.LandData = data.Copy(); - new_land.SetLandBitmapFromByteArray(); + new_land.SetLandBitmapFromByteArray(); AddLandObject(new_land); // new_land.SendLandUpdateToAvatarsOverMe(); } @@ -1599,7 +1599,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_landList.TryGetValue(localID, out selectedParcel); } - if (selectedParcel == null) + if (selectedParcel == null) return; selectedParcel.ReturnLandObjects(returnType, agentIDs, taskIDs, remoteClient); @@ -1706,7 +1706,7 @@ namespace OpenSim.Region.CoreModules.World.Land private string ProcessPropertiesUpdate(string request, string path, string param, UUID agentID, Caps caps) { IClientAPI client; - if (!m_scene.TryGetClient(agentID, out client)) + if (!m_scene.TryGetClient(agentID, out client)) { m_log.WarnFormat("[LAND MANAGEMENT MODULE]: Unable to retrieve IClientAPI for {0}", agentID); return LLSDHelpers.SerialiseLLSDReply(new LLSDEmpty()); @@ -1765,7 +1765,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (land != null) { - UpdateLandProperties(land,land_update, client); + UpdateLandProperties(land,land_update, client); m_scene.EventManager.TriggerOnParcelPropertiesUpdateRequest(land_update, parcelID, client); } else @@ -2103,7 +2103,7 @@ namespace OpenSim.Region.CoreModules.World.Land targetAvatar.TeleportWithMomentum(pos, null); targetAvatar.ControllingClient.SendAlertMessage("You have been ejected by " + parcelManager.Firstname + " " + parcelManager.Lastname); parcelManager.ControllingClient.SendAlertMessage("Avatar Ejected."); - + if ((flags & 1) != 0) // Ban TODO: Remove magic number { LandAccessEntry entry = new LandAccessEntry(); @@ -2144,7 +2144,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (// Required: local user; foreign users cannot set home m_scene.UserManagementModule.IsLocalGridUser(remoteClient.AgentId) && (// (a) gods and land managers can set home - m_scene.Permissions.IsAdministrator(remoteClient.AgentId) || + m_scene.Permissions.IsAdministrator(remoteClient.AgentId) || m_scene.Permissions.IsGod(remoteClient.AgentId) || // (b) land owners can set home remoteClient.AgentId == land.LandData.OwnerID || @@ -2196,8 +2196,8 @@ namespace OpenSim.Region.CoreModules.World.Land "If no local land ID is given, then summary information about all the parcels is shown.\n" + "If a local land ID is given then full information about that parcel is shown.", HandleShowCommand); - } - + } + protected void HandleClearCommand(string module, string[] args) { if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) @@ -2205,9 +2205,9 @@ namespace OpenSim.Region.CoreModules.World.Land string response = MainConsole.Instance.CmdPrompt( string.Format( - "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name), + "Are you sure that you want to clear all land parcels from {0} (y or n)", m_scene.Name), "n"); - + if (response.ToLower() == "y") { Clear(true); @@ -2217,14 +2217,14 @@ namespace OpenSim.Region.CoreModules.World.Land { MainConsole.Instance.OutputFormat("Aborting clear of all parcels from {0}", m_scene.Name); } - } - + } + protected void HandleShowCommand(string module, string[] args) { if (!(MainConsole.Instance.ConsoleScene == null || MainConsole.Instance.ConsoleScene == m_scene)) return; - StringBuilder report = new StringBuilder(); + StringBuilder report = new StringBuilder(); if (args.Length <= 2) { @@ -2240,7 +2240,7 @@ namespace OpenSim.Region.CoreModules.World.Land ILandObject lo; lock (m_landList) - { + { if (!m_landList.TryGetValue(landLocalId, out lo)) { MainConsole.Instance.OutputFormat("No parcel found with local ID {0}", landLocalId); @@ -2265,7 +2265,7 @@ namespace OpenSim.Region.CoreModules.World.Land cdt.AddColumn("Starts", ConsoleDisplayUtil.VectorSize); cdt.AddColumn("Ends", ConsoleDisplayUtil.VectorSize); cdt.AddColumn("Owner", ConsoleDisplayUtil.UserNameSize); - + lock (m_landList) { foreach (ILandObject lo in m_landList.Values) @@ -2316,7 +2316,7 @@ namespace OpenSim.Region.CoreModules.World.Land cdl.AddRow("GroupID", ld.GroupID); cdl.AddRow("Status", ld.Status); - cdl.AddRow("Flags", (ParcelFlags)ld.Flags); + cdl.AddRow("Flags", (ParcelFlags)ld.Flags); cdl.AddRow("Landing Type", (LandingType)ld.LandingType); cdl.AddRow("User Location", ld.UserLocation); diff --git a/OpenSim/Region/CoreModules/World/Land/LandObject.cs b/OpenSim/Region/CoreModules/World/Land/LandObject.cs index 4cbc8b8..fc2282d 100644 --- a/OpenSim/Region/CoreModules/World/Land/LandObject.cs +++ b/OpenSim/Region/CoreModules/World/Land/LandObject.cs @@ -75,7 +75,7 @@ namespace OpenSim.Region.CoreModules.World.Land return free; } - protected LandData m_landData; + protected LandData m_landData; public LandData LandData { get { return m_landData; } @@ -196,7 +196,7 @@ namespace OpenSim.Region.CoreModules.World.Land else if(testpos.Y >= maxy) return null; // will never get there } - + while(!LandBitmap[(int)testpos.X, (int)testpos.Y]) { testpos += direction; @@ -278,14 +278,14 @@ namespace OpenSim.Region.CoreModules.World.Land else LandBitmap = new bool[m_scene.RegionInfo.RegionSizeX / landUnit, m_scene.RegionInfo.RegionSizeY / landUnit]; - LandData = new LandData(); + LandData = new LandData(); LandData.OwnerID = owner_id; if (is_group_owned) LandData.GroupID = owner_id; else LandData.GroupID = UUID.Zero; LandData.IsGroupOwned = is_group_owned; - + m_scene.EventManager.OnFrame += OnFrame; } @@ -294,7 +294,7 @@ namespace OpenSim.Region.CoreModules.World.Land #region Member Functions #region General Functions - + /// /// Checks to see if this land object contains a point /// @@ -373,12 +373,12 @@ namespace OpenSim.Region.CoreModules.World.Land if(simMax > m_scene.RegionInfo.ObjectCapacity) simMax = m_scene.RegionInfo.ObjectCapacity; - //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", + //m_log.DebugFormat("Simwide Area: {0}, Capacity {1}, SimMax {2}, SimWidePrims {3}", // LandData.SimwideArea, m_scene.RegionInfo.ObjectCapacity, simMax, LandData.SimwidePrims); return simMax; } } - + #endregion #region Packet Request Handling @@ -552,7 +552,7 @@ namespace OpenSim.Region.CoreModules.World.Land needOverlay = true; m_scene.LandChannel.UpdateLandObject(LandData.LocalID, newData); - return true; + return true; } return false; } @@ -720,11 +720,11 @@ namespace OpenSim.Region.CoreModules.World.Land if(sp==null || !sp.isNPC) return true; - + INPC npccli = (INPC)sp.ControllingClient; if(npccli== null) return true; - + UUID owner = npccli.Owner; if(owner == UUID.Zero) @@ -898,7 +898,7 @@ namespace OpenSim.Region.CoreModules.World.Land // update use lists flags // rights already checked or we wont be here uint parcelflags = newData.Flags; - + if((flags & (uint)AccessList.Access) != 0) parcelflags |= (uint)ParcelFlags.UseAccessList; if((flags & (uint)AccessList.Ban) != 0) @@ -1024,7 +1024,7 @@ namespace OpenSim.Region.CoreModules.World.Land LandData.AABBMin = new Vector3(tx, ty, 0f); else LandData.AABBMin = new Vector3(tx, ty, (float)m_scene.Heightmap[tx, ty]); - + max_x++; tx = max_x * landUnit; if (tx > regionSizeX) @@ -1042,7 +1042,7 @@ namespace OpenSim.Region.CoreModules.World.Land LandData.AABBMax = new Vector3(tx, ty, 0f); else LandData.AABBMax = new Vector3(tx, ty, (float)m_scene.Heightmap[tx - 1, ty - 1]); - + LandData.Area = tempArea * landUnit * landUnit; } @@ -1073,7 +1073,7 @@ namespace OpenSim.Region.CoreModules.World.Land { return GetSquareLandBitmap(0, 0, (int)m_scene.RegionInfo.RegionSizeX, (int) m_scene.RegionInfo.RegionSizeY, true); } - + public bool[,] GetSquareLandBitmap(int start_x, int start_y, int end_x, int end_y, bool set_value = true) { // Empty bitmap for the whole region @@ -1317,7 +1317,7 @@ namespace OpenSim.Region.CoreModules.World.Land /// out: This is set if the resultant bitmap is now empty /// out: parcel.AABBMin <x,y,0> /// out: parcel.AABBMax <x,y,0> - /// New parcel bitmap + /// New parcel bitmap public bool[,] RemoveFromLandBitmap(bool[,] bitmap_base, bool[,] bitmap_new, out bool isEmptyNow, out Vector3 AABBMin, out Vector3 AABBMax) { // get the size of the incoming bitmaps @@ -1409,7 +1409,7 @@ namespace OpenSim.Region.CoreModules.World.Land // Importing land parcel data from an OAR where the source region is a different size to the dest region requires us // to make a LandBitmap that's not derived from the current region's size. We use the LandData.Bitmap size in bytes // to figure out what the OAR's region dimensions are. (Is there a better way to get the src region x and y from the OAR?) - // This method assumes we always will have square regions + // This method assumes we always will have square regions bitmapLen = LandData.Bitmap.Length; xLen = (int)Math.Abs(Math.Sqrt(bitmapLen * 8)); @@ -1550,9 +1550,9 @@ namespace OpenSim.Region.CoreModules.World.Land lock (primsOverMe) { // m_log.DebugFormat( -// "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", +// "[LAND OBJECT]: Request for SendLandObjectOwners() from {0} with {1} known prims on region", // remote_client.Name, primsOverMe.Count); - + try { foreach (SceneObjectGroup obj in primsOverMe) @@ -1593,7 +1593,7 @@ namespace OpenSim.Region.CoreModules.World.Land public Dictionary GetLandObjectOwners() { Dictionary ownersAndCount = new Dictionary(); - + lock (primsOverMe) { try @@ -1669,7 +1669,7 @@ namespace OpenSim.Region.CoreModules.World.Land { // m_log.DebugFormat( // "[LAND OBJECT]: Request to return objects in {0} from {1}", LandData.Name, remote_client.Name); - + Dictionary> returns = new Dictionary>(); lock (primsOverMe) @@ -1752,7 +1752,7 @@ namespace OpenSim.Region.CoreModules.World.Land public void AddPrimOverMe(SceneObjectGroup obj) { // m_log.DebugFormat("[LAND OBJECT]: Adding scene object {0} {1} over {2}", obj.Name, obj.LocalId, LandData.Name); - + lock (primsOverMe) primsOverMe.Add(obj); } @@ -1760,13 +1760,13 @@ namespace OpenSim.Region.CoreModules.World.Land public void RemovePrimFromOverMe(SceneObjectGroup obj) { // m_log.DebugFormat("[LAND OBJECT]: Removing scene object {0} {1} from over {2}", obj.Name, obj.LocalId, LandData.Name); - + lock (primsOverMe) primsOverMe.Remove(obj); } #endregion - + /// /// Set the media url for this land parcel /// @@ -1777,7 +1777,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_scene.LandChannel.UpdateLandObject(LandData.LocalID, LandData); SendLandUpdateToAvatarsOverMe(); } - + /// /// Set the music url for this land parcel /// @@ -1824,7 +1824,7 @@ namespace OpenSim.Region.CoreModules.World.Land { LandData.ParcelAccessList.Remove(entry); ScenePresence presence; - + if (m_scene.TryGetScenePresence(entry.AgentID, out presence) && (!presence.IsChildAgent)) { ILandObject land = m_scene.LandChannel.GetLandObject(presence.AbsolutePosition.X, presence.AbsolutePosition.Y); diff --git a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs index 771fdd2..857f919 100644 --- a/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs +++ b/OpenSim/Region/CoreModules/World/Land/PrimCountModule.cs @@ -69,11 +69,11 @@ namespace OpenSim.Region.CoreModules.World.Land /// For now, a simple simwide taint to get this up. Later parcel based /// taint to allow recounting a parcel if only ownership has changed /// without recounting the whole sim. - /// + /// /// We start out tainted so that the first get call resets the various prim counts. /// private bool m_Tainted = true; - + private Object m_TaintLock = new Object(); public Type ReplaceableInterface @@ -88,10 +88,10 @@ namespace OpenSim.Region.CoreModules.World.Land public void AddRegion(Scene scene) { m_Scene = scene; - + m_Scene.RegisterModuleInterface(this); - m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; + m_Scene.EventManager.OnObjectAddedToScene += OnParcelPrimCountAdd; m_Scene.EventManager.OnObjectBeingRemovedFromScene += OnObjectBeingRemovedFromScene; m_Scene.EventManager.OnParcelPrimCountTainted += @@ -104,7 +104,7 @@ namespace OpenSim.Region.CoreModules.World.Land } public void RemoveRegion(Scene scene) - { + { } public void Close() @@ -126,7 +126,7 @@ namespace OpenSim.Region.CoreModules.World.Land AddObject(obj); // else // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", +// "[PRIM COUNT MODULE]: Ignoring OnParcelPrimCountAdd() for {0} on {1} since count is tainted", // obj.Name, m_Scene.RegionInfo.RegionName); } } @@ -140,16 +140,16 @@ namespace OpenSim.Region.CoreModules.World.Land RemoveObject(obj); // else // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted", -// obj.Name, m_Scene.RegionInfo.RegionName); +// "[PRIM COUNT MODULE]: Ignoring OnObjectBeingRemovedFromScene() for {0} on {1} since count is tainted", +// obj.Name, m_Scene.RegionInfo.RegionName); } } private void OnParcelPrimCountTainted() { // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName); - +// "[PRIM COUNT MODULE]: OnParcelPrimCountTainted() called on {0}", m_Scene.RegionInfo.RegionName); + lock (m_TaintLock) m_Tainted = true; } @@ -174,33 +174,33 @@ namespace OpenSim.Region.CoreModules.World.Land // NOTE: Call under Taint Lock private void AddObject(SceneObjectGroup obj) - { + { if (obj.IsAttachment) return; if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0)) - return; + return; Vector3 pos = obj.AbsolutePosition; ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y); - + // If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it if (landObject == null) { // m_log.WarnFormat( -// "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}", +// "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}", // obj.Name, pos.X, pos.Y, m_Scene.RegionInfo.RegionName); - + return; } - + LandData landData = landObject.LandData; - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}", -// obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName); - +// "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}", +// obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName); + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", +// "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}", // obj.Name, obj.OwnerID, landData.OwnerID); ParcelCounts parcelCounts; @@ -217,7 +217,7 @@ namespace OpenSim.Region.CoreModules.World.Land if (obj.IsSelected) { - parcelCounts.Selected += partCount; + parcelCounts.Selected += partCount; } else { @@ -244,8 +244,8 @@ namespace OpenSim.Region.CoreModules.World.Land // NOTE: Call under Taint Lock private void RemoveObject(SceneObjectGroup obj) { -// m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID); - +// m_log.DebugFormat("[PRIM COUNT MODULE]: Removing object {0} {1} from prim count", obj.Name, obj.UUID); + // Currently this is being done by tainting the count instead. } @@ -253,7 +253,7 @@ namespace OpenSim.Region.CoreModules.World.Land { // m_log.DebugFormat( // "[PRIM COUNT MODULE]: GetPrimCounts for parcel {0} in {1}", parcelID, m_Scene.RegionInfo.RegionName); - + PrimCounts primCounts; lock (m_PrimCounts) @@ -267,7 +267,7 @@ namespace OpenSim.Region.CoreModules.World.Land return primCounts; } - + /// /// Get the number of prims on the parcel that are owned by the parcel owner. /// @@ -276,7 +276,7 @@ namespace OpenSim.Region.CoreModules.World.Land public int GetOwnerCount(UUID parcelID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) @@ -286,11 +286,11 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_ParcelCounts.TryGetValue(parcelID, out counts)) count = counts.Owner; } - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}", +// "[PRIM COUNT MODULE]: GetOwnerCount for parcel {0} in {1} returning {2}", // parcelID, m_Scene.RegionInfo.RegionName, count); - + return count; } @@ -298,11 +298,11 @@ namespace OpenSim.Region.CoreModules.World.Land /// Get the number of prims on the parcel that have been set to the group that owns the parcel. /// /// - /// + /// public int GetGroupCount(UUID parcelID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) @@ -312,11 +312,11 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_ParcelCounts.TryGetValue(parcelID, out counts)) count = counts.Group; } - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}", +// "[PRIM COUNT MODULE]: GetGroupCount for parcel {0} in {1} returning {2}", // parcelID, m_Scene.RegionInfo.RegionName, count); - + return count; } @@ -324,11 +324,11 @@ namespace OpenSim.Region.CoreModules.World.Land /// Get the number of prims on the parcel that are not owned by the parcel owner or set to the parcel group. /// /// - /// + /// public int GetOthersCount(UUID parcelID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) @@ -338,23 +338,23 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_ParcelCounts.TryGetValue(parcelID, out counts)) count = counts.Others; } - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", +// "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", // parcelID, m_Scene.RegionInfo.RegionName, count); - + return count; } - + /// /// Get the number of selected prims. /// /// - /// + /// public int GetSelectedCount(UUID parcelID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) @@ -364,24 +364,24 @@ namespace OpenSim.Region.CoreModules.World.Land if (m_ParcelCounts.TryGetValue(parcelID, out counts)) count = counts.Selected; } - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", +// "[PRIM COUNT MODULE]: GetSelectedCount for parcel {0} in {1} returning {2}", // parcelID, m_Scene.RegionInfo.RegionName, count); - + return count; } - + /// /// Get the total count of owner, group and others prims on the parcel. - /// FIXME: Need to do selected prims once this is reimplemented. + /// FIXME: Need to do selected prims once this is reimplemented. /// /// /// public int GetTotalCount(UUID parcelID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) @@ -396,28 +396,28 @@ namespace OpenSim.Region.CoreModules.World.Land count += counts.Selected; } } - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}", +// "[PRIM COUNT MODULE]: GetTotalCount for parcel {0} in {1} returning {2}", // parcelID, m_Scene.RegionInfo.RegionName, count); - - return count; + + return count; } /// /// Get the number of prims that are in the entire simulator for the owner of this parcel. /// /// - /// + /// public int GetSimulatorCount(UUID parcelID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) Recount(); - + UUID owner; if (m_OwnerMap.TryGetValue(parcelID, out owner)) { @@ -426,11 +426,11 @@ namespace OpenSim.Region.CoreModules.World.Land count = val; } } - + // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", +// "[PRIM COUNT MODULE]: GetOthersCount for parcel {0} in {1} returning {2}", // parcelID, m_Scene.RegionInfo.RegionName, count); - + return count; } @@ -439,11 +439,11 @@ namespace OpenSim.Region.CoreModules.World.Land /// /// /// - /// + /// public int GetUserCount(UUID parcelID, UUID userID) { int count = 0; - + lock (m_TaintLock) { if (m_Tainted) @@ -459,9 +459,9 @@ namespace OpenSim.Region.CoreModules.World.Land } // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}", +// "[PRIM COUNT MODULE]: GetUserCount for user {0} in parcel {1} in region {2} returning {3}", // userID, parcelID, m_Scene.RegionInfo.RegionName, count); - + return count; } @@ -469,13 +469,13 @@ namespace OpenSim.Region.CoreModules.World.Land private void Recount() { // m_log.DebugFormat("[PRIM COUNT MODULE]: Recounting prims on {0}", m_Scene.RegionInfo.RegionName); - + m_OwnerMap.Clear(); m_SimwideCounts.Clear(); m_ParcelCounts.Clear(); List land = m_Scene.LandChannel.AllParcels(); - + foreach (ILandObject l in land) { LandData landData = l.LandData; @@ -483,7 +483,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_OwnerMap[landData.GlobalID] = landData.OwnerID; m_SimwideCounts[landData.OwnerID] = 0; // m_log.DebugFormat( -// "[PRIM COUNT MODULE]: Initializing parcel count for {0} on {1}", +// "[PRIM COUNT MODULE]: Initializing parcel count for {0} on {1}", // landData.Name, m_Scene.RegionInfo.RegionName); m_ParcelCounts[landData.GlobalID] = new ParcelCounts(); } @@ -499,7 +499,7 @@ namespace OpenSim.Region.CoreModules.World.Land m_PrimCounts.Remove(k); } } - + m_Tainted = false; } } @@ -541,7 +541,7 @@ namespace OpenSim.Region.CoreModules.World.Land return m_Parent.GetOthersCount(m_ParcelID); } } - + public int Selected { get @@ -549,7 +549,7 @@ namespace OpenSim.Region.CoreModules.World.Land return m_Parent.GetSelectedCount(m_ParcelID); } } - + public int Total { get diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs index 4ed67f3..d6a3ded 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/LandManagementModuleTests.cs @@ -45,14 +45,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests UUID userId = TestHelpers.ParseTail(0x1); LandManagementModule lmm = new LandManagementModule(); - Scene scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, lmm); - + Scene scene = new SceneHelpers().SetupScene(); + SceneHelpers.SetupSceneModules(scene, lmm); + ILandObject lo = new LandObject(userId, false, scene); lo.LandData.Name = "lo1"; lo.SetLandBitmap( lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); - lo = lmm.AddLandObject(lo); + lo = lmm.AddLandObject(lo); // TODO: Should add asserts to check that land object was added properly. @@ -67,7 +67,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests { ILandObject loAtCoord = lmm.GetLandObject(0, 0); Assert.That(loAtCoord.LandData.LocalID, Is.EqualTo(lo.LandData.LocalID)); - Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(lo.LandData.GlobalID)); + Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(lo.LandData.GlobalID)); } { @@ -88,8 +88,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests SceneHelpers sh = new SceneHelpers(); LandManagementModule lmm = new LandManagementModule(); - Scene scene = sh.SetupScene(); - SceneHelpers.SetupSceneModules(scene, lmm); + Scene scene = sh.SetupScene(); + SceneHelpers.SetupSceneModules(scene, lmm); scene.loadAllLandObjectsFromStorage(scene.RegionInfo.RegionID); @@ -115,8 +115,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests SceneHelpers sh = new SceneHelpers(); LandManagementModule lmm = new LandManagementModule(); - Scene scene = sh.SetupScene(); - SceneHelpers.SetupSceneModules(scene, lmm); + Scene scene = sh.SetupScene(); + SceneHelpers.SetupSceneModules(scene, lmm); ILandObject originalLo1 = new LandObject(userId, false, scene); originalLo1.LandData.Name = "lo1"; @@ -149,8 +149,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests SceneHelpers sh = new SceneHelpers(); LandManagementModule lmm = new LandManagementModule(); - Scene scene = sh.SetupScene(); - SceneHelpers.SetupSceneModules(scene, lmm); + Scene scene = sh.SetupScene(); + SceneHelpers.SetupSceneModules(scene, lmm); ILandObject originalLo1 = new LandObject(userId, false, scene); originalLo1.LandData.Name = "lo1"; @@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(loAtCoord1.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); Assert.That(loAtCoord1.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); - ILandObject loAtCoord2 + ILandObject loAtCoord2 = lmm.GetLandObject((int)Constants.RegionSize - 1, (((int)Constants.RegionSize / 4) * 3) - 1); Assert.That(loAtCoord2.LandData.Name, Is.EqualTo(originalLo2.LandData.Name)); Assert.That(loAtCoord2.LandData.GlobalID, Is.EqualTo(originalLo2.LandData.GlobalID)); @@ -198,8 +198,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests SceneHelpers sh = new SceneHelpers(); LandManagementModule lmm = new LandManagementModule(); - Scene scene = sh.SetupScene(); - SceneHelpers.SetupSceneModules(scene, lmm); + Scene scene = sh.SetupScene(); + SceneHelpers.SetupSceneModules(scene, lmm); ILandObject originalLo1 = new LandObject(userId, false, scene); originalLo1.LandData.Name = "lo1"; @@ -220,7 +220,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests { ILandObject loAtCoord = lmm.GetLandObject(0, 0); Assert.That(loAtCoord.LandData.Name, Is.EqualTo(originalLo1.LandData.Name)); - Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); + Assert.That(loAtCoord.LandData.GlobalID, Is.EqualTo(originalLo1.LandData.GlobalID)); } { @@ -239,21 +239,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests UUID userId = TestHelpers.ParseTail(0x1); LandManagementModule lmm = new LandManagementModule(); - Scene scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, lmm); - + Scene scene = new SceneHelpers().SetupScene(); + SceneHelpers.SetupSceneModules(scene, lmm); + ILandObject lo = new LandObject(userId, false, scene); lo.LandData.Name = "lo1"; lo.SetLandBitmap( lo.GetSquareLandBitmap(0, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); - lo = lmm.AddLandObject(lo); + lo = lmm.AddLandObject(lo); lmm.Subdivide(0, 0, LandManagementModule.LandUnit, LandManagementModule.LandUnit, userId); { ILandObject loAtCoord = lmm.GetLandObject(0, 0); Assert.That(loAtCoord.LandData.LocalID, Is.Not.EqualTo(lo.LandData.LocalID)); - Assert.That(loAtCoord.LandData.GlobalID, Is.Not.EqualTo(lo.LandData.GlobalID)); + Assert.That(loAtCoord.LandData.GlobalID, Is.Not.EqualTo(lo.LandData.GlobalID)); } { diff --git a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs index 949acb6..0d8ece7 100644 --- a/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Land/Tests/PrimCountModuleTests.cs @@ -43,21 +43,21 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests public class PrimCountModuleTests : OpenSimTestCase { protected UUID m_userId = new UUID("00000000-0000-0000-0000-100000000000"); - protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); - protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); + protected UUID m_groupId = new UUID("00000000-0000-0000-8888-000000000000"); + protected UUID m_otherUserId = new UUID("99999999-9999-9999-9999-999999999999"); protected TestScene m_scene; protected PrimCountModule m_pcm; - + /// /// A parcel that covers the entire sim except for a 1 unit wide strip on the eastern side. /// protected ILandObject m_lo; - + /// /// A parcel that covers just the eastern strip of the sim. /// - protected ILandObject m_lo2; - + protected ILandObject m_lo2; + [SetUp] public override void SetUp() { @@ -65,24 +65,24 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests m_pcm = new PrimCountModule(); LandManagementModule lmm = new LandManagementModule(); - m_scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); - + m_scene = new SceneHelpers().SetupScene(); + SceneHelpers.SetupSceneModules(m_scene, lmm, m_pcm); + int xParcelDivider = (int)Constants.RegionSize - 1; - + ILandObject lo = new LandObject(m_userId, false, m_scene); lo.LandData.Name = "m_lo"; lo.SetLandBitmap( lo.GetSquareLandBitmap(0, 0, xParcelDivider, (int)Constants.RegionSize)); - m_lo = lmm.AddLandObject(lo); - + m_lo = lmm.AddLandObject(lo); + ILandObject lo2 = new LandObject(m_userId, false, m_scene); lo2.SetLandBitmap( lo2.GetSquareLandBitmap(xParcelDivider, 0, (int)Constants.RegionSize, (int)Constants.RegionSize)); lo2.LandData.Name = "m_lo2"; m_lo2 = lmm.AddLandObject(lo2); - } - + } + /// /// Test that counts before we do anything are correct. /// @@ -90,7 +90,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests public void TestInitialCounts() { IPrimCounts pc = m_lo.PrimCounts; - + Assert.That(pc.Owner, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -98,9 +98,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(0)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(0)); - } - + Assert.That(pc.Simulator, Is.EqualTo(0)); + } + /// /// Test count after a parcel owner owned object is added. /// @@ -108,13 +108,13 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests public void TestAddOwnerObject() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - IPrimCounts pc = m_lo.PrimCounts; - - SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); +// log4net.Config.XmlConfigurator.Configure(); + + IPrimCounts pc = m_lo.PrimCounts; + + SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); m_scene.AddNewSceneObject(sog, false); - + Assert.That(pc.Owner, Is.EqualTo(3)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -122,12 +122,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(3)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(3)); - + Assert.That(pc.Simulator, Is.EqualTo(3)); + // Add a second object and retest - SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); - m_scene.AddNewSceneObject(sog2, false); - + SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); + m_scene.AddNewSceneObject(sog2, false); + Assert.That(pc.Owner, Is.EqualTo(5)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -135,9 +135,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(5)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(5)); + Assert.That(pc.Simulator, Is.EqualTo(5)); } - + /// /// Test count after a parcel owner owned copied object is added. /// @@ -145,14 +145,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests public void TestCopyOwnerObject() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - +// log4net.Config.XmlConfigurator.Configure(); + IPrimCounts pc = m_lo.PrimCounts; - - SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); + + SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); m_scene.AddNewSceneObject(sog, false); - m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); - + m_scene.SceneGraph.DuplicateObject(sog.LocalId, Vector3.Zero, 0, m_userId, UUID.Zero, Quaternion.Identity); + Assert.That(pc.Owner, Is.EqualTo(6)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -160,9 +160,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(6)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(6)); - } - + Assert.That(pc.Simulator, Is.EqualTo(6)); + } + /// /// Test that parcel counts update correctly when an object is moved between parcels, where that movement /// is not done directly by the user/ @@ -171,18 +171,18 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests public void TestMoveOwnerObject() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); +// log4net.Config.XmlConfigurator.Configure(); + + SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); m_scene.AddNewSceneObject(sog, false); - SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); - m_scene.AddNewSceneObject(sog2, false); - - // Move the first scene object to the eastern strip parcel + SceneObjectGroup sog2 = SceneHelpers.CreateSceneObject(2, m_userId, "b", 0x10); + m_scene.AddNewSceneObject(sog2, false); + + // Move the first scene object to the eastern strip parcel sog.AbsolutePosition = new Vector3(254, 2, 2); - - IPrimCounts pclo1 = m_lo.PrimCounts; - + + IPrimCounts pclo1 = m_lo.PrimCounts; + Assert.That(pclo1.Owner, Is.EqualTo(2)); Assert.That(pclo1.Group, Is.EqualTo(0)); Assert.That(pclo1.Others, Is.EqualTo(0)); @@ -190,10 +190,10 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pclo1.Selected, Is.EqualTo(0)); Assert.That(pclo1.Users[m_userId], Is.EqualTo(2)); Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pclo1.Simulator, Is.EqualTo(5)); - - IPrimCounts pclo2 = m_lo2.PrimCounts; - + Assert.That(pclo1.Simulator, Is.EqualTo(5)); + + IPrimCounts pclo2 = m_lo2.PrimCounts; + Assert.That(pclo2.Owner, Is.EqualTo(3)); Assert.That(pclo2.Group, Is.EqualTo(0)); Assert.That(pclo2.Others, Is.EqualTo(0)); @@ -201,11 +201,11 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pclo2.Selected, Is.EqualTo(0)); Assert.That(pclo2.Users[m_userId], Is.EqualTo(3)); Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pclo2.Simulator, Is.EqualTo(5)); - + Assert.That(pclo2.Simulator, Is.EqualTo(5)); + // Now move it back again - sog.AbsolutePosition = new Vector3(2, 2, 2); - + sog.AbsolutePosition = new Vector3(2, 2, 2); + Assert.That(pclo1.Owner, Is.EqualTo(5)); Assert.That(pclo1.Group, Is.EqualTo(0)); Assert.That(pclo1.Others, Is.EqualTo(0)); @@ -213,8 +213,8 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pclo1.Selected, Is.EqualTo(0)); Assert.That(pclo1.Users[m_userId], Is.EqualTo(5)); Assert.That(pclo1.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pclo1.Simulator, Is.EqualTo(5)); - + Assert.That(pclo1.Simulator, Is.EqualTo(5)); + Assert.That(pclo2.Owner, Is.EqualTo(0)); Assert.That(pclo2.Group, Is.EqualTo(0)); Assert.That(pclo2.Others, Is.EqualTo(0)); @@ -222,9 +222,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pclo2.Selected, Is.EqualTo(0)); Assert.That(pclo2.Users[m_userId], Is.EqualTo(0)); Assert.That(pclo2.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pclo2.Simulator, Is.EqualTo(5)); + Assert.That(pclo2.Simulator, Is.EqualTo(5)); } - + /// /// Test count after a parcel owner owned object is removed. /// @@ -233,14 +233,14 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + IPrimCounts pc = m_lo.PrimCounts; - + m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1), false); SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); - m_scene.AddNewSceneObject(sogToDelete, false); + m_scene.AddNewSceneObject(sogToDelete, false); m_scene.DeleteSceneObject(sogToDelete, false); - + Assert.That(pc.Owner, Is.EqualTo(1)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -248,37 +248,37 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(1)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(1)); - } - + Assert.That(pc.Simulator, Is.EqualTo(1)); + } + [Test] public void TestAddGroupObject() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - +// log4net.Config.XmlConfigurator.Configure(); + m_lo.DeedToGroup(m_groupId); - - IPrimCounts pc = m_lo.PrimCounts; - - SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); + + IPrimCounts pc = m_lo.PrimCounts; + + SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); sog.GroupID = m_groupId; m_scene.AddNewSceneObject(sog, false); - + Assert.That(pc.Owner, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(3)); Assert.That(pc.Others, Is.EqualTo(0)); Assert.That(pc.Total, Is.EqualTo(3)); Assert.That(pc.Selected, Is.EqualTo(0)); - + // Is this desired behaviour? Not totally sure. Assert.That(pc.Users[m_userId], Is.EqualTo(0)); Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); - - Assert.That(pc.Simulator, Is.EqualTo(3)); + + Assert.That(pc.Simulator, Is.EqualTo(3)); } - + /// /// Test count after a parcel owner owned object is removed. /// @@ -287,19 +287,19 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + m_lo.DeedToGroup(m_groupId); - + IPrimCounts pc = m_lo.PrimCounts; - + SceneObjectGroup sogToKeep = SceneHelpers.CreateSceneObject(1, m_userId, "a", 0x1); - sogToKeep.GroupID = m_groupId; + sogToKeep.GroupID = m_groupId; m_scene.AddNewSceneObject(sogToKeep, false); - + SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_userId, "b", 0x10); - m_scene.AddNewSceneObject(sogToDelete, false); + m_scene.AddNewSceneObject(sogToDelete, false); m_scene.DeleteSceneObject(sogToDelete, false); - + Assert.That(pc.Owner, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(1)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -308,20 +308,20 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Users[m_userId], Is.EqualTo(1)); Assert.That(pc.Users[m_groupId], Is.EqualTo(0)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(1)); - } - - [Test] + Assert.That(pc.Simulator, Is.EqualTo(1)); + } + + [Test] public void TestAddOthersObject() { TestHelpers.InMethod(); -// log4net.Config.XmlConfigurator.Configure(); - - IPrimCounts pc = m_lo.PrimCounts; - - SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); +// log4net.Config.XmlConfigurator.Configure(); + + IPrimCounts pc = m_lo.PrimCounts; + + SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_otherUserId, "a", 0x01); m_scene.AddNewSceneObject(sog, false); - + Assert.That(pc.Owner, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(3)); @@ -329,22 +329,22 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(0)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(3)); - Assert.That(pc.Simulator, Is.EqualTo(3)); + Assert.That(pc.Simulator, Is.EqualTo(3)); } - + [Test] public void TestRemoveOthersObject() { TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + IPrimCounts pc = m_lo.PrimCounts; - + m_scene.AddNewSceneObject(SceneHelpers.CreateSceneObject(1, m_otherUserId, "a", 0x1), false); SceneObjectGroup sogToDelete = SceneHelpers.CreateSceneObject(3, m_otherUserId, "b", 0x10); - m_scene.AddNewSceneObject(sogToDelete, false); + m_scene.AddNewSceneObject(sogToDelete, false); m_scene.DeleteSceneObject(sogToDelete, false); - + Assert.That(pc.Owner, Is.EqualTo(0)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(1)); @@ -352,9 +352,9 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(0)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(1)); - Assert.That(pc.Simulator, Is.EqualTo(1)); - } - + Assert.That(pc.Simulator, Is.EqualTo(1)); + } + /// /// Test the count is correct after is has been tainted. /// @@ -363,12 +363,12 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests { TestHelpers.InMethod(); IPrimCounts pc = m_lo.PrimCounts; - - SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); - m_scene.AddNewSceneObject(sog, false); - + + SceneObjectGroup sog = SceneHelpers.CreateSceneObject(3, m_userId, "a", 0x01); + m_scene.AddNewSceneObject(sog, false); + m_pcm.TaintPrimCount(); - + Assert.That(pc.Owner, Is.EqualTo(3)); Assert.That(pc.Group, Is.EqualTo(0)); Assert.That(pc.Others, Is.EqualTo(0)); @@ -376,7 +376,7 @@ namespace OpenSim.Region.CoreModules.World.Land.Tests Assert.That(pc.Selected, Is.EqualTo(0)); Assert.That(pc.Users[m_userId], Is.EqualTo(3)); Assert.That(pc.Users[m_otherUserId], Is.EqualTo(0)); - Assert.That(pc.Simulator, Is.EqualTo(3)); + Assert.That(pc.Simulator, Is.EqualTo(3)); } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs index 1f2b7c4..b927cfa 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/MapImageModule.cs @@ -82,11 +82,11 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap string[] configSections = new string[] { "Map", "Startup" }; - drawPrimVolume + drawPrimVolume = Util.GetConfigVarFromSections(m_config, "DrawPrimOnMapTile", configSections, drawPrimVolume); - textureTerrain + textureTerrain = Util.GetConfigVarFromSections(m_config, "TextureOnMapTile", configSections, textureTerrain); - generateMaptiles + generateMaptiles = Util.GetConfigVarFromSections(m_config, "GenerateMaptiles", configSections, generateMaptiles); if (generateMaptiles) @@ -126,15 +126,15 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap catch (Exception) { m_log.ErrorFormat( - "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", + "[MAPTILE]: Failed to load Static map image texture file: {0} for {1}", m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); //mapbmp = new Bitmap((int)m_scene.Heightmap.Width, (int)m_scene.Heightmap.Height, System.Drawing.Imaging.PixelFormat.Format24bppRgb); mapbmp = null; } - if (mapbmp != null) + if (mapbmp != null) m_log.DebugFormat( - "[MAPTILE]: Static map image texture file {0} found for {1}", + "[MAPTILE]: Static map image texture file {0} found for {1}", m_scene.RegionInfo.MaptileStaticFile, m_scene.Name); } } @@ -308,7 +308,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap List z_localIDs = new List(); Dictionary z_sort = new Dictionary(); - try + try { lock (objs) { diff --git a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs index 0ec2053..4b3ee18 100644 --- a/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs +++ b/OpenSim/Region/CoreModules/World/LegacyMap/TexturedMapTileRenderer.cs @@ -180,7 +180,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap ManagedImage managedImage; Image image; - + try { if (OpenJPEG.DecodeToImage(asset.Data, out managedImage, out image)) @@ -201,7 +201,7 @@ namespace OpenSim.Region.CoreModules.World.LegacyMap m_log.ErrorFormat("{0} OpenJpeg was unable to encode this. Asset Data is empty for {1}", LogHeader, id); } return null; - + } // Compute the average color of a texture. diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index 46b0470..1070ae6 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -56,7 +56,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap public class MoapModule : INonSharedRegionModule, IMoapModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + public string Name { get { return "MoapModule"; } } public Type ReplaceableInterface { get { return null; } } @@ -64,33 +64,33 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap /// Is this module enabled? /// protected bool m_isEnabled = true; - + /// /// The scene to which this module is attached /// protected Scene m_scene; - + /// /// Track the ObjectMedia capabilities given to users keyed by path /// protected Dictionary m_omCapUsers = new Dictionary(); - + /// /// Track the ObjectMedia capabilities given to users keyed by agent. Lock m_omCapUsers to manipulate. /// protected Dictionary m_omCapUrls = new Dictionary(); - + /// /// Track the ObjectMediaUpdate capabilities given to users keyed by path /// protected Dictionary m_omuCapUsers = new Dictionary(); - + /// /// Track the ObjectMediaUpdate capabilities given to users keyed by agent. Lock m_omuCapUsers to manipulate /// protected Dictionary m_omuCapUrls = new Dictionary(); - - public void Initialise(IConfigSource configSource) + + public void Initialise(IConfigSource configSource) { IConfig config = configSource.Configs["MediaOnAPrim"]; @@ -100,63 +100,63 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap // m_log.Debug("[MOAP]: Initialised module.")l } - public void AddRegion(Scene scene) - { + public void AddRegion(Scene scene) + { if (!m_isEnabled) return; - + m_scene = scene; m_scene.RegisterModuleInterface(this); } public void RemoveRegion(Scene scene) {} - public void RegionLoaded(Scene scene) + public void RegionLoaded(Scene scene) { if (!m_isEnabled) return; - + m_scene.EventManager.OnRegisterCaps += OnRegisterCaps; m_scene.EventManager.OnDeregisterCaps += OnDeregisterCaps; m_scene.EventManager.OnSceneObjectPartCopy += OnSceneObjectPartCopy; } - - public void Close() + + public void Close() { if (!m_isEnabled) return; - + m_scene.EventManager.OnRegisterCaps -= OnRegisterCaps; m_scene.EventManager.OnDeregisterCaps -= OnDeregisterCaps; m_scene.EventManager.OnSceneObjectPartCopy -= OnSceneObjectPartCopy; } - + public void OnRegisterCaps(UUID agentID, Caps caps) { // m_log.DebugFormat( // "[MOAP]: Registering ObjectMedia and ObjectMediaNavigate capabilities for agent {0}", agentID); - + string omCapUrl = "/CAPS/" + UUID.Random(); - + lock (m_omCapUsers) { m_omCapUsers[omCapUrl] = agentID; m_omCapUrls[agentID] = omCapUrl; - + // Even though we're registering for POST we're going to get GETS and UPDATES too caps.RegisterHandler( "ObjectMedia", new RestStreamHandler( "POST", omCapUrl, HandleObjectMediaMessage, "ObjectMedia", agentID.ToString())); } - + string omuCapUrl = "/CAPS/" + UUID.Random(); - + lock (m_omuCapUsers) { m_omuCapUsers[omuCapUrl] = agentID; m_omuCapUrls[agentID] = omuCapUrl; - + // Even though we're registering for POST we're going to get GETS and UPDATES too caps.RegisterHandler( "ObjectMediaNavigate", @@ -164,7 +164,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap "POST", omuCapUrl, HandleObjectMediaNavigateMessage, "ObjectMediaNavigate", agentID.ToString())); } } - + public void OnDeregisterCaps(UUID agentID, Caps caps) { lock (m_omCapUsers) @@ -173,7 +173,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap m_omCapUrls.Remove(agentID); m_omCapUsers.Remove(path); } - + lock (m_omuCapUsers) { string path = m_omuCapUrls[agentID]; @@ -181,7 +181,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap m_omuCapUsers.Remove(path); } } - + protected void OnSceneObjectPartCopy(SceneObjectPart copy, SceneObjectPart original, bool userExposed) { if (original.Shape.Media != null) @@ -197,19 +197,19 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap dupeMedia.Add(null); } } - + copy.Shape.Media = dupeMedia; } } - + public MediaEntry GetMediaEntry(SceneObjectPart part, int face) { MediaEntry me = null; - + CheckFaceParam(part, face); - + List media = part.Shape.Media; - + if (null == media) { me = null; @@ -218,17 +218,17 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap { lock (media) me = media[face]; - + // TODO: Really need a proper copy constructor down in libopenmetaverse if (me != null) me = MediaEntry.FromOSD(me.GetOSD()); } - + // m_log.DebugFormat("[MOAP]: GetMediaEntry for {0} face {1} found {2}", part.Name, face, me); - + return me; } - + /// /// Set the media entry on the face of the given part. /// @@ -238,28 +238,28 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap public void SetMediaEntry(SceneObjectPart part, int face, MediaEntry me) { // m_log.DebugFormat("[MOAP]: SetMediaEntry for {0}, face {1}", part.Name, face); - + CheckFaceParam(part, face); - + if (null == part.Shape.Media) { if (me == null) return; - else + else part.Shape.Media = new PrimitiveBaseShape.MediaList(new MediaEntry[part.GetNumberOfSides()]); } lock (part.Shape.Media) - part.Shape.Media[face] = me; - + part.Shape.Media[face] = me; + UpdateMediaUrl(part, UUID.Zero); - + SetPartMediaFlags(part, face, me != null); - + part.ScheduleFullUpdate(); part.TriggerScriptChangedEvent(Changed.MEDIA); } - + /// /// Clear the media entry from the face of the given part. /// @@ -267,9 +267,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap /// public void ClearMediaEntry(SceneObjectPart part, int face) { - SetMediaEntry(part, face, null); + SetMediaEntry(part, face, null); } - + /// /// Set the media flags on the texture face of the given part. /// @@ -284,9 +284,9 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap Primitive.TextureEntry te = part.Shape.Textures; Primitive.TextureEntryFace teFace = te.CreateFace((uint)face); teFace.MediaFlags = flag; - part.Shape.Textures = te; + part.Shape.Textures = te; } - + /// /// Sets or gets per face media textures. /// @@ -300,11 +300,11 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // m_log.DebugFormat("[MOAP]: Got ObjectMedia path [{0}], raw request [{1}]", path, request); - + OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); ObjectMediaMessage omm = new ObjectMediaMessage(); omm.Deserialize(osd); - + if (omm.Request is ObjectMediaRequest) return HandleObjectMediaRequest(omm.Request as ObjectMediaRequest); else if (omm.Request is ObjectMediaUpdate) @@ -312,10 +312,10 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap throw new Exception( string.Format( - "[MOAP]: ObjectMediaMessage has unrecognized ObjectMediaBlock of {0}", + "[MOAP]: ObjectMediaMessage has unrecognized ObjectMediaBlock of {0}", omm.Request.GetType())); } - + /// /// Handle a fetch request for media textures /// @@ -324,36 +324,36 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap protected string HandleObjectMediaRequest(ObjectMediaRequest omr) { UUID primId = omr.PrimID; - + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); - + if (null == part) { m_log.WarnFormat( - "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", + "[MOAP]: Received a GET ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", primId, m_scene.RegionInfo.RegionName); return string.Empty; } - + if (null == part.Shape.Media) return string.Empty; - + ObjectMediaResponse resp = new ObjectMediaResponse(); - + resp.PrimID = primId; - + lock (part.Shape.Media) resp.FaceMedia = part.Shape.Media.ToArray(); - + resp.Version = part.MediaUrl; - + string rawResp = OSDParser.SerializeLLSDXmlString(resp.Serialize()); - + // m_log.DebugFormat("[MOAP]: Got HandleObjectMediaRequestGet raw response is [{0}]", rawResp); - + return rawResp; } - + /// /// Handle an update of media textures. /// @@ -363,46 +363,46 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap protected string HandleObjectMediaUpdate(string path, ObjectMediaUpdate omu) { UUID primId = omu.PrimID; - + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); - + if (null == part) { m_log.WarnFormat( - "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", + "[MOAP]: Received an UPDATE ObjectMediaRequest for prim {0} but this doesn't exist in region {1}", primId, m_scene.RegionInfo.RegionName); return string.Empty; } - + // m_log.DebugFormat("[MOAP]: Received {0} media entries for prim {1}", omu.FaceMedia.Length, primId); -// +// // for (int i = 0; i < omu.FaceMedia.Length; i++) // { // MediaEntry me = omu.FaceMedia[i]; // string v = (null == me ? "null": OSDParser.SerializeLLSDXmlString(me.GetOSD())); // m_log.DebugFormat("[MOAP]: Face {0} [{1}]", i, v); // } - + if (omu.FaceMedia.Length > part.GetNumberOfSides()) { m_log.WarnFormat( - "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", + "[MOAP]: Received {0} media entries from client for prim {1} {2} but this prim has only {3} faces. Dropping request.", omu.FaceMedia.Length, part.Name, part.UUID, part.GetNumberOfSides()); return string.Empty; } - + UUID agentId = default(UUID); - + lock (m_omCapUsers) - agentId = m_omCapUsers[path]; - + agentId = m_omCapUsers[path]; + List media = part.Shape.Media; - + if (null == media) { // m_log.DebugFormat("[MOAP]: Setting all new media list for {0}", part.Name); part.Shape.Media = new PrimitiveBaseShape.MediaList(omu.FaceMedia); - + for (int i = 0; i < omu.FaceMedia.Length; i++) { if (omu.FaceMedia[i] != null) @@ -412,7 +412,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap // directly. SetPartMediaFlags(part, i, true); // m_log.DebugFormat( -// "[MOAP]: Media flags for face {0} is {1}", +// "[MOAP]: Media flags for face {0} is {1}", // i, part.Shape.Textures.FaceTextures[i].MediaFlags); } } @@ -420,15 +420,15 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap else { // m_log.DebugFormat("[MOAP]: Setting existing media list for {0}", part.Name); - - // We need to go through the media textures one at a time to make sure that we have permission + + // We need to go through the media textures one at a time to make sure that we have permission // to change them - + // FIXME: Race condition here since some other texture entry manipulator may overwrite/get // overwritten. Unfortunately, PrimitiveBaseShape does not allow us to change texture entry // directly. Primitive.TextureEntry te = part.Shape.Textures; - + lock (media) { for (int i = 0; i < media.Count; i++) @@ -436,38 +436,38 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap if (m_scene.Permissions.CanControlPrimMedia(agentId, part.UUID, i)) { media[i] = omu.FaceMedia[i]; - + // When a face is cleared this is done by setting the MediaFlags in the TextureEntry via a normal // texture update, so we don't need to worry about clearing MediaFlags here. if (null == media[i]) continue; - + SetPartMediaFlags(part, i, true); - + // m_log.DebugFormat( - // "[MOAP]: Media flags for face {0} is {1}", + // "[MOAP]: Media flags for face {0} is {1}", // i, face.MediaFlags); // m_log.DebugFormat("[MOAP]: Set media entry for face {0} on {1}", i, part.Name); } } } - + part.Shape.Textures = te; - + // for (int i2 = 0; i2 < part.Shape.Textures.FaceTextures.Length; i2++) // m_log.DebugFormat("[MOAP]: FaceTexture[{0}] is {1}", i2, part.Shape.Textures.FaceTextures[i2]); } - + UpdateMediaUrl(part, agentId); - + // Arguably, we could avoid sending a full update to the avatar that just changed the texture. part.ScheduleFullUpdate(); - + part.TriggerScriptChangedEvent(Changed.MEDIA); - + return string.Empty; } - + /// /// Received from the viewer if a user has changed the url of a media texture. /// @@ -481,71 +481,71 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap string request, string path, string param, IOSHttpRequest httpRequest, IOSHttpResponse httpResponse) { // m_log.DebugFormat("[MOAP]: Got ObjectMediaNavigate request [{0}]", request); - + OSDMap osd = (OSDMap)OSDParser.DeserializeLLSDXml(request); ObjectMediaNavigateMessage omn = new ObjectMediaNavigateMessage(); omn.Deserialize(osd); - + UUID primId = omn.PrimID; - + SceneObjectPart part = m_scene.GetSceneObjectPart(primId); - + if (null == part) { m_log.WarnFormat( - "[MOAP]: Received an ObjectMediaNavigateMessage for prim {0} but this doesn't exist in region {1}", + "[MOAP]: Received an ObjectMediaNavigateMessage for prim {0} but this doesn't exist in region {1}", primId, m_scene.RegionInfo.RegionName); return string.Empty; } - + UUID agentId = default(UUID); - + lock (m_omuCapUsers) agentId = m_omuCapUsers[path]; - + if (!m_scene.Permissions.CanInteractWithPrimMedia(agentId, part.UUID, omn.Face)) return string.Empty; - + // m_log.DebugFormat( -// "[MOAP]: Received request to update media entry for face {0} on prim {1} {2} to {3}", +// "[MOAP]: Received request to update media entry for face {0} on prim {1} {2} to {3}", // omn.Face, part.Name, part.UUID, omn.URL); - + // If media has never been set for this prim, then just return. if (null == part.Shape.Media) return string.Empty; - + MediaEntry me = null; - + lock (part.Shape.Media) me = part.Shape.Media[omn.Face]; - + // Do the same if media has not been set up for a specific face if (null == me) return string.Empty; - + if (me.EnableWhiteList) { if (!CheckUrlAgainstWhitelist(omn.URL, me.WhiteList)) { // m_log.DebugFormat( -// "[MOAP]: Blocking change of face {0} on prim {1} {2} to {3} since it's not on the enabled whitelist", +// "[MOAP]: Blocking change of face {0} on prim {1} {2} to {3} since it's not on the enabled whitelist", // omn.Face, part.Name, part.UUID, omn.URL); - + return string.Empty; } } - + me.CurrentURL = omn.URL; - + UpdateMediaUrl(part, agentId); - + part.ScheduleFullUpdate(); - + part.TriggerScriptChangedEvent(Changed.MEDIA); - + return OSDParser.SerializeLLSDXmlString(new OSD()); } - + /// /// Check that the face number is valid for the given prim. /// @@ -555,13 +555,13 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap { if (face < 0) throw new ArgumentException("Face cannot be less than zero"); - + int maxFaces = part.GetNumberOfSides() - 1; if (face > maxFaces) throw new ArgumentException( string.Format("Face argument was {0} but max is {1}", face, maxFaces)); } - + /// /// Update the media url of the given part /// @@ -583,10 +583,10 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap int version = int.Parse(rawVersion); part.MediaUrl = string.Format("x-mv:{0:D10}/{1}", ++version, updateId); } - + // m_log.DebugFormat("[MOAP]: Storing media url [{0}] in prim {1} {2}", part.MediaUrl, part.Name, part.UUID); } - + /// /// Check the given url against the given whitelist. /// @@ -599,22 +599,22 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap return false; Uri url = new Uri(rawUrl); - + foreach (string origWlUrl in whitelist) { string wlUrl = origWlUrl; - + // Deal with a line-ending wildcard if (wlUrl.EndsWith("*")) wlUrl = wlUrl.Remove(wlUrl.Length - 1); - + // m_log.DebugFormat("[MOAP]: Checking whitelist URL pattern {0}", origWlUrl); - + // Handle a line starting wildcard slightly differently since this can only match the domain, not the path if (wlUrl.StartsWith("*")) { wlUrl = wlUrl.Substring(1); - + if (url.Host.Contains(wlUrl)) { // m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); @@ -624,7 +624,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap else { string urlToMatch = url.Authority + url.AbsolutePath; - + if (urlToMatch.StartsWith(wlUrl)) { // m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", origWlUrl, rawUrl); @@ -632,7 +632,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap } } } - + return false; } } diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs index ee57aed..7080705 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/Tests/MoapTests.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests { protected TestScene m_scene; protected MoapModule m_module; - + [SetUp] public override void SetUp() { @@ -55,45 +55,45 @@ namespace OpenSim.Region.CoreModules.World.Media.Moap.Tests m_module = new MoapModule(); m_scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(m_scene, m_module); - } - + SceneHelpers.SetupSceneModules(m_scene, m_module); + } + [Test] public void TestClearMediaUrl() { - TestHelpers.InMethod(); + TestHelpers.InMethod(); // log4net.Config.XmlConfigurator.Configure(); - + SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; - MediaEntry me = new MediaEntry(); - + MediaEntry me = new MediaEntry(); + m_module.SetMediaEntry(part, 1, me); m_module.ClearMediaEntry(part, 1); - + Assert.That(part.Shape.Media[1], Is.EqualTo(null)); - + // Although we've cleared one face, other faces may still be present. So we need to check for an // update media url version Assert.That(part.MediaUrl, Is.EqualTo("x-mv:0000000001/" + UUID.Zero)); - + // By changing media flag to false, the face texture once again becomes identical to the DefaultTexture. // Therefore, when libOMV reserializes it, it disappears and we are left with no face texture in this slot. // Not at all confusing, eh? Assert.That(part.Shape.Textures.FaceTextures[1], Is.Null); } - + [Test] public void TestSetMediaUrl() { TestHelpers.InMethod(); - - string homeUrl = "opensimulator.org"; - + + string homeUrl = "opensimulator.org"; + SceneObjectPart part = SceneHelpers.AddSceneObject(m_scene).RootPart; - MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; - + MediaEntry me = new MediaEntry() { HomeURL = homeUrl }; + m_module.SetMediaEntry(part, 1, me); - + Assert.That(part.Shape.Media[1].HomeURL, Is.EqualTo(homeUrl)); Assert.That(part.MediaUrl, Is.EqualTo("x-mv:0000000000/" + UUID.Zero)); Assert.That(part.Shape.Textures.FaceTextures[1].MediaFlags, Is.True); diff --git a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs index 42141e4..b7f01be 100644 --- a/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/BuySell/BuySellModule.cs @@ -49,34 +49,34 @@ namespace OpenSim.Region.CoreModules.World.Objects.BuySell protected Scene m_scene = null; protected IDialogModule m_dialogModule; - + public string Name { get { return "Object BuySell Module"; } } public Type ReplaceableInterface { get { return null; } } public void Initialise(IConfigSource source) {} - + public void AddRegion(Scene scene) { m_scene = scene; m_scene.RegisterModuleInterface(this); m_scene.EventManager.OnNewClient += SubscribeToClientEvents; } - - public void RemoveRegion(Scene scene) + + public void RemoveRegion(Scene scene) { m_scene.EventManager.OnNewClient -= SubscribeToClientEvents; } - - public void RegionLoaded(Scene scene) + + public void RegionLoaded(Scene scene) { m_dialogModule = scene.RequestModuleInterface(); } - - public void Close() + + public void Close() { RemoveRegion(m_scene); } - + public void SubscribeToClientEvents(IClientAPI client) { client.OnObjectSaleInfo += ObjectSaleInfo; diff --git a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs index e53ab95..79c4713 100644 --- a/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Objects/Commands/ObjectCommandsModule.cs @@ -53,30 +53,30 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "ObjectCommandsModule")] public class ObjectCommandsModule : INonSharedRegionModule { -// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); +// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); private Scene m_scene; private ICommandConsole m_console; public string Name { get { return "Object Commands Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[OBJECT COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); @@ -539,13 +539,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (!ConsoleUtil.CheckFileDoesNotExist(m_console, fileName)) return; - + using (XmlTextWriter xtw = new XmlTextWriter(fileName, Encoding.UTF8)) { xtw.Formatting = Formatting.Indented; SceneObjectSerializer.ToOriginalXmlFormat(so, xtw, true); } - + m_console.OutputFormat("Object dumped to file {0}", fileName); } @@ -625,7 +625,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands cdl.AddRow("FlexiSoftness", s.FlexiSoftness); cdl.AddRow("HollowShape", s.HollowShape); cdl.AddRow( - "LightColor", + "LightColor", string.Format("<{0},{1},{2},{3}>", s.LightColorR, s.LightColorB, s.LightColorG, s.LightColorA)); cdl.AddRow("LightCutoff", s.LightCutoff); cdl.AddRow("LightEntry", s.LightEntry); @@ -659,7 +659,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands cdl.AddRow("Rotation (World)", sop.GetWorldRotation()); cdl.AddRow("Scale", s.Scale); cdl.AddRow( - "SculptData", + "SculptData", string.Format("{0} bytes", s.SculptData != null ? s.SculptData.Length.ToString() : "n/a")); cdl.AddRow("SculptEntry", s.SculptEntry); cdl.AddRow("SculptTexture", s.SculptTexture); @@ -668,7 +668,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands // TODO, need to display more information about textures but in a compact format // to stop output becoming huge. - for (int i = 0; i < sop.GetNumberOfSides(); i++) + for (int i = 0; i < sop.GetNumberOfSides(); i++) { Primitive.TextureEntryFace teFace = s.Textures.FaceTextures[i]; @@ -765,12 +765,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (g.OwnerID == match && !g.IsAttachment) deletes.Add(g); }); - + // if (deletes.Count == 0) // m_console.OutputFormat("No objects were found with owner {0}", match); - + break; - + case "creator": if (!UUID.TryParse(o, out match)) return; @@ -782,12 +782,12 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (g.RootPart.CreatorID == match && !g.IsAttachment) deletes.Add(g); }); - + // if (deletes.Count == 0) // m_console.OutputFormat("No objects were found with creator {0}", match); - + break; - + case "id": UUID uuid; uint localId; @@ -808,13 +808,13 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands // if (deletes.Count == 0) // m_console.OutputFormat("No objects were found with uuid {0}", match); - + break; - + case "name": deletes = GetDeleteCandidatesByName(module, cmd); break; - + case "outside": deletes = new List(); @@ -822,7 +822,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands { SceneObjectPart rootPart = g.RootPart; bool delete = false; - + if (rootPart.GroupPosition.Z < 0.0 || rootPart.GroupPosition.Z > 10000.0) { delete = true; @@ -831,18 +831,18 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands { ILandObject parcel = m_scene.LandChannel.GetLandObject(rootPart.GroupPosition.X, rootPart.GroupPosition.Y); - + if (parcel == null || parcel.LandData.Name == "NO LAND") delete = true; } - + if (delete && !g.IsAttachment && !deletes.Contains(g)) deletes.Add(g); }); - + if (deletes.Count == 0) m_console.OutputFormat("No objects were found outside region bounds"); - + break; case "pos": @@ -864,7 +864,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands "Are you sure that you want to delete {0} objects from {1}", deletes.Count, m_scene.RegionInfo.RegionName), "y/N"); - + if (response.ToLower() != "y") { MainConsole.Instance.OutputFormat( @@ -951,7 +951,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands { m_console.OutputFormat("Error: Start vector '{0}' does not have a valid format", rawConsoleStartVector); endVector = Vector3.Zero; - + return false; } diff --git a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs index 06900f0..1a61771 100644 --- a/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs +++ b/OpenSim/Region/CoreModules/World/Permissions/PermissionsModule.cs @@ -47,7 +47,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions public class DefaultPermissionsModule : INonSharedRegionModule, IPermissionsModule { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected Scene m_scene; protected bool m_Enabled; @@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions private uint PERM_MOVE = (uint)524288; private uint PERM_TRANS = (uint)8192; private uint PERM_LOCKED = (uint)540672; - + /// /// Different user set names that come in from the configuration file. /// @@ -110,17 +110,17 @@ namespace OpenSim.Region.CoreModules.World.Permissions private UserSet m_allowedScriptCreators = UserSet.All; /// - /// The set of users that are allowed to edit (save) scripts. This is only active if + /// The set of users that are allowed to edit (save) scripts. This is only active if /// permissions are not being bypassed. This overrides normal permissions.- /// private UserSet m_allowedScriptEditors = UserSet.All; - + private Dictionary GrantLSL = new Dictionary(); private Dictionary GrantCS = new Dictionary(); private Dictionary GrantVB = new Dictionary(); private Dictionary GrantJS = new Dictionary(); private Dictionary GrantYP = new Dictionary(); - + private IFriendsModule m_friendsModule; private IFriendsModule FriendsModule { @@ -169,20 +169,20 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_Enabled = true; m_allowGridGods = Util.GetConfigVarFromSections(config, "allow_grid_gods", - new string[] { "Startup", "Permissions" }, false); + new string[] { "Startup", "Permissions" }, false); m_bypassPermissions = !Util.GetConfigVarFromSections(config, "serverside_object_permissions", - new string[] { "Startup", "Permissions" }, true); + new string[] { "Startup", "Permissions" }, true); m_propagatePermissions = Util.GetConfigVarFromSections(config, "propagate_permissions", - new string[] { "Startup", "Permissions" }, true); + new string[] { "Startup", "Permissions" }, true); m_RegionOwnerIsGod = Util.GetConfigVarFromSections(config, "region_owner_is_god", - new string[] { "Startup", "Permissions" }, true); + new string[] { "Startup", "Permissions" }, true); m_RegionManagerIsGod = Util.GetConfigVarFromSections(config, "region_manager_is_god", - new string[] { "Startup", "Permissions" }, false); + new string[] { "Startup", "Permissions" }, false); m_ParcelOwnerIsGod = Util.GetConfigVarFromSections(config, "parcel_owner_is_god", new string[] { "Startup", "Permissions" }, false); m_SimpleBuildPermissions = Util.GetConfigVarFromSections(config, "simple_build_permissions", - new string[] { "Startup", "Permissions" }, false); + new string[] { "Startup", "Permissions" }, false); m_allowedScriptCreators = ParseUserSetConfigSetting(config, "allowed_script_creators", m_allowedScriptCreators); @@ -206,7 +206,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions } grant = Util.GetConfigVarFromSections(config, "GrantCS", - new string[] { "Startup", "Permissions" }, string.Empty); + new string[] { "Startup", "Permissions" }, string.Empty); if (grant.Length > 0) { foreach (string uuidl in grant.Split(',')) @@ -273,46 +273,46 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.Permissions.OnIsAdministrator += IsAdministrator; m_scene.Permissions.OnIsEstateManager += IsEstateManager; m_scene.Permissions.OnDuplicateObject += CanDuplicateObject; - m_scene.Permissions.OnDeleteObject += CanDeleteObject; - m_scene.Permissions.OnEditObject += CanEditObject; - m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; + m_scene.Permissions.OnDeleteObject += CanDeleteObject; + m_scene.Permissions.OnEditObject += CanEditObject; + m_scene.Permissions.OnEditParcelProperties += CanEditParcelProperties; m_scene.Permissions.OnInstantMessage += CanInstantMessage; - m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; - m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; - m_scene.Permissions.OnMoveObject += CanMoveObject; + m_scene.Permissions.OnInventoryTransfer += CanInventoryTransfer; + m_scene.Permissions.OnIssueEstateCommand += CanIssueEstateCommand; + m_scene.Permissions.OnMoveObject += CanMoveObject; m_scene.Permissions.OnObjectEntry += CanObjectEntry; - m_scene.Permissions.OnReturnObjects += CanReturnObjects; - m_scene.Permissions.OnRezObject += CanRezObject; + m_scene.Permissions.OnReturnObjects += CanReturnObjects; + m_scene.Permissions.OnRezObject += CanRezObject; m_scene.Permissions.OnRunConsoleCommand += CanRunConsoleCommand; - m_scene.Permissions.OnRunScript += CanRunScript; + m_scene.Permissions.OnRunScript += CanRunScript; m_scene.Permissions.OnCompileScript += CanCompileScript; m_scene.Permissions.OnSellParcel += CanSellParcel; m_scene.Permissions.OnTakeObject += CanTakeObject; m_scene.Permissions.OnSellGroupObject += CanSellGroupObject; m_scene.Permissions.OnTakeCopyObject += CanTakeCopyObject; m_scene.Permissions.OnTerraformLand += CanTerraformLand; - m_scene.Permissions.OnLinkObject += CanLinkObject; - m_scene.Permissions.OnDelinkObject += CanDelinkObject; - m_scene.Permissions.OnBuyLand += CanBuyLand; - - m_scene.Permissions.OnViewNotecard += CanViewNotecard; - m_scene.Permissions.OnViewScript += CanViewScript; - m_scene.Permissions.OnEditNotecard += CanEditNotecard; - m_scene.Permissions.OnEditScript += CanEditScript; - + m_scene.Permissions.OnLinkObject += CanLinkObject; + m_scene.Permissions.OnDelinkObject += CanDelinkObject; + m_scene.Permissions.OnBuyLand += CanBuyLand; + + m_scene.Permissions.OnViewNotecard += CanViewNotecard; + m_scene.Permissions.OnViewScript += CanViewScript; + m_scene.Permissions.OnEditNotecard += CanEditNotecard; + m_scene.Permissions.OnEditScript += CanEditScript; + m_scene.Permissions.OnCreateObjectInventory += CanCreateObjectInventory; m_scene.Permissions.OnEditObjectInventory += CanEditObjectInventory; - m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; - m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; + m_scene.Permissions.OnCopyObjectInventory += CanCopyObjectInventory; + m_scene.Permissions.OnDeleteObjectInventory += CanDeleteObjectInventory; m_scene.Permissions.OnResetScript += CanResetScript; - - m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; - m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; - m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; - m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; - - m_scene.Permissions.OnTeleport += CanTeleport; - + + m_scene.Permissions.OnCreateUserInventory += CanCreateUserInventory; + m_scene.Permissions.OnCopyUserInventory += CanCopyUserInventory; + m_scene.Permissions.OnEditUserInventory += CanEditUserInventory; + m_scene.Permissions.OnDeleteUserInventory += CanDeleteUserInventory; + + m_scene.Permissions.OnTeleport += CanTeleport; + m_scene.Permissions.OnControlPrimMedia += CanControlPrimMedia; m_scene.Permissions.OnInteractWithPrimMedia += CanInteractWithPrimMedia; @@ -329,8 +329,8 @@ namespace OpenSim.Region.CoreModules.World.Permissions m_scene.AddCommand("Debug", this, "debug permissions", "debug permissions ", "Turn on permissions debugging", - HandleDebugPermissions); - + HandleDebugPermissions); + } public void RegionLoaded(Scene scene) @@ -441,7 +441,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions { m_scene.EventManager.TriggerPermissionError(user, reason); } - + protected void DebugPermissionInformation(string permissionCalled) { if (m_debugPermissions) @@ -471,7 +471,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return false; } - + /// /// Parse a user set configuration setting /// @@ -483,28 +483,28 @@ namespace OpenSim.Region.CoreModules.World.Permissions { UserSet userSet = defaultValue; - string rawSetting = Util.GetConfigVarFromSections(config, settingName, - new string[] {"Startup", "Permissions"}, defaultValue.ToString()); - + string rawSetting = Util.GetConfigVarFromSections(config, settingName, + new string[] {"Startup", "Permissions"}, defaultValue.ToString()); + // Temporary measure to allow 'gods' to be specified in config for consistency's sake. In the long term // this should disappear. if ("gods" == rawSetting.ToLower()) rawSetting = UserSet.Administrators.ToString(); - + // Doing it this was so that we can do a case insensitive conversion try { userSet = (UserSet)Enum.Parse(typeof(UserSet), rawSetting, true); } - catch + catch { m_log.ErrorFormat( "[PERMISSIONS]: {0} is not a valid {1} value, setting to {2}", rawSetting, settingName, userSet); } - + m_log.DebugFormat("[PERMISSIONS]: {0} {1}", settingName, userSet); - + return userSet; } @@ -520,7 +520,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (m_scene.RegionInfo.EstateSettings.EstateOwner == user && m_RegionOwnerIsGod) return true; - + if (IsEstateManager(user) && m_RegionManagerIsGod) return true; @@ -558,7 +558,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions } protected bool IsFriendWithPerms(UUID user, UUID objectOwner) - { + { if (user == UUID.Zero) return false; @@ -572,7 +572,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions protected bool IsEstateManager(UUID user) { if (user == UUID.Zero) return false; - + return m_scene.RegionInfo.EstateSettings.IsEstateManagerOrOwner(user); } @@ -777,7 +777,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // so just return true immediately and short circuit the more // expensive group checks return true; - + //permission = true; } else if (group.IsAttachment) @@ -786,15 +786,15 @@ namespace OpenSim.Region.CoreModules.World.Permissions } // m_log.DebugFormat( -// "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}", +// "[PERMISSIONS]: group.GroupID = {0}, part.GroupMask = {1}, isGroupMember = {2} for {3}", // group.GroupID, -// m_scene.GetSceneObjectPart(objId).GroupMask, -// IsGroupMember(group.GroupID, currentUser, 0), +// m_scene.GetSceneObjectPart(objId).GroupMask, +// IsGroupMember(group.GroupID, currentUser, 0), // currentUser); - + // Group members should be able to edit group objects - if ((group.GroupID != UUID.Zero) - && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) + if ((group.GroupID != UUID.Zero) + && ((m_scene.GetSceneObjectPart(objId).GroupMask & (uint)PermissionMask.Modify) != 0) && IsGroupMember(group.GroupID, currentUser, 0)) { // Return immediately, so that the administrator can shares group objects @@ -807,7 +807,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions // Return immediately, so that the administrator can share objects with friends return true; } - + // Users should be able to edit what is over their land. ILandObject parcel = m_scene.LandChannel.GetLandObject(group.AbsolutePosition.X, group.AbsolutePosition.Y); if ((parcel != null) && (parcel.LandData.OwnerID == currentUser)) @@ -904,7 +904,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return permission; } - + protected bool GenericParcelOwnerPermission(UUID user, ILandObject parcel, ulong groupPowers, bool allowEstateManager) { if (parcel.LandData.OwnerID == user) @@ -919,7 +919,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions { return true; } - + if (allowEstateManager && IsEstateManager(user)) { return true; @@ -946,7 +946,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - + return GenericParcelOwnerPermission(user, parcel, (ulong)GroupPowers.LandRelease, false); } @@ -1007,7 +1007,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions //They can't even edit the object return false; } - + SceneObjectPart part = scene.GetSceneObjectPart(objectID); if (part == null) return false; @@ -1025,7 +1025,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if ((part.GroupMask & PERM_COPY) == 0) return false; } - + //If they can rez, they can duplicate return CanRezObject(objectCount, owner, objectPosition, scene); } @@ -1074,10 +1074,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions { DebugPermissionInformation(MethodInfo.GetCurrentMethod().Name); if (m_bypassPermissions) return m_bypassPermissionsValue; - + if (m_allowedScriptEditors == UserSet.Administrators && !IsAdministrator(user)) return false; - + // Ordinarily, if you can view it, you can edit it // There is no viewing a no mod script // @@ -1135,10 +1135,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (!IsGroupMember(part.GroupID, user, 0)) return false; - + if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) return false; - } + } else { if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) @@ -1572,7 +1572,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if ((so.GetEffectivePermissions() & PERM_COPY) != PERM_COPY) permission = false; } - + return permission; } @@ -1662,7 +1662,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (part == null) return false; - + if (part.OwnerID != user) { if (part.GroupID == UUID.Zero) @@ -1670,11 +1670,11 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (!IsGroupMember(part.GroupID, user, 0)) return false; - + if ((part.GroupMask & (uint)PermissionMask.Modify) == 0) return false; - } - else + } + else { if ((part.OwnerMask & (uint)PermissionMask.Modify) == 0) return false; @@ -1684,12 +1684,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (ti == null) return false; - + if (ti.OwnerID != user) { if (ti.GroupID == UUID.Zero) return false; - + if (!IsGroupMember(ti.GroupID, user, 0)) return false; } @@ -1746,12 +1746,12 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (part == null) return false; - + if (part.OwnerID != user) { if (part.GroupID == UUID.Zero) return false; - + if (!IsGroupMember(part.GroupID, user, 0)) return false; } @@ -1768,7 +1768,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions { if (ti.GroupID == UUID.Zero) return false; - + if (!IsGroupMember(ti.GroupID, user, 0)) return false; } @@ -1863,7 +1863,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; } - + /// /// Check whether the specified user is allowed to create the given inventory type in their inventory. /// @@ -1878,10 +1878,10 @@ namespace OpenSim.Region.CoreModules.World.Permissions if ((int)InventoryType.LSL == invType) if (m_allowedScriptCreators == UserSet.Administrators && !IsAdministrator(userID)) return false; - + return true; } - + /// /// Check whether the specified user is allowed to copy the given inventory type in their inventory. /// @@ -1895,7 +1895,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; } - + /// /// Check whether the specified user is allowed to edit the given inventory item within their own inventory. /// @@ -1909,7 +1909,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return true; } - + /// /// Check whether the specified user is allowed to delete the given inventory item from their own inventory. /// @@ -1947,7 +1947,7 @@ namespace OpenSim.Region.CoreModules.World.Permissions return GenericObjectPermission(agentID, prim, false); } - private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) + private bool CanCompileScript(UUID ownerUUID, int scriptType, Scene scene) { //m_log.DebugFormat("check if {0} is allowed to compile {1}", ownerUUID, scriptType); switch (scriptType) { @@ -1981,64 +1981,64 @@ namespace OpenSim.Region.CoreModules.World.Permissions } return(false); } - + private bool CanControlPrimMedia(UUID agentID, UUID primID, int face) { // m_log.DebugFormat( // "[PERMISSONS]: Performing CanControlPrimMedia check with agentID {0}, primID {1}, face {2}", // agentID, primID, face); - + if (null == MoapModule) return false; - + SceneObjectPart part = m_scene.GetSceneObjectPart(primID); if (null == part) return false; - + MediaEntry me = MoapModule.GetMediaEntry(part, face); - + // If there is no existing media entry then it can be controlled (in this context, created). if (null == me) return true; - + // m_log.DebugFormat( -// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", +// "[PERMISSIONS]: Checking CanControlPrimMedia for {0} on {1} face {2} with control permissions {3}", // agentID, primID, face, me.ControlPermissions); - + return GenericObjectPermission(agentID, part.ParentGroup.UUID, true); } - + private bool CanInteractWithPrimMedia(UUID agentID, UUID primID, int face) { // m_log.DebugFormat( // "[PERMISSONS]: Performing CanInteractWithPrimMedia check with agentID {0}, primID {1}, face {2}", // agentID, primID, face); - + if (null == MoapModule) return false; - + SceneObjectPart part = m_scene.GetSceneObjectPart(primID); if (null == part) return false; - + MediaEntry me = MoapModule.GetMediaEntry(part, face); - + // If there is no existing media entry then it can be controlled (in this context, created). if (null == me) return true; - + // m_log.DebugFormat( -// "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", +// "[PERMISSIONS]: Checking CanInteractWithPrimMedia for {0} on {1} face {2} with interact permissions {3}", // agentID, primID, face, me.InteractPermissions); - + return GenericPrimMediaPermission(part, agentID, me.InteractPermissions); } - + private bool GenericPrimMediaPermission(SceneObjectPart part, UUID agentID, MediaPermission perms) { // if (IsAdministrator(agentID)) // return true; - + if ((perms & MediaPermission.Anyone) == MediaPermission.Anyone) return true; @@ -2047,13 +2047,13 @@ namespace OpenSim.Region.CoreModules.World.Permissions if (agentID == part.OwnerID) return true; } - + if ((perms & MediaPermission.Group) == MediaPermission.Group) { if (IsGroupMember(part.GroupID, agentID, 0)) return true; } - + return false; } } diff --git a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs index 411c4d6..49246a2 100644 --- a/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RegionCommandsModule.cs @@ -54,24 +54,24 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands private ICommandConsole m_console; public string Name { get { return "Region Commands Module"; } } - + public Type ReplaceableInterface { get { return null; } } - + public void Initialise(IConfigSource source) { // m_log.DebugFormat("[REGION COMMANDS MODULE]: INITIALIZED MODULE"); } - + public void PostInitialise() { // m_log.DebugFormat("[REGION COMMANDS MODULE]: POST INITIALIZED MODULE"); } - + public void Close() { // m_log.DebugFormat("[REGION COMMANDS MODULE]: CLOSED MODULE"); } - + public void AddRegion(Scene scene) { // m_log.DebugFormat("[REGION COMMANDS MODULE]: REGION {0} ADDED", scene.RegionInfo.RegionName); @@ -87,14 +87,14 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands m_console.Commands.AddCommand( "Regions", false, "show region", "show region", - "Show control information for the currently selected region (host name, max physical prim size, etc).", + "Show control information for the currently selected region (host name, max physical prim size, etc).", "A synonym for \"region get\"", HandleShowRegion); m_console.Commands.AddCommand( "Regions", false, "region get", "region get", - "Show control information for the currently selected region (host name, max physical prim size, etc).", + "Show control information for the currently selected region (host name, max physical prim size, etc).", "Some parameters can be set with the \"region set\" command.\n" + "Others must be changed via a viewer (usually via the region/estate dialog box).", HandleShowRegion); @@ -204,7 +204,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands { MainConsole.Instance.OutputFormat("Usage: region set "); return; - } + } string param = args[2]; string rawValue = args[3]; @@ -225,7 +225,7 @@ namespace OpenSim.Region.CoreModules.World.Objects.Commands if (newValue > ri.AgentCapacity) { MainConsole.Instance.OutputFormat( - "Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit", + "Cannot set {0} to {1} in {2} as max-agent-limit is {3}", "agent-limit", newValue, m_scene.Name, ri.AgentCapacity); } else diff --git a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs index e6a0205..8bac9e6 100644 --- a/OpenSim/Region/CoreModules/World/Region/RestartModule.cs +++ b/OpenSim/Region/CoreModules/World/Region/RestartModule.cs @@ -78,22 +78,22 @@ namespace OpenSim.Region.CoreModules.World.Region scene.RegionInfo.RegionID.ToString())); m_Scene = scene; - + scene.RegisterModuleInterface(this); MainConsole.Instance.Commands.AddCommand("Regions", false, "region restart bluebox", "region restart bluebox +", - "Schedule a region restart", + "Schedule a region restart", "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a dismissable bluebox notice. If multiple deltas are given then a notice is sent when we reach each delta.", HandleRegionRestart); - + MainConsole.Instance.Commands.AddCommand("Regions", false, "region restart notice", "region restart notice +", - "Schedule a region restart", + "Schedule a region restart", "Schedule a region restart after a given number of seconds. If one delta is given then the region is restarted in delta seconds time. A time to restart is sent to users in the region as a transient notice. If multiple deltas are given then a notice is sent when we reach each delta.", HandleRegionRestart); - + MainConsole.Instance.Commands.AddCommand("Regions", false, "region restart abort", "region restart abort []", @@ -183,7 +183,7 @@ namespace OpenSim.Region.CoreModules.World.Region nextAlert = m_Alerts[1]; break; } - + int currentAlert = m_Alerts[0]; m_Alerts.RemoveAt(0); @@ -242,7 +242,7 @@ namespace OpenSim.Region.CoreModules.World.Region else { m_log.WarnFormat( - "[RESTART MODULE]: Tried to set restart timer to {0} in {1}, which is not a valid interval", + "[RESTART MODULE]: Tried to set restart timer to {0} in {1}, which is not a valid interval", intervalSeconds, m_Scene.Name); } } @@ -286,7 +286,7 @@ namespace OpenSim.Region.CoreModules.World.Region File.Delete(Path.Combine(m_MarkerPath, m_Scene.RegionInfo.RegionID.ToString())); } - + private void HandleRegionRestart(string module, string[] args) { if (!(MainConsole.Instance.ConsoleScene is Scene)) diff --git a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs index e0247d9..c9bc335 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/SerialiserModule.cs @@ -45,7 +45,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "SerialiserModule")] public class SerialiserModule : ISharedRegionModule, IRegionSerialiserModule { - private static readonly ILog m_log = + private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); // private Commander m_commander = new Commander("export"); @@ -55,15 +55,15 @@ namespace OpenSim.Region.CoreModules.World.Serialiser #region ISharedRegionModule Members - public Type ReplaceableInterface - { + public Type ReplaceableInterface + { get { return null; } } public void Initialise(IConfigSource source) { IConfig config = source.Configs["Serialiser"]; - if (config != null) + if (config != null) { m_savedir = config.GetString("save_dir", m_savedir); } @@ -150,7 +150,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser { SceneXmlLoader.SavePrimsToXml2(scene, stream, min, max); } - + public void SaveNamedPrimsToXml2(Scene scene, string primName, string fileName) { SceneXmlLoader.SaveNamedPrimsToXml2(scene, primName, fileName); diff --git a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs index a5bb1a7..c9e3141 100644 --- a/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs +++ b/OpenSim/Region/CoreModules/World/Serialiser/Tests/SerialiserTests.cs @@ -43,7 +43,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests [TestFixture] public class SerialiserTests : OpenSimTestCase { - private const string ObjectRootPartStubXml = + private const string ObjectRootPartStubXml = @" @@ -149,9 +149,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests MyNamespace - + MyStore - + the answer 42 @@ -162,12 +162,12 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests "; - private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml + + private const string ObjectWithNoOtherPartsXml = ObjectRootPartStubXml + @" "; - private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml + + private const string ObjectWithOtherPartsXml = ObjectRootPartStubXml + @" @@ -574,9 +574,9 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests MyNamespace - + MyStore - + last words Rosebud @@ -636,7 +636,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests Assert.That(part.Name, Is.EqualTo("PrimMyRide")); OSDMap store = part.DynAttrs.GetStore("MyNamespace", "MyStore"); Assert.AreEqual(42, store["the answer"].AsInteger()); - } + } { SceneObjectPart part = parts[1]; @@ -723,7 +723,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests xtr.ReadStartElement("SceneObjectGroup"); xtr.ReadStartElement("RootPart"); xtr.ReadStartElement("SceneObjectPart"); - + UUID uuid = UUID.Zero; string name = null; UUID creatorId = UUID.Zero; @@ -733,7 +733,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests { if (xtr.NodeType != XmlNodeType.Element) continue; - + switch (xtr.Name) { case "UUID": @@ -833,7 +833,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests XmlTextReader xtr = new XmlTextReader(new StringReader(xml2)); xtr.ReadStartElement("SceneObjectGroup"); xtr.ReadStartElement("SceneObjectPart"); - + UUID uuid = UUID.Zero; string name = null; UUID creatorId = UUID.Zero; @@ -843,7 +843,7 @@ namespace OpenSim.Region.CoreModules.World.Serialiser.Tests { if (xtr.NodeType != XmlNodeType.Element) continue; - + switch (xtr.Name) { case "UUID": diff --git a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs index 45f3ccf..2b7db18 100644 --- a/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs +++ b/OpenSim/Region/CoreModules/World/Sound/SoundModule.cs @@ -279,7 +279,7 @@ namespace OpenSim.Region.CoreModules.World.Sound m_host.Sound = soundID; m_host.SoundGain = volume; - m_host.SoundFlags = iflags; + m_host.SoundFlags = iflags; m_host.SoundRadius = radius; m_host.ScheduleFullUpdate(); @@ -309,14 +309,14 @@ namespace OpenSim.Region.CoreModules.World.Sound else { byte bflags = 0; - + if (isMaster) bflags |= (byte)SoundFlags.SYNC_MASTER; // TODO check viewer seems to accept both if (useMaster) bflags |= (byte)SoundFlags.SYNC_SLAVE; PlayAttachedSound(soundID, part.OwnerID, part.UUID, volume, position, bflags, radius); - } + } } public void TriggerSoundLimited(UUID objectID, UUID sound, diff --git a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs index d0318eb..e2b3487 100644 --- a/OpenSim/Region/CoreModules/World/Sun/SunModule.cs +++ b/OpenSim/Region/CoreModules/World/Sun/SunModule.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules // Number of virtual days to a virtual year private int m_YearLengthDays = 0; - // Ratio of Daylight hours to Night time hours. This is accomplished by shifting the + // Ratio of Daylight hours to Night time hours. This is accomplished by shifting the // sun's orbit above the horizon private double m_HorizonShift = 0; @@ -162,7 +162,7 @@ namespace OpenSim.Region.CoreModules // Determine the current "day" from current time, so we can use "today" // to determine Seasonal Tilt and what'not - // Integer math rounded is on purpose to drop fractional day, determines number + // Integer math rounded is on purpose to drop fractional day, determines number // of virtual days since Epoch PosTime = CurrentTime / SecondsPerSunCycle; @@ -343,7 +343,7 @@ namespace OpenSim.Region.CoreModules m_log.Debug("[SUN]: Positional data updated every " + m_UpdateInterval + " frames"); } - public Type ReplaceableInterface + public Type ReplaceableInterface { get { return null; } } @@ -417,7 +417,7 @@ namespace OpenSim.Region.CoreModules client.SendSunPos(Position, Velocity, CurrentTime, SecondsPerSunCycle, SecondsPerYear, OrbitalPosition); } } - } + } public void SunUpdate() { @@ -464,7 +464,7 @@ namespace OpenSim.Region.CoreModules while (sunFixedHour < 0) sunFixedHour += 24; - + m_SunFixedHour = sunFixedHour; m_SunFixed = fixedSun; @@ -516,7 +516,7 @@ namespace OpenSim.Region.CoreModules case "current_time": return GetCurrentTimeAsLindenSunHour(); - + default: throw new Exception("Unknown sun parameter."); } diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs index 1e67f72..bcd9dcd 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/GenericSystemDrawing.cs @@ -247,4 +247,4 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders } } - + diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs index 36c2bbf..d604dc7 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/JPEG.cs @@ -104,10 +104,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders using (Bitmap gradientmapLd = new Bitmap("defaultstripe.png")) { pallete = gradientmapLd.Height; - + bmp = new Bitmap(map.Width, map.Height); colours = new Color[pallete]; - + for (int i = 0; i < pallete; i++) { colours[i] = gradientmapLd.GetPixel(0, i); diff --git a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs index 59994e4..68d6ed2 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/FileLoaders/LLRAW.cs @@ -275,6 +275,6 @@ namespace OpenSim.Region.CoreModules.World.Terrain.FileLoaders public bool SupportsTileSave() { return false; - } + } } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs b/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs index 6324aca..f7be25f 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/ITerrainFloodEffect.cs @@ -32,7 +32,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain { public interface ITerrainFloodEffect { - void FloodEffect(ITerrainChannel map, Boolean[,] fillArea, double strength, + void FloodEffect(ITerrainChannel map, Boolean[,] fillArea, double strength, int startX, int endX, int startY, int endY); } } \ No newline at end of file diff --git a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs index 3ba3657..855d131 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/ITerrainLoader.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain public interface ITerrainLoader { // Returns true if that extension can be used for terrain save-tile - // (Look into each file in Region.CoreModules.World.Terrain.FileLoaders) + // (Look into each file in Region.CoreModules.World.Terrain.FileLoaders) bool SupportsTileSave(); string FileExtension { get; } diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs index 8937f63..9d3d4cb 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/FlattenSphere.cs @@ -77,7 +77,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes { map[x, y] += delta; } - + } } } diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs index bbf9407..a88a022 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/LowerSphere.cs @@ -58,7 +58,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes map[x, y] = 0.0; else map[x, y] = newz; - } + } } } diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs index 1b704bb..5305cb4 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RaiseSphere.cs @@ -33,7 +33,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes public class RaiseSphere : ITerrainPaintableEffect { #region ITerrainPaintableEffect Members - + public void PaintEffect(ITerrainChannel map, bool[,] mask, double rx, double ry, double rz, double strength, double duration, int startX, int endX, int startY, int endY) diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs index efc5324..ca30e9e 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/RevertSphere.cs @@ -46,7 +46,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes { strength = TerrainUtil.MetersToSphericalStrength(strength); duration = 0.03; //MCP Should be read from ini file - + if (duration > 1.0) duration = 1.0; if (duration < 0) diff --git a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs index 65dd0a6..0342962 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/PaintBrushes/SmoothSphere.cs @@ -42,10 +42,10 @@ namespace OpenSim.Region.CoreModules.World.Terrain.PaintBrushes int x, y; double[,] tweak = new double[map.Width,map.Height]; - double area = strength; + double area = strength; double step = strength / 4.0; duration = 0.03; //MCP Should be read from ini file - + // compute delta map for (x = startX; x <= endX; x++) diff --git a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs index e21681d..65d4c4a 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/TerrainModule.cs @@ -218,7 +218,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain if (terrainConfig != null) { m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain); - m_sendTerrainUpdatesByViewDistance = + m_sendTerrainUpdatesByViewDistance = terrainConfig.GetBoolean( "SendTerrainUpdatesByViewDistance",m_sendTerrainUpdatesByViewDistance); } @@ -240,7 +240,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain if(m_baked != null) m_channel = m_baked.MakeCopy(); else - m_channel = new TerrainChannel(m_InitialTerrain, + m_channel = new TerrainChannel(m_InitialTerrain, (int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY, (int)m_scene.RegionInfo.RegionSizeZ); @@ -463,7 +463,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain throw new TerrainException(String.Format("unable to load heightmap from file {0}: no loader available for that format", filename)); } - public void LoadFromStream(string filename, Vector3 displacement, + public void LoadFromStream(string filename, Vector3 displacement, float rotationDegrees, Vector2 boundingOrigin, Vector2 boundingSize, Stream stream) { foreach (KeyValuePair loader in m_loaders) @@ -724,7 +724,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain /// /// Saves the current state of the region into the baked map buffer. - + /// public void UpdateBakedMap() { @@ -825,7 +825,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain m_scene.RegionInfo.RegionName, filename, m_supportFileExtensionsForTileSave); } - + /// /// This is used to check to see of any of the terrain is tainted and, if so, schedule /// updates for all the presences. @@ -945,7 +945,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain lock (m_perClientPatchUpdates) m_perClientPatchUpdates.Remove(client); } - + /// /// Scan over changes in the terrain and limit height changes. This enforces the /// non-estate owner limits on rate of terrain editting. @@ -1312,7 +1312,7 @@ namespace OpenSim.Region.CoreModules.World.Terrain } } return ret; - } + } private void client_OnModifyTerrain(UUID user, float height, float seconds, byte size, byte action, float north, float west, float south, float east, UUID agentId) diff --git a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs index 0563ad0..6a832bc 100644 --- a/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs +++ b/OpenSim/Region/CoreModules/World/Terrain/Tests/TerrainModuleTests.cs @@ -45,8 +45,8 @@ namespace OpenSim.Region.CoreModules.Terrain.Tests //UUID userId = TestHelpers.ParseTail(0x1); TerrainModule tm = new TerrainModule(); - Scene scene = new SceneHelpers().SetupScene(); - SceneHelpers.SetupSceneModules(scene, tm); + Scene scene = new SceneHelpers().SetupScene(); + SceneHelpers.SetupSceneModules(scene, tm); // Fillheight of 30 { diff --git a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs index 3f5d375..04b6f00 100644 --- a/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs +++ b/OpenSim/Region/CoreModules/World/Vegetation/VegetationModule.cs @@ -39,14 +39,14 @@ namespace OpenSim.Region.CoreModules.World.Vegetation { [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "VegetationModule")] public class VegetationModule : INonSharedRegionModule, IVegetationModule - { + { private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); - + protected Scene m_scene; - + protected static readonly PCode[] creationCapabilities = new PCode[] { PCode.Grass, PCode.NewTree, PCode.Tree }; public PCode[] CreationCapabilities { get { return creationCapabilities; } } - + public void Initialise(IConfigSource source) { } @@ -83,10 +83,10 @@ namespace OpenSim.Region.CoreModules.World.Vegetation treeShape.PCode = newTree ? (byte)PCode.NewTree : (byte)PCode.Tree; treeShape.Scale = scale; treeShape.State = (byte)treeType; - + return m_scene.AddNewPrim(uuid, groupID, position, rotation, treeShape); } - + public SceneObjectGroup CreateEntity( UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape) { @@ -95,22 +95,22 @@ namespace OpenSim.Region.CoreModules.World.Vegetation m_log.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name); return null; } - + SceneObjectGroup sceneObject = new SceneObjectGroup(ownerID, pos, rot, shape); SceneObjectPart rootPart = sceneObject.GetPart(sceneObject.UUID); - + // if grass or tree, make phantom //rootPart.TrimPermissions(); rootPart.AddFlag(PrimFlags.Phantom); if (rootPart.Shape.PCode != (byte)PCode.Grass) AdaptTree(ref shape); - + m_scene.AddNewSceneObject(sceneObject, true); sceneObject.SetGroup(groupID, null); - + return sceneObject; } - + protected void AdaptTree(ref PrimitiveBaseShape tree) { // Tree size has to be adapted depending on its type diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs index 4719ba3..226b330 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/TerrainSplat.cs @@ -226,7 +226,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap float pctX = (float)x / 255f; float pctY = (float)y / 255f; - // Use bilinear interpolation between the four corners of start height and + // Use bilinear interpolation between the four corners of start height and // height range to select the current values at this position float startHeight = ImageUtils.Bilinear( startHeights[0], @@ -257,7 +257,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap float highFreq = Perlin.turbulence2(vec.X, vec.Y, 2f) * 2.25f; float noise = (lowFreq + highFreq) * 2f; - // Combine the current height, generated noise, start height, and height range parameters, then scale all of it + // Combine the current height, generated noise, start height, and height range parameters, then scale all of it float layer = ((height + noise - startHeight) / heightRange) * 4f; if (Single.IsNaN(layer)) layer = 0f; diff --git a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs index cb37067..4934ebd 100644 --- a/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs +++ b/OpenSim/Region/CoreModules/World/Warp3DMap/Warp3DImageModule.cs @@ -96,9 +96,9 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap m_Enabled = true; - m_drawPrimVolume + m_drawPrimVolume = Util.GetConfigVarFromSections(m_config, "DrawPrimOnMapTile", configSections, m_drawPrimVolume); - m_textureTerrain + m_textureTerrain = Util.GetConfigVarFromSections(m_config, "TextureOnMapTile", configSections, m_textureTerrain); m_texturePrims = Util.GetConfigVarFromSections(m_config, "TexturePrims", configSections, m_texturePrims); @@ -277,7 +277,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap m_scene.RegionInfo.RegionSizeY * 0.5f - 0.5f); warp_Material waterColorMaterial = new warp_Material(ConvertColor(WATER_COLOR)); - waterColorMaterial.setReflectivity(0); // match water color with standard map module thanks lkalif + waterColorMaterial.setReflectivity(0); // match water color with standard map module thanks lkalif waterColorMaterial.setTransparency((byte)((1f - WATER_COLOR.A) * 255f)); renderer.Scene.addMaterial("WaterColor", waterColorMaterial); renderer.SetObjectMaterial("Water", "WaterColor"); @@ -292,7 +292,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap float regionsx = m_scene.RegionInfo.RegionSizeX; float regionsy = m_scene.RegionInfo.RegionSizeY; - + // 'diff' is the difference in scale between the real region size and the size of terrain we're buiding float diff = regionsx / 256f; @@ -377,7 +377,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap warp_Material material = new warp_Material(texture); material.setReflectivity(50); renderer.Scene.addMaterial("TerrainColor", material); - renderer.Scene.material("TerrainColor").setReflectivity(0); // reduces tile seams a bit thanks lkalif + renderer.Scene.material("TerrainColor").setReflectivity(0); // reduces tile seams a bit thanks lkalif renderer.SetObjectMaterial("Terrain", "TerrainColor"); } @@ -530,7 +530,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap if (!fetched) { - // Fetch the texture, decode and get the average color, + // Fetch the texture, decode and get the average color, // then save it to a temporary metadata asset AssetBase textureAsset = m_scene.AssetService.Get(face.TextureID.ToString()); if (textureAsset != null) @@ -616,7 +616,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap catch (Exception e) { m_log.Warn(string.Format("[WARP 3D IMAGE MODULE]: Failed to decode asset {0}, exception ", id), e); - } + } } return ret; @@ -678,10 +678,10 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap { width = bitmap.Width; height = bitmap.Height; - + BitmapData bitmapData = bitmap.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadOnly, bitmap.PixelFormat); pixelBytes = (bitmap.PixelFormat == PixelFormat.Format24bppRgb) ? 3 : 4; - + // Sum up the individual channels unsafe { @@ -690,7 +690,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap for (int y = 0; y < height; y++) { byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); - + for (int x = 0; x < width; x++) { b += row[x * pixelBytes + 0]; @@ -705,7 +705,7 @@ namespace OpenSim.Region.CoreModules.World.Warp3DMap for (int y = 0; y < height; y++) { byte* row = (byte*)bitmapData.Scan0 + (y * bitmapData.Stride); - + for (int x = 0; x < width; x++) { b += row[x * pixelBytes + 0]; diff --git a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs index 65691fe..a2b44df 100644 --- a/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs +++ b/OpenSim/Region/CoreModules/World/Wind/Plugins/ConfigurableWind.cs @@ -50,7 +50,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins private float m_avgDirection = 0.0f; // Average direction of the wind in degrees private float m_varStrength = 5.0f; // Max Strength Variance private float m_varDirection = 30.0f;// Max Direction Variance - private float m_rateChange = 1.0f; // + private float m_rateChange = 1.0f; // private Vector2 m_curPredominateWind = new Vector2(); @@ -70,7 +70,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins public void Initialise() { - + } #endregion @@ -111,7 +111,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins // Prevailing wind algorithm // Inspired by Kanker Greenacre - // TODO: + // TODO: // * This should probably be based on in-world time. // * should probably move all these local variables to class members and constants double time = DateTime.Now.TimeOfDay.Seconds / 86400.0f; @@ -125,7 +125,7 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins offset = Math.Sin(theta) * Math.Sin(theta*4) + (Math.Sin(theta*13) / 3); double windSpeed = m_avgStrength + (m_varStrength * offset); - if (windSpeed < 0) + if (windSpeed < 0) windSpeed = -windSpeed; m_curPredominateWind.X = (float)Math.Cos(windDir); @@ -157,9 +157,9 @@ namespace OpenSim.Region.CoreModules.World.Wind.Plugins public string Description { - get + get { - return "Provides a predominate wind direction that can change within configured variances for direction and speed."; + return "Provides a predominate wind direction that can change within configured variances for direction and speed."; } } diff --git a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs index 95cf57d..a1fff62 100644 --- a/OpenSim/Region/CoreModules/World/Wind/WindModule.cs +++ b/OpenSim/Region/CoreModules/World/Wind/WindModule.cs @@ -155,7 +155,7 @@ namespace OpenSim.Region.CoreModules // Register event handlers for when Avatars enter the region, and frame ticks m_scene.EventManager.OnFrame += WindUpdate; - // Register the wind module + // Register the wind module m_scene.RegisterModuleInterface(this); // Generate initial wind values @@ -351,7 +351,7 @@ namespace OpenSim.Region.CoreModules #region IWindModule Methods /// - /// Retrieve the wind speed at the given region coordinate. This + /// Retrieve the wind speed at the given region coordinate. This /// implimentation ignores Z. /// /// 0...255 @@ -396,7 +396,7 @@ namespace OpenSim.Region.CoreModules public string WindActiveModelPluginName { - get + get { if (m_activeWindPlugin != null) { @@ -429,7 +429,7 @@ namespace OpenSim.Region.CoreModules { client.SendWindData(m_dataVersion, windSpeeds); }); - + } finally { @@ -440,7 +440,7 @@ namespace OpenSim.Region.CoreModules } /// - /// Calculate new wind + /// Calculate new wind /// returns false if no change /// diff --git a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs index fb63c6a..5876df3 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/MapSearchModule.cs @@ -186,7 +186,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // remoteClient.SendAlertMessage("Hyperlink could not be established."); //m_log.DebugFormat("[MAPSEARCHMODULE]: search {0} returned {1} regions", mapName, regionInfos.Count); - + MapBlockData data; if (regionInfos != null && regionInfos.Count > 0) { @@ -214,7 +214,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap // send extra user messages for V3 // because the UI is very confusing // while we don't fix the hard-coded urls - if (flags == 2) + if (flags == 2) { if (regionInfos == null || regionInfos.Count == 0) remoteClient.SendAgentAlertMessage("No regions found with that name.", true); diff --git a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs index c249e9d..5dcf326 100644 --- a/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs +++ b/OpenSim/Region/CoreModules/World/WorldMap/WorldMapModule.cs @@ -68,7 +68,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap private static readonly UUID STOP_UUID = UUID.Random(); private OpenSim.Framework.BlockingQueue requests = new OpenSim.Framework.BlockingQueue(); - + private ManualResetEvent m_mapBlockRequestEvent = new ManualResetEvent(false); private Dictionary> m_mapBlockRequests = new Dictionary>(); @@ -729,7 +729,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap break; // agent gone? - + m_scene.TryGetScenePresence(st.agentID, out av); if (av == null || av.IsChildAgent || av.IsDeleted || av.IsInTransit) continue; @@ -748,7 +748,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap { m_cachedRegionMapItemsResponses.TryGetValue(st.regionhandle, out responseMap); dorequest = false; - } + } else m_cachedRegionMapItemsResponses.Add(st.regionhandle, null, expireResponsesTime); // a bit more time for the access } @@ -1133,7 +1133,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap if(m_mapBlockRequests[agentID].Count < 150 ) m_mapBlockRequests[agentID].Enqueue(req); else - { + { spamBlocked[agentID] = now + SPAMBLOCKTIMEms; m_log.DebugFormat("[WoldMapModule] RequestMapBlocks blocking spammer {0} for {1} s",agentID, SPAMBLOCKTIMEms/1000.0); } @@ -1193,7 +1193,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap maxY * (int)Constants.RegionSize); // only send a negative answer for a single region request - // corresponding to a click on the map. Current viewers + // corresponding to a click on the map. Current viewers // keep displaying "loading.." without this if (regions.Count == 0 && (flag & 0x10000) != 0 && minX == maxX && minY == maxY) { @@ -1539,7 +1539,7 @@ namespace OpenSim.Region.CoreModules.World.WorldMap responsemap["10"] = responsearr; else responsemap["7"] = responsearr; - } + } } if (m_scene.RegionInfo.RegionSettings.TelehubObject != UUID.Zero) -- cgit v1.1